summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/nct6775.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2015-08-29 18:29:25 -0400
committerGuenter Roeck <linux@roeck-us.net>2015-10-30 10:35:14 -0400
commit9a38371a8cda366400e592d10bc062deea09b695 (patch)
treeaa137f71bf4f35301ccd551e2b5a0d0b77c2bd99 /drivers/hwmon/nct6775.c
parent001e2e730ce4e6dc2cd97fcb169097febfc7b200 (diff)
hwmon: (nct6775) NCT6791D and NCT6792D have an additional temperature source
Both NCT6791D and NCT6792D permit selection of a 'virtual' temperature register as temperature source. The virtual temperature registers are registers 0xea to 0xef in bank 0 and can be written by software. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/nct6775.c')
-rw-r--r--drivers/hwmon/nct6775.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c
index 8b4fa55e46c6..724401a368f7 100644
--- a/drivers/hwmon/nct6775.c
+++ b/drivers/hwmon/nct6775.c
@@ -515,16 +515,24 @@ static const char *const nct6779_temp_label[] = {
515 "PCH_DIM1_TEMP", 515 "PCH_DIM1_TEMP",
516 "PCH_DIM2_TEMP", 516 "PCH_DIM2_TEMP",
517 "PCH_DIM3_TEMP", 517 "PCH_DIM3_TEMP",
518 "BYTE_TEMP" 518 "BYTE_TEMP",
519 "",
520 "",
521 "",
522 "",
523 "Virtual_TEMP"
519}; 524};
520 525
521static const u16 NCT6779_REG_TEMP_ALTERNATE[ARRAY_SIZE(nct6779_temp_label) - 1] 526#define NCT6779_NUM_LABELS (ARRAY_SIZE(nct6779_temp_label) - 5)
527#define NCT6791_NUM_LABELS ARRAY_SIZE(nct6779_temp_label)
528
529static const u16 NCT6779_REG_TEMP_ALTERNATE[NCT6791_NUM_LABELS - 1]
522 = { 0x490, 0x491, 0x492, 0x493, 0x494, 0x495, 0, 0, 530 = { 0x490, 0x491, 0x492, 0x493, 0x494, 0x495, 0, 0,
523 0, 0, 0, 0, 0, 0, 0, 0, 531 0, 0, 0, 0, 0, 0, 0, 0,
524 0, 0x400, 0x401, 0x402, 0x404, 0x405, 0x406, 0x407, 532 0, 0x400, 0x401, 0x402, 0x404, 0x405, 0x406, 0x407,
525 0x408, 0 }; 533 0x408, 0 };
526 534
527static const u16 NCT6779_REG_TEMP_CRIT[ARRAY_SIZE(nct6779_temp_label) - 1] 535static const u16 NCT6779_REG_TEMP_CRIT[NCT6791_NUM_LABELS - 1]
528 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x709, 0x70a }; 536 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x709, 0x70a };
529 537
530/* NCT6791 specific data */ 538/* NCT6791 specific data */
@@ -3605,7 +3613,7 @@ static int nct6775_probe(struct platform_device *pdev)
3605 data->speed_tolerance_limit = 63; 3613 data->speed_tolerance_limit = 63;
3606 3614
3607 data->temp_label = nct6779_temp_label; 3615 data->temp_label = nct6779_temp_label;
3608 data->temp_label_num = ARRAY_SIZE(nct6779_temp_label); 3616 data->temp_label_num = NCT6779_NUM_LABELS;
3609 3617
3610 data->REG_CONFIG = NCT6775_REG_CONFIG; 3618 data->REG_CONFIG = NCT6775_REG_CONFIG;
3611 data->REG_VBAT = NCT6775_REG_VBAT; 3619 data->REG_VBAT = NCT6775_REG_VBAT;
@@ -3683,7 +3691,7 @@ static int nct6775_probe(struct platform_device *pdev)
3683 data->speed_tolerance_limit = 63; 3691 data->speed_tolerance_limit = 63;
3684 3692
3685 data->temp_label = nct6779_temp_label; 3693 data->temp_label = nct6779_temp_label;
3686 data->temp_label_num = ARRAY_SIZE(nct6779_temp_label); 3694 data->temp_label_num = NCT6791_NUM_LABELS;
3687 3695
3688 data->REG_CONFIG = NCT6775_REG_CONFIG; 3696 data->REG_CONFIG = NCT6775_REG_CONFIG;
3689 data->REG_VBAT = NCT6775_REG_VBAT; 3697 data->REG_VBAT = NCT6775_REG_VBAT;