diff options
author | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-07-03 16:08:03 -0400 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-07-10 11:54:29 -0400 |
commit | 22e6b2312d221376dcd98a8afb0f314b62d33a91 (patch) | |
tree | 73906c8f5f2a381fe085d3660ef333e99c871926 | |
parent | 0c2a40e2fe4f4af0410f57e84b95b817ec15aa70 (diff) |
hwmon: (pmbus) Improve auto-detection of temperature status register
It is possible that a PMBus device supports the READ_TEMPERATURE2 and/or
READ_TEMPERATURE3 registers but does not support READ_TEMPERATURE1.
Improve temperature status register detection to address this condition.
Reported-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 2.6.39+
-rw-r--r-- | drivers/hwmon/pmbus.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/hwmon/pmbus.c b/drivers/hwmon/pmbus.c index 931d940923ae..9b1f0c37ef77 100644 --- a/drivers/hwmon/pmbus.c +++ b/drivers/hwmon/pmbus.c | |||
@@ -59,16 +59,17 @@ static void pmbus_find_sensor_groups(struct i2c_client *client, | |||
59 | if (pmbus_check_byte_register(client, 0, PMBUS_STATUS_FAN_34)) | 59 | if (pmbus_check_byte_register(client, 0, PMBUS_STATUS_FAN_34)) |
60 | info->func[0] |= PMBUS_HAVE_STATUS_FAN34; | 60 | info->func[0] |= PMBUS_HAVE_STATUS_FAN34; |
61 | } | 61 | } |
62 | if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_1)) { | 62 | if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_1)) |
63 | info->func[0] |= PMBUS_HAVE_TEMP; | 63 | info->func[0] |= PMBUS_HAVE_TEMP; |
64 | if (pmbus_check_byte_register(client, 0, | ||
65 | PMBUS_STATUS_TEMPERATURE)) | ||
66 | info->func[0] |= PMBUS_HAVE_STATUS_TEMP; | ||
67 | } | ||
68 | if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_2)) | 64 | if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_2)) |
69 | info->func[0] |= PMBUS_HAVE_TEMP2; | 65 | info->func[0] |= PMBUS_HAVE_TEMP2; |
70 | if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_3)) | 66 | if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_3)) |
71 | info->func[0] |= PMBUS_HAVE_TEMP3; | 67 | info->func[0] |= PMBUS_HAVE_TEMP3; |
68 | if (info->func[0] & (PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP2 | ||
69 | | PMBUS_HAVE_TEMP3) | ||
70 | && pmbus_check_byte_register(client, 0, | ||
71 | PMBUS_STATUS_TEMPERATURE)) | ||
72 | info->func[0] |= PMBUS_HAVE_STATUS_TEMP; | ||
72 | 73 | ||
73 | /* Sensors detected on all pages */ | 74 | /* Sensors detected on all pages */ |
74 | for (page = 0; page < info->pages; page++) { | 75 | for (page = 0; page < info->pages; page++) { |