]> git.sur5r.net Git - groeck-it87/commitdiff
Add feature flag indicating that VIN3 is connected to 5V
authorGuenter Roeck <linux@roeck-us.net>
Wed, 21 Sep 2016 13:35:37 +0000 (06:35 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 21 Sep 2016 13:37:36 +0000 (06:37 -0700)
On IT8622E and IT8628E, VIN3 is expected to be connected to +5V.
Add feature flag and reflect in input label.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
it87.c

diff --git a/it87.c b/it87.c
index 129aed01d3eb54136ae8620589d54be890d100bb..b4a1a3b0480ba01663809227f2a0f35d9c7f885a 100644 (file)
--- a/it87.c
+++ b/it87.c
@@ -297,6 +297,7 @@ struct it87_devices {
 #define FEAT_SIX_PWM           BIT(14) /* Chip supports 6 pwm chn */
 #define FEAT_PWM_FREQ2         BIT(15) /* Separate pwm freq 2 */
 #define FEAT_SIX_TEMP          BIT(16) /* Up to 6 temp sensors */
+#define FEAT_VIN3_5V           BIT(17) /* VIN3 connected to +5V */
 
 static const struct it87_devices it87_devices[] = {
        [it87] = {
@@ -434,7 +435,7 @@ static const struct it87_devices it87_devices[] = {
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
                  | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI | FEAT_SIX_FANS
                  | FEAT_IN7_INTERNAL | FEAT_SIX_PWM | FEAT_PWM_FREQ2
-                 | FEAT_SIX_TEMP,
+                 | FEAT_SIX_TEMP | FEAT_VIN3_5V,
                .peci_mask = 0x07,
        },
        [it8628] = {
@@ -443,7 +444,7 @@ static const struct it87_devices it87_devices[] = {
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
                  | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI | FEAT_SIX_FANS
                  | FEAT_IN7_INTERNAL | FEAT_SIX_PWM | FEAT_PWM_FREQ2
-                 | FEAT_SIX_TEMP,
+                 | FEAT_SIX_TEMP | FEAT_VIN3_5V,
                .peci_mask = 0x07,
        },
 };
@@ -469,6 +470,7 @@ static const struct it87_devices it87_devices[] = {
 #define has_six_pwm(data)      ((data)->features & FEAT_SIX_PWM)
 #define has_pwm_freq2(data)    ((data)->features & FEAT_PWM_FREQ2)
 #define has_six_temp(data)     ((data)->features & FEAT_SIX_TEMP)
+#define has_vin3_5v(data)      ((data)->features & FEAT_VIN3_5V)
 
 struct it87_sio_data {
        enum chips type;
@@ -1927,7 +1929,9 @@ static ssize_t show_label(struct device *dev, struct device_attribute *attr,
        int nr = to_sensor_dev_attr(attr)->index;
        const char *label;
 
-       if (has_12mv_adc(data) || has_10_9mv_adc(data))
+       if (has_vin3_5v(data) && nr == 0)
+               label = labels[0];
+       else if (has_12mv_adc(data) || has_10_9mv_adc(data))
                label = labels_it8721[nr];
        else
                label = labels[nr];