aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2016-09-11 15:42:52 -0400
committerGuenter Roeck <linux@roeck-us.net>2016-09-18 18:32:35 -0400
commit7ce4190c4ca466ccd609845b97dce665317aee2a (patch)
tree705b6081ec05400902c6ab4528da1408fac0c895
parentdc8b73ebe543f53ec78507a9d0d37073773f6157 (diff)
hwmon: (nct6775) Add support for multiple virtual temperature sources
For virtual temperatures, the actual temperature values are written by software, presumably by the BIOS. This functionality is (as of right now) supported on NCT6791D, NCT6792D, and NCT6793D. On those chips, the temperatures are written into registers 0xea..0xef on page 0. This is known to be used on some Asus motherboards, where the actual temperature source can be configured in the BIOS. Report the 'virtual' temperatures for all monotoring sources to address this situation. Example for the resulting output (as seen with the 'sensors' command): nct6791-isa-0290 Adapter: ISA adapter ... Virtual_TEMP: +31.0°C PECI Agent 0: +38.5°C Virtual_TEMP: +32.0°C ... Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--drivers/hwmon/nct6775.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c
index 7859a30ce31e..ce75dd4db7eb 100644
--- a/drivers/hwmon/nct6775.c
+++ b/drivers/hwmon/nct6775.c
@@ -195,6 +195,8 @@ superio_exit(int ioreg)
195 195
196#define NUM_FAN 6 196#define NUM_FAN 6
197 197
198#define TEMP_SOURCE_VIRTUAL 0x1f
199
198/* Common and NCT6775 specific data */ 200/* Common and NCT6775 specific data */
199 201
200/* Voltage min/max registers for nr=7..14 are in bank 5 */ 202/* Voltage min/max registers for nr=7..14 are in bank 5 */
@@ -3940,7 +3942,7 @@ static int nct6775_probe(struct platform_device *pdev)
3940 continue; 3942 continue;
3941 3943
3942 src = nct6775_read_value(data, data->REG_TEMP_SEL[i]) & 0x1f; 3944 src = nct6775_read_value(data, data->REG_TEMP_SEL[i]) & 0x1f;
3943 if (!src || (mask & (1 << src))) 3945 if (!src)
3944 continue; 3946 continue;
3945 3947
3946 if (src >= data->temp_label_num || 3948 if (src >= data->temp_label_num ||
@@ -3952,7 +3954,16 @@ static int nct6775_probe(struct platform_device *pdev)
3952 continue; 3954 continue;
3953 } 3955 }
3954 3956
3955 mask |= 1 << src; 3957 /*
3958 * For virtual temperature sources, the 'virtual' temperature
3959 * for each fan reflects a different temperature, and there
3960 * are no duplicates.
3961 */
3962 if (src != TEMP_SOURCE_VIRTUAL) {
3963 if (mask & (1 << src))
3964 continue;
3965 mask |= 1 << src;
3966 }
3956 3967
3957 /* Use fixed index for SYSTIN(1), CPUTIN(2), AUXTIN(3) */ 3968 /* Use fixed index for SYSTIN(1), CPUTIN(2), AUXTIN(3) */
3958 if (src <= data->temp_fixed_num) { 3969 if (src <= data->temp_fixed_num) {