hwmon: (pmbus) Auto-detect temp2 and temp3 registers/attributes
authorGuenter Roeck <guenter.roeck@ericsson.com>
Thu, 30 Jun 2011 13:57:41 +0000 (06:57 -0700)
committerGuenter Roeck <guenter.roeck@ericsson.com>
Fri, 1 Jul 2011 22:56:07 +0000 (15:56 -0700)
Additional temperature attribute support is easy to detect, so do it.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
Cc: stable.kernel.org # 2.6.39
drivers/hwmon/pmbus.c

index b0ea00b75f173556be047b9cba69359e1b512e00..931d940923aebb77c5b7d1d9bc029977c029dd14 100644 (file)
@@ -65,6 +65,10 @@ static void pmbus_find_sensor_groups(struct i2c_client *client,
                                              PMBUS_STATUS_TEMPERATURE))
                        info->func[0] |= PMBUS_HAVE_STATUS_TEMP;
        }
+       if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_2))
+               info->func[0] |= PMBUS_HAVE_TEMP2;
+       if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_3))
+               info->func[0] |= PMBUS_HAVE_TEMP3;
 
        /* Sensors detected on all pages */
        for (page = 0; page < info->pages; page++) {