diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-14 16:29:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-14 16:29:09 -0400 |
commit | 4c41042d1d4c29e596b31e2d14b26d2940fb24b4 (patch) | |
tree | 239bc039efb9bde5f880cd0cde8ab86d044d86ae /drivers | |
parent | e9308cfd5ab4ade3d81cf591c7599c3a05a21b04 (diff) | |
parent | bf164c58e58328c40ebc597a8ac00cc6840f9703 (diff) |
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
hwmon: (w83627ehf) Properly report thermal diode sensors
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hwmon/w83627ehf.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c index f2b377c56a3a..7b0260dc76fb 100644 --- a/drivers/hwmon/w83627ehf.c +++ b/drivers/hwmon/w83627ehf.c | |||
@@ -1715,7 +1715,8 @@ static void w83627ehf_device_remove_files(struct device *dev) | |||
1715 | } | 1715 | } |
1716 | 1716 | ||
1717 | /* Get the monitoring functions started */ | 1717 | /* Get the monitoring functions started */ |
1718 | static inline void __devinit w83627ehf_init_device(struct w83627ehf_data *data) | 1718 | static inline void __devinit w83627ehf_init_device(struct w83627ehf_data *data, |
1719 | enum kinds kind) | ||
1719 | { | 1720 | { |
1720 | int i; | 1721 | int i; |
1721 | u8 tmp, diode; | 1722 | u8 tmp, diode; |
@@ -1746,10 +1747,16 @@ static inline void __devinit w83627ehf_init_device(struct w83627ehf_data *data) | |||
1746 | w83627ehf_write_value(data, W83627EHF_REG_VBAT, tmp | 0x01); | 1747 | w83627ehf_write_value(data, W83627EHF_REG_VBAT, tmp | 0x01); |
1747 | 1748 | ||
1748 | /* Get thermal sensor types */ | 1749 | /* Get thermal sensor types */ |
1749 | diode = w83627ehf_read_value(data, W83627EHF_REG_DIODE); | 1750 | switch (kind) { |
1751 | case w83627ehf: | ||
1752 | diode = w83627ehf_read_value(data, W83627EHF_REG_DIODE); | ||
1753 | break; | ||
1754 | default: | ||
1755 | diode = 0x70; | ||
1756 | } | ||
1750 | for (i = 0; i < 3; i++) { | 1757 | for (i = 0; i < 3; i++) { |
1751 | if ((tmp & (0x02 << i))) | 1758 | if ((tmp & (0x02 << i))) |
1752 | data->temp_type[i] = (diode & (0x10 << i)) ? 1 : 2; | 1759 | data->temp_type[i] = (diode & (0x10 << i)) ? 1 : 3; |
1753 | else | 1760 | else |
1754 | data->temp_type[i] = 4; /* thermistor */ | 1761 | data->temp_type[i] = 4; /* thermistor */ |
1755 | } | 1762 | } |
@@ -2016,7 +2023,7 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev) | |||
2016 | } | 2023 | } |
2017 | 2024 | ||
2018 | /* Initialize the chip */ | 2025 | /* Initialize the chip */ |
2019 | w83627ehf_init_device(data); | 2026 | w83627ehf_init_device(data, sio_data->kind); |
2020 | 2027 | ||
2021 | data->vrm = vid_which_vrm(); | 2028 | data->vrm = vid_which_vrm(); |
2022 | superio_enter(sio_data->sioreg); | 2029 | superio_enter(sio_data->sioreg); |