Commit Graph

82 Commits

Author SHA1 Message Date
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
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
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
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
Guenter Roeck
e7762ac1c0 Force IT8790E and IT8792E into configuration mode
IT8790E and IT8792E need to be in configuration mode to avoid LPC bus errors.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-08-06 15:12:58 -07:00
Guenter Roeck
ce2074226c Drop ACPI mutex code
The observed problems with IT8792E were after all not caused by ACPI
mutex problems, so drop that code for now.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-08-06 14:08:45 -07:00
Guenter Roeck
485178c1ec Fix accesses to IT8792E
If IT8792E or a compatible chip such as IT8795 (which has the same chip ID,
0x8733) resides at SIO address 0x4e/0x4f, and another Super-IO chip is at
SIO address 0x2e/0x2f, the IT8792E causes a cycle decode problem when exiting
its configuration mode. This can result in access errors for both chips, and
may result in system hangs.

Never exit configuration mode for IT8792E to avoid the problem.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-08-05 12:54:37 -07:00
Guenter Roeck
beecac84d9 IT8607 does not support the 1st fan, only fan2-3
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-07-23 07:29:38 -07:00
Guenter Roeck
0459e7fb72 Drop FEAT_TEMP_OFFSET
Since we now count the number of temperature offset registers directly,
there is no need for the temperature offset feature flag anymore.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-06-07 17:19:15 -07:00
Guenter Roeck
f9a7bd87c2 Add support for 6 temperature limit registers on IT8628E
IT8628E has 6 temperature limit registers, overlayed with VIN7..VIN9
limit registers, but only 3 temperature offset registers. Given that,
introduce separate variables for the number of temperature limit
registers and the number of temperature offset registers.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-06-07 17:15:04 -07:00
Guenter Roeck
ab6262dbaa Provide blacklist module parameter to override blacklist.
Load module with blacklist=0 to override blacklist.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-05-23 06:05:29 -07:00
Guenter Roeck
80e1901056 Mark 2nd Super-IO chip on AB350M-D3H as broken
Configuration register access of the second Super-IO chip on AB350M-D3H
is just as broken as the others and can result in the known system hang-up.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-05-15 21:15:55 -07:00
Justin Maggard
a0037eceb2 Fix up support for IT8625E
Add missing scaling feature and fix broken temp type detection on temp
1-3 sensors.
2017-05-11 13:39:42 -07:00
Justin Maggard
1ae160bdac Add support for IT8625E
This is mostly identical to IT8665E, with the exception of the
configuration bits for fans 4 and 5.

Signed-off-by: Justin Maggard <jmaggard@netgear.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-05-02 14:10:15 -07:00
Guenter Roeck
0641683676 Fix whitespace issues
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-04-26 21:48:56 -07:00
Guenter Roeck
dc13e2af51 Initialize register pointers before using them
Register pointers have to be initialized before they can be used in
it87_check_pwm().

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-04-26 14:28:27 -07:00
koji54
274e450b8a Add Gigabyte AX370-Gaming 5 to IT8792E blacklist
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-04-23 08:29:41 -07:00
Guenter Roeck
81f5383779 Introduce FEAT_NEW_TEMPMAP
Several recent chips have a different register definition for
temperature to pwm assignment. Introduce FEAT_NEW_TEMPMAP to reflect
this and assign to affected chips.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-04-18 21:57:08 -07:00
Guenter Roeck
577e315aef Fix up support for IT8613E
Feature detection and pwm temperature mapping differs from other chips.
Also disable pwm1, fan1, vin3, and vin6.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-04-18 20:40:05 -07:00
andreychernyshev
13a3394e95 Add support for IT8613E
[groeck: Fix README]

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-04-18 20:23:47 -07:00
Guenter Roeck
4d9b49a4df Blacklist IT8792E on AX370-Gaming K7
Accessing it may result in a system hang.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-04-18 14:49:22 -07:00
Guenter Roeck
c242e32088 Disable access to 2nd Super-IO chip
It is known to be broken.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-04-18 10:12:52 -07:00
Guenter Roeck
c792ed3cd4 FEAT_TEMP_PECI does not apply to multi-bank chips.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-04-13 07:05:13 -07:00
Guenter Roeck
44b36fe732 Add support for 11mV ADC
The ADC LSB on some newer chips such as IT8613E and IT8625E is
officially 11mV, not 10.9mV. Add support for it.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-04-13 06:02:32 -07:00
Guenter Roeck
3ceb87c426 Fix up temp offset register addresses
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-04-12 06:32:49 -07:00
Guenter Roeck
57d4d8b8fa Various improvements
- Acquire acpi mutex (not supported in upstream kernel)
- Try to handle 0x4e access failures on Gigabyte boards
- Improve temperature register / limit / type support for recent chips

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-04-12 06:15:24 -07:00
Guenter Roeck
416cfbcd4a Add limit support for temp 4-6
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-04-11 06:48:01 -07:00
Guenter Roeck
75fdbbca75 Add feature flag FEAT_FANCTL_ONOFF
Several recent chips don't support configuration bits to turn fan control
off entirely for the first three fans. Handle all of them with a
configuration flag.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-03-28 06:28:11 -07:00
Guenter Roeck
dd74adce93 Improve AVCC3 support
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-03-25 07:05:41 -07:00
Guenter Roeck
2e2228dd1d Preliminary support for IT8655E
Assume it is similar to IT8665E with three instead of six fans.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-03-22 00:54:35 -07:00
Guenter Roeck
3be51e20cb Add support for chip specific register sets
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-03-22 00:39:08 -07:00
Drew
20dba182dc Added preliminary support for IT8665E
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-03-22 00:39:06 -07:00
Guenter Roeck
75aed2c2ba Separate internal scaling from 12mV ADC
Some chips have internal voltage scaling but 10.9mV ADC,
so we can no longer associate the 12mV ADC with internal scaling
but need a different flag to distinguish scaling support.

Also fix ADC resolution for IT8790E and IT8792E.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-03-20 17:45:12 -07:00
Guenter Roeck
4f62f4d0fd Add multi-bank and initial IT8686E support
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-03-16 10:39:01 -07:00
Guenter Roeck
93d58d34ac Force chip ID only if a chip has been found
If the reported chip ID is 0xffff, there is no chip, and forcing the chip
type does not add value.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-03-14 10:11:31 -07:00
Guenter Roeck
406e764eb0 Add 4th fan control and measurement for IT8732E
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-03-11 08:39:40 -08:00
Guenter Roeck
b8bbc81f69 Fix feature mask for IT8792E (IT8733E)
The chip features match those of IT8790E. Most important is the
ADC resolution, which is 12 mV, not 10.9 mV.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-03-10 09:06:17 -08:00
Guenter Roeck
294699b7d2 Do not overwrite bit 2..6 of pwm control registers
In IT8620E, after setting pwm control to manual, it was observed that
pwm values for fan 4..6 have reversed results (writing 0 results in fans
running at full speed, writing 255 results in fans turned off).

With the new PWM control, pwm polarity for pwm control 4..6 is specified
in its pwm control registers. Those registers are overwritten when setting
the pwm mode or the temperature mapping. Do not touch bit 2..6 of pwm
control registers on register writes to fix the problem.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-08 09:18:22 -08:00
Guenter Roeck
dce3d8968b Fix fan4_ctl detection for IT8620, IT8628
fan4 control is enabled if bit 2 of GPIO control register 4 is disabled,
not when it is enabled. Since the check is for the skip condition, it is
reversed. This applies to both IT8620 and IT8628.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-08 06:30:54 -08:00
Guenter Roeck
c7994710d1 Experimental support for IT8607E
Assume for now that in5 and in6 are supported, and that fan control
is standard (unlike IT8603E).

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-12-28 20:45:31 -08:00
Guenter Roeck
88d0e632ef Add preliminary support for IT8792E
The chip is similar to IT8732E, but supports only three fans
instead of four (the driver currently does not support the 4th
fan on IT8732E).

Note that the chip ID is 0x8733, not 0x8792 as one would expect.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-12-28 18:32:14 -08:00
Guenter Roeck
bb613ebca4 Ensure that pwm control cache is current before updating values
If sensor attributes were never read, the pwm control data has not been
initiialized, which can cause wrong driver behavior. Ensure that cached
data is current before acting on it.

Reported-by: Kevin Folz <kfolz@evertz.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-09-26 17:35:56 -07:00
Guenter Roeck
2c50189d95 Improve IT8622 support
Configuration registers on ITE8622 are different to 8620 and 8628 and
require special handling. Also, the chip supports up to 5 pwm controls.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-09-22 13:51:20 -07:00
Guenter Roeck
b258624689 Add support for IT8622E
Originally-from: Kevin Folz <kfolz@evertz.com>.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-09-21 08:01:59 -07:00
Guenter Roeck
7e0c088547 Add feature flag indicating that VIN3 is connected to 5V
On IT8622E and IT8628E, VIN3 is expected to be connected to +5V.
Add feature flag and reflect in input label.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-09-21 06:37:36 -07:00
Guenter Roeck
2ff15f3ed8 Synchronize with upstream version
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-09-21 06:19:44 -07:00
Guenter Roeck
c8a5344f8d Add support for IT8628E and IT8732F
Also synchronize with upstream version

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-01-26 17:41:35 -08:00