diff options
author | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-06-30 06:54:05 -0700 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-07-01 15:56:06 -0700 |
commit | 81ae68142a0483b3791cba99eab268859858f508 (patch) | |
tree | fa52ff3ead009c455a0fb41ec4bd8567ecde714c /drivers/hwmon | |
parent | 3b33ca41227a54a78446fb0d7a6fdb9862f563db (diff) | |
download | kernel_samsung_crespo-81ae68142a0483b3791cba99eab268859858f508.zip kernel_samsung_crespo-81ae68142a0483b3791cba99eab268859858f508.tar.gz kernel_samsung_crespo-81ae68142a0483b3791cba99eab268859858f508.tar.bz2 |
hwmon: (pmbus) Improve fan detection
Some PMBus devices return no error when reading fan speed registers, but don't
really support fans. Strengthen fan detection by also checking if fan
configuration registers exist.
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
Cc: stable.kernel.org # 2.6.39
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/pmbus.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/hwmon/pmbus.c b/drivers/hwmon/pmbus.c index 98e2e28..b0ea00b 100644 --- a/drivers/hwmon/pmbus.c +++ b/drivers/hwmon/pmbus.c @@ -47,12 +47,14 @@ static void pmbus_find_sensor_groups(struct i2c_client *client, if (info->func[0] && pmbus_check_byte_register(client, 0, PMBUS_STATUS_INPUT)) info->func[0] |= PMBUS_HAVE_STATUS_INPUT; - if (pmbus_check_word_register(client, 0, PMBUS_READ_FAN_SPEED_1)) { + if (pmbus_check_byte_register(client, 0, PMBUS_FAN_CONFIG_12) && + pmbus_check_word_register(client, 0, PMBUS_READ_FAN_SPEED_1)) { info->func[0] |= PMBUS_HAVE_FAN12; if (pmbus_check_byte_register(client, 0, PMBUS_STATUS_FAN_12)) info->func[0] |= PMBUS_HAVE_STATUS_FAN12; } - if (pmbus_check_word_register(client, 0, PMBUS_READ_FAN_SPEED_3)) { + if (pmbus_check_byte_register(client, 0, PMBUS_FAN_CONFIG_34) && + pmbus_check_word_register(client, 0, PMBUS_READ_FAN_SPEED_3)) { info->func[0] |= PMBUS_HAVE_FAN34; if (pmbus_check_byte_register(client, 0, PMBUS_STATUS_FAN_34)) info->func[0] |= PMBUS_HAVE_STATUS_FAN34; |