Commit Graph

137 Commits

Author SHA1 Message Date
Guenter Roeck
155715e7ea Add preliminary support for IT8736F and IT8738E
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-02-26 21:02:58 -08:00
Guenter Roeck
496856a115 Fix scaling for IT8732F
3.3V channels report the wrong voltages on IT8732F since the scaling bit
is not set.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-02-26 19:19:09 -08:00
Guenter Roeck
d847fc0fc1 Save and restore bank around envmon register accesses if needed
If an external EC accesses the chip through SMBus registers
and if the chip's environmental registers are paged, it is likely
that the EC modifies the page register. If so, it likely will not
update the page on each access but assume that it "owns" the chip.
If the driver then modifies the page register, subsequent accesses
from the EC will likely have unpredictable results.
To avoid that problem, let's save the page register value after
disabling SMBus accesses and restore the original value when done.
This is only necessary if accesses are not handled through MMIO
since we don't touch the page register in that case.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-02-14 09:00:59 -08:00
Guenter Roeck
850c17bf06 Fix up fan / pwm detection for IT8625/IT8665
Hope it is correct this time around.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-01-19 13:31:01 -08:00
Burt P
7f59901679 Makefile: DKMS fix
Allow DKMS (or anyone) to specify TARGET in Makefile.

Signed-off-by: Burt P <pburt0@gmail.com>
2018-01-13 13:19:57 -08:00
Burt P
5edd7bb6f9 Add optional DKMS target to Makefile (v2)
Using DKMS, the driver will be automatically rebuilt when
the kernel is updated.

* `make dkms` to install via DKMS
* `make dkms_clean` to remove from DKMS

Signed-off-by: Burt P <pburt0@gmail.com>
2018-01-06 04:19:36 -08:00
Guenter Roeck
98fa33ddad README: Fix typo
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-01-03 09:27:25 -08:00
Guenter Roeck
8293dc9f82 Revert "Add optional DKMS target to Makefile"
This reverts commit 6c1e48b4f1.

See comments:

"This is indeed not working, at least on Fedora. I tried specifying
MAKE and CLEAN but the outcome is the same (which makes sense, since
the defaults should already cover this)."

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-12-30 18:26:30 -08:00
Guenter Roeck
6d26a04b3b Add comment explaining why smbus_disable is needed in probe
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-12-03 10:28:15 -08:00
Guenter Roeck
348c4c1272 Add more known problems to ISSUES file
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-12-03 10:26:43 -08:00
Guenter Roeck
f88dd6bac6 Add ISSUES file
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-12-03 10:15:06 -08:00
Burt P
6c1e48b4f1 Add optional DKMS target to Makefile
Using DKMS, the driver will be automatically rebuilt when
the kernel is updated.

* `make dkms` to install via DKMS
* `make dkms_clean` to remove from DKMS

Signed-off-by: Burt P <pburt0@gmail.com>
2017-12-03 09:53:19 -08:00
Guenter Roeck
6582b4739f Fix PECI/AMDTSI selection
We can not use register 0x98 since it is typically not programmed
on systems selecting PECI. Try register 0x0a (Interface Selection)
which should be a better fit anyway.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-07 07:38:41 -07:00
Guenter Roeck
4f8c82e23c Do not disable SMBs unless really necessary
Only disable SMBus if we are going to read/write data.
Disabling it on each attribute read can result in system
instabilities.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-06 16:14:31 -07:00
Guenter Roeck
f8240ebfd5 Report actual chip name, not its ID
For some recent chips (at least IT8792E/IT8795E), the value of the chip ID
register does not match the chip name. Display the textual, not the value
of the ID register, in the kernel log.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-02 17:24:29 -07:00
Guenter Roeck
e8f7cf1bdd Experimental support for IT8606E
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-02 11:18:33 -07:00
Guenter Roeck
1d68bab74c Makefile: Versioning, take three
Make sure the build passes if the source is not in a git repository.
Again, that means that version information won't be available, but there
is only so much we can do about that.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-02 10:53:44 -07:00
Guenter Roeck
3fde481373 Checkpatch cleanup: Line length
Try to stay below the 80-character-per-line limit.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-02 08:02:36 -07:00
Guenter Roeck
7bf9a9269a Checkpatch cleanup: Opening brackets
Checkpatch nowadays is allergic against '{' in continuation lines.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-02 08:00:03 -07:00
Guenter Roeck
071c771980 Checkpatch cleanup: Use octal file permissions
Symbolic file permissions ran out of favor and result in a checkpatch
warning. Use octal permissions instead.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-02 07:56:47 -07:00
Guenter Roeck
c693f90cea Checkpatch cleanup: Use octal permissions for module parameters
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-02 07:51:19 -07:00
Guenter Roeck
d9b09ed39a Checkpatch cleanup: Double semicolon, missing space
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-02 07:49:35 -07:00
Guenter Roeck
5e4d82b615 Drop version.h
Some distributions use their own Makefile and thus won't create version.h,
resulting in a build failure. Pass the version as define instead.
That won't help for generating the driver version with those distributions,
but at least the driver will build.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-01 19:15:58 -07:00
Guenter Roeck
e32b31eae2 Add support for 4th temperature sensor on IT8622
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-01 16:47:43 -07:00
Guenter Roeck
d198f700b9 Improve AMDTSI temp type detection, and temp 4 type detection on IT8622
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-01 16:39:31 -07:00
Guenter Roeck
5ddfe6a940 Add SMBus bitmap for IT8622
IT8622 supports two external SMBus channels. Add bitmask to disable them
while accessing the chip.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-01 15:28:24 -07:00
Guenter Roeck
68a88d99b7 Fix mmio resource request
We have to request a memory resource with IORESOURCE_MEM.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-01 13:40:18 -07:00
Guenter Roeck
a997a09938 IT8655E supports MMIO
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-01 13:05:13 -07:00
Guenter Roeck
d86efa30a3 Print MMIO address into kernel log
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-01 13:02:59 -07:00
Guenter Roeck
57301c6b5d Update README to describe new module parameters
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-01 12:52:34 -07:00
Guenter Roeck
851a92d074 Add MMIO support
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-30 23:50:09 -07:00
Guenter Roeck
78afa4ee1a Disable SMBus access while accessing Enviromnental Controller registers
Some chips support Environmental Controller access through SMBus.
On those chips, it is possible that an Embedded Controller accesses
Environmental Controller chip registers at any time. There is no real
means for synchronization. On banked chips, this can and will result in
access errors with unpredictable result.

Disable SMBus access while reading or writing environmental controller
registers to work around the problem.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-30 09:23:47 -07:00
Guenter Roeck
4d29188e4f Fix FAN_TAC5 detection for IT8665E
FAN_TAC5 is connected if 26h[4]=0.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-24 08:10:16 -07:00
Guenter Roeck
32d442e05e Remove version.h when running clean, and clean does not depend on version.h
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-24 04:20:38 -07:00
Guenter Roeck
bde0232c73 Ignore version.h
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-24 04:19:12 -07:00
Guenter Roeck
247605bba6 it87: Display driver version
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-24 04:15:47 -07:00
Guenter Roeck
e7caee4aaf Makefile: Generate version.h
Update version after each change in it87.c.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-24 04:15:20 -07:00
Guenter Roeck
59ea85eb83 Simplify and fix temperature sensor type detection
Temperature sensor types won't change, so we only need to read it once.
Also fix temperature register calculation.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
v1.0
2017-09-21 16:21:28 -07:00
Guenter Roeck
0e859b5743 Always restore previous bank register after reading/writing data
There is some indication that other entities (BIOS ? EC ?) may access
the chip asynchronously. Restore the bank selection after read/write
operations to limit any potenial impact.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-21 15:26:02 -07:00
Guenter Roeck
880d3d6ad7 Improve temperature sensor type detection for IT8686
Introduce two new type values, 7 for 'virtual' and 8 for 'other'.
This will need to be added to the ABI once approved.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-21 15:19:05 -07:00
Guenter Roeck
0e789c5deb Fix reworked temperature mapping
With the reworked temperature mapping it was no longer possible to set
manual mode since the 'automatic' configuration bit was never cleared.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-20 22:33:31 -07:00
Guenter Roeck
15d49c0592 Update README
Add a note on sensors-detect. Remove some obsolete information.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-20 17:27:09 -07:00
Guenter Roeck
93c90ab749 Remove TODO
It is obsolete.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-20 17:20:53 -07:00
Guenter Roeck
74647ea3f4 Try to add support for automatically detected build directories
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-20 15:46:28 -07:00
Guenter Roeck
67f8b470ec Add 'ignore_resource_conflict' error
It appears that some BIOSes reserve ACPI resources without using them,
and acpi_enable_resources=lax seems to result in failures to load
certain drivers.

Introduce a 'ignore_resource_conflict' module parameter as alternate
means to ignore ACPI resource conflicts.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-20 15:19:33 -07:00
Guenter Roeck
e140a1cda3 Makefile: Add support for compressed modules
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-15 08:15:05 -07:00
Guenter Roeck
aeafb7be7c Rework pwm temperature mapping
Various chips have different numbers of valid values for pwm temperature
mapping. Rework the code to take this into account.

No longer keep map as bitmap, but maintain it as number 1..X. Do not try to
define a separate mapping entry for pwm4..6 on chips where the temperature
map for those pwm controls is taken from a different temperature input.
Introduce helpers to convert the control register contents to a map and
vice versa.

Reflect that IT8607 uses the new temperature map in bit 3..5 of the pwm
control register.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-04 08:42:57 -07:00
Guenter Roeck
21b0f8cf1e Update pwm cached control registers before writing pwm enable
If pwmX_enable is written prior to displaying any attributes,
t87_update_pwm_ctrl() is never called, and the cached pwm registers
are never read before written. This results in bad values written
into various registers, and can result in operational failures.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-03 14:01:47 -07:00
Yohan Pereira
b9deb7cb41 Create the hwmon folder if it does not exist 2017-08-27 10:18:07 -07:00
Guenter Roeck
c01952b9ca IT8655E and IT8665E both support internal register scaling
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-08-08 06:35:46 -07:00