]> git.sur5r.net Git - groeck-it87/commitdiff
Drop FEAT_TEMP_OFFSET
authorGuenter Roeck <linux@roeck-us.net>
Thu, 8 Jun 2017 00:19:15 +0000 (17:19 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 8 Jun 2017 00:19:15 +0000 (17:19 -0700)
Since we now count the number of temperature offset registers directly,
there is no need for the temperature offset feature flag anymore.

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

diff --git a/it87.c b/it87.c
index deb416c8552db8a5e980f54191d5ad94d3b5027c..04514b24ea6be25132795533da0ac78e4601eb11 100644 (file)
--- a/it87.c
+++ b/it87.c
@@ -373,7 +373,6 @@ struct it87_devices {
 #define FEAT_NEWER_AUTOPWM     BIT(1)
 #define FEAT_OLD_AUTOPWM       BIT(2)
 #define FEAT_16BIT_FANS                BIT(3)
-#define FEAT_TEMP_OFFSET       BIT(4)
 #define FEAT_TEMP_PECI         BIT(5)
 #define FEAT_TEMP_OLD_PECI     BIT(6)
 #define FEAT_FAN16_CONFIG      BIT(7)  /* Need to enable 16-bit fans */
@@ -416,7 +415,7 @@ static const struct it87_devices it87_devices[] = {
        [it8716] = {
                .name = "it8716",
                .suffix = "F",
-               .features = FEAT_16BIT_FANS | FEAT_TEMP_OFFSET | FEAT_VID
+               .features = FEAT_16BIT_FANS | FEAT_VID
                  | FEAT_FAN16_CONFIG | FEAT_FIVE_FANS | FEAT_PWM_FREQ2
                  | FEAT_FANCTL_ONOFF,
                .num_temp_limit = 3,
@@ -425,7 +424,7 @@ static const struct it87_devices it87_devices[] = {
        [it8718] = {
                .name = "it8718",
                .suffix = "F",
-               .features = FEAT_16BIT_FANS | FEAT_TEMP_OFFSET | FEAT_VID
+               .features = FEAT_16BIT_FANS | FEAT_VID
                  | FEAT_TEMP_OLD_PECI | FEAT_FAN16_CONFIG | FEAT_FIVE_FANS
                  | FEAT_PWM_FREQ2 | FEAT_FANCTL_ONOFF,
                .num_temp_limit = 3,
@@ -435,7 +434,7 @@ static const struct it87_devices it87_devices[] = {
        [it8720] = {
                .name = "it8720",
                .suffix = "F",
-               .features = FEAT_16BIT_FANS | FEAT_TEMP_OFFSET | FEAT_VID
+               .features = FEAT_16BIT_FANS | FEAT_VID
                  | FEAT_TEMP_OLD_PECI | FEAT_FAN16_CONFIG | FEAT_FIVE_FANS
                  | FEAT_PWM_FREQ2 | FEAT_FANCTL_ONOFF,
                .num_temp_limit = 3,
@@ -446,7 +445,7 @@ static const struct it87_devices it87_devices[] = {
                .name = "it8721",
                .suffix = "F",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
-                 | FEAT_TEMP_OFFSET | FEAT_TEMP_OLD_PECI | FEAT_TEMP_PECI
+                 | FEAT_TEMP_OLD_PECI | FEAT_TEMP_PECI
                  | FEAT_FAN16_CONFIG | FEAT_FIVE_FANS | FEAT_IN7_INTERNAL
                  | FEAT_PWM_FREQ2 | FEAT_SCALING | FEAT_FANCTL_ONOFF,
                .num_temp_limit = 3,
@@ -458,7 +457,7 @@ static const struct it87_devices it87_devices[] = {
                .name = "it8728",
                .suffix = "F",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
-                 | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI | FEAT_FIVE_FANS
+                 | FEAT_TEMP_PECI | FEAT_FIVE_FANS
                  | FEAT_IN7_INTERNAL | FEAT_PWM_FREQ2 | FEAT_SCALING
                  | FEAT_FANCTL_ONOFF,
                .num_temp_limit = 6,
@@ -469,7 +468,7 @@ static const struct it87_devices it87_devices[] = {
                .name = "it8732",
                .suffix = "F",
                .features = FEAT_NEWER_AUTOPWM | FEAT_16BIT_FANS
-                 | FEAT_TEMP_OFFSET | FEAT_TEMP_OLD_PECI | FEAT_TEMP_PECI
+                 | FEAT_TEMP_OLD_PECI | FEAT_TEMP_PECI
                  | FEAT_10_9MV_ADC | FEAT_IN7_INTERNAL | FEAT_FOUR_FANS
                  | FEAT_FOUR_PWM | FEAT_FANCTL_ONOFF,
                .num_temp_limit = 3,
@@ -481,7 +480,7 @@ static const struct it87_devices it87_devices[] = {
                .name = "it8771",
                .suffix = "E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
-                 | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI | FEAT_IN7_INTERNAL
+                 | FEAT_TEMP_PECI | FEAT_IN7_INTERNAL
                  | FEAT_PWM_FREQ2 | FEAT_SCALING | FEAT_FANCTL_ONOFF,
                                /* PECI: guesswork */
                                /* 12mV ADC (OHM) */
@@ -495,7 +494,7 @@ static const struct it87_devices it87_devices[] = {
                .name = "it8772",
                .suffix = "E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
-                 | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI | FEAT_IN7_INTERNAL
+                 | FEAT_TEMP_PECI | FEAT_IN7_INTERNAL
                  | FEAT_PWM_FREQ2 | FEAT_SCALING | FEAT_FANCTL_ONOFF,
                                /* PECI (coreboot) */
                                /* 12mV ADC (HWSensors4, OHM) */
@@ -508,7 +507,7 @@ static const struct it87_devices it87_devices[] = {
        [it8781] = {
                .name = "it8781",
                .suffix = "F",
-               .features = FEAT_16BIT_FANS | FEAT_TEMP_OFFSET
+               .features = FEAT_16BIT_FANS
                  | FEAT_TEMP_OLD_PECI | FEAT_FAN16_CONFIG | FEAT_PWM_FREQ2
                  | FEAT_FANCTL_ONOFF,
                .num_temp_limit = 3,
@@ -518,7 +517,7 @@ static const struct it87_devices it87_devices[] = {
        [it8782] = {
                .name = "it8782",
                .suffix = "F",
-               .features = FEAT_16BIT_FANS | FEAT_TEMP_OFFSET
+               .features = FEAT_16BIT_FANS
                  | FEAT_TEMP_OLD_PECI | FEAT_FAN16_CONFIG | FEAT_PWM_FREQ2
                  | FEAT_FANCTL_ONOFF,
                .num_temp_limit = 3,
@@ -528,7 +527,7 @@ static const struct it87_devices it87_devices[] = {
        [it8783] = {
                .name = "it8783",
                .suffix = "E/F",
-               .features = FEAT_16BIT_FANS | FEAT_TEMP_OFFSET
+               .features = FEAT_16BIT_FANS
                  | FEAT_TEMP_OLD_PECI | FEAT_FAN16_CONFIG | FEAT_PWM_FREQ2
                  | FEAT_FANCTL_ONOFF,
                .num_temp_limit = 3,
@@ -539,7 +538,7 @@ static const struct it87_devices it87_devices[] = {
                .name = "it8786",
                .suffix = "E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
-                 | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI | FEAT_IN7_INTERNAL
+                 | FEAT_TEMP_PECI | FEAT_IN7_INTERNAL
                  | FEAT_PWM_FREQ2 | FEAT_FANCTL_ONOFF,
                .num_temp_limit = 3,
                .num_temp_offset = 3,
@@ -549,7 +548,7 @@ static const struct it87_devices it87_devices[] = {
                .name = "it8790",
                .suffix = "E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_10_9MV_ADC | FEAT_SCALING
-                 | FEAT_16BIT_FANS | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI
+                 | FEAT_16BIT_FANS | FEAT_TEMP_PECI
                  | FEAT_IN7_INTERNAL | FEAT_PWM_FREQ2 | FEAT_FANCTL_ONOFF,
                .num_temp_limit = 3,
                .num_temp_offset = 3,
@@ -559,7 +558,7 @@ static const struct it87_devices it87_devices[] = {
                .name = "it8792",
                .suffix = "E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_10_9MV_ADC | FEAT_SCALING
-                 | FEAT_16BIT_FANS | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI
+                 | FEAT_16BIT_FANS | FEAT_TEMP_PECI
                  | FEAT_IN7_INTERNAL | FEAT_PWM_FREQ2 | FEAT_FANCTL_ONOFF,
                .num_temp_limit = 3,
                .num_temp_offset = 3,
@@ -569,7 +568,7 @@ static const struct it87_devices it87_devices[] = {
                .name = "it8603",
                .suffix = "E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
-                 | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI | FEAT_IN7_INTERNAL
+                 | FEAT_TEMP_PECI | FEAT_IN7_INTERNAL
                  | FEAT_AVCC3 | FEAT_PWM_FREQ2 | FEAT_SCALING,
                .num_temp_limit = 3,
                .num_temp_offset = 3,
@@ -579,7 +578,7 @@ static const struct it87_devices it87_devices[] = {
                .name = "it8607",
                .suffix = "E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
-                 | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI | FEAT_IN7_INTERNAL
+                 | FEAT_TEMP_PECI | FEAT_IN7_INTERNAL
                  | FEAT_AVCC3 | FEAT_PWM_FREQ2 | FEAT_SCALING
                  | FEAT_FANCTL_ONOFF,
                .num_temp_limit = 3,
@@ -590,7 +589,7 @@ static const struct it87_devices it87_devices[] = {
                .name = "it8613",
                .suffix = "E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_11MV_ADC | FEAT_16BIT_FANS
-                 | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI | FEAT_FIVE_FANS
+                 | FEAT_TEMP_PECI | FEAT_FIVE_FANS
                  | FEAT_FIVE_PWM | FEAT_IN7_INTERNAL | FEAT_PWM_FREQ2
                  | FEAT_AVCC3 | FEAT_SCALING | FEAT_NEW_TEMPMAP,
                .num_temp_limit = 6,
@@ -601,7 +600,7 @@ static const struct it87_devices it87_devices[] = {
                .name = "it8620",
                .suffix = "E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
-                 | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI | FEAT_SIX_FANS
+                 | FEAT_TEMP_PECI | FEAT_SIX_FANS
                  | FEAT_IN7_INTERNAL | FEAT_SIX_PWM | FEAT_PWM_FREQ2
                  | FEAT_SIX_TEMP | FEAT_VIN3_5V | FEAT_SCALING
                  | FEAT_FANCTL_ONOFF,
@@ -613,7 +612,7 @@ static const struct it87_devices it87_devices[] = {
                .name = "it8622",
                .suffix = "E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
-                 | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI | FEAT_FIVE_FANS
+                 | FEAT_TEMP_PECI | FEAT_FIVE_FANS
                  | FEAT_FIVE_PWM | FEAT_IN7_INTERNAL | FEAT_PWM_FREQ2
                  | FEAT_AVCC3 | FEAT_VIN3_5V | FEAT_SCALING,
                .num_temp_limit = 3,
@@ -624,7 +623,7 @@ static const struct it87_devices it87_devices[] = {
                .name = "it8625",
                .suffix = "E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_16BIT_FANS
-                 | FEAT_TEMP_OFFSET | FEAT_AVCC3 | FEAT_NEW_TEMPMAP
+                 | FEAT_AVCC3 | FEAT_NEW_TEMPMAP
                  | FEAT_11MV_ADC | FEAT_IN7_INTERNAL | FEAT_SIX_FANS
                  | FEAT_SIX_PWM | FEAT_BANK_SEL | FEAT_SCALING,
                .num_temp_limit = 6,
@@ -634,7 +633,7 @@ static const struct it87_devices it87_devices[] = {
                .name = "it8628",
                .suffix = "E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
-                 | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI | FEAT_SIX_FANS
+                 | FEAT_TEMP_PECI | FEAT_SIX_FANS
                  | FEAT_IN7_INTERNAL | FEAT_SIX_PWM | FEAT_PWM_FREQ2
                  | FEAT_SIX_TEMP | FEAT_SCALING | FEAT_AVCC3
                  | FEAT_FANCTL_ONOFF,
@@ -646,7 +645,7 @@ static const struct it87_devices it87_devices[] = {
                .name = "it8655",
                .suffix = "E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_16BIT_FANS
-                 | FEAT_TEMP_OFFSET | FEAT_AVCC3 | FEAT_NEW_TEMPMAP
+                 | FEAT_AVCC3 | FEAT_NEW_TEMPMAP
                  | FEAT_10_9MV_ADC | FEAT_IN7_INTERNAL | FEAT_BANK_SEL,
                .num_temp_limit = 6,
                .num_temp_offset = 6,
@@ -655,7 +654,7 @@ static const struct it87_devices it87_devices[] = {
                .name = "it8665",
                .suffix = "E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_16BIT_FANS
-                 | FEAT_TEMP_OFFSET | FEAT_AVCC3 | FEAT_NEW_TEMPMAP
+                 | FEAT_AVCC3 | FEAT_NEW_TEMPMAP
                  | FEAT_10_9MV_ADC | FEAT_IN7_INTERNAL | FEAT_SIX_FANS
                  | FEAT_SIX_PWM | FEAT_BANK_SEL,
                .num_temp_limit = 6,
@@ -665,7 +664,7 @@ static const struct it87_devices it87_devices[] = {
                .name = "it8686",
                .suffix = "E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
-                 | FEAT_TEMP_OFFSET | FEAT_SIX_FANS | FEAT_NEW_TEMPMAP
+                 | FEAT_SIX_FANS | FEAT_NEW_TEMPMAP
                  | FEAT_IN7_INTERNAL | FEAT_SIX_PWM | FEAT_PWM_FREQ2
                  | FEAT_SIX_TEMP | FEAT_BANK_SEL | FEAT_SCALING | FEAT_AVCC3,
                .num_temp_limit = 6,
@@ -678,7 +677,6 @@ static const struct it87_devices it87_devices[] = {
 #define has_10_9mv_adc(data)   ((data)->features & FEAT_10_9MV_ADC)
 #define has_newer_autopwm(data)        ((data)->features & FEAT_NEWER_AUTOPWM)
 #define has_old_autopwm(data)  ((data)->features & FEAT_OLD_AUTOPWM)
-#define has_temp_offset(data)  ((data)->features & FEAT_TEMP_OFFSET)
 #define has_temp_peci(data, nr)        (((data)->features & FEAT_TEMP_PECI) && \
                                 ((data)->peci_mask & BIT(nr)))
 #define has_temp_old_peci(data, nr) \
@@ -1055,7 +1053,7 @@ static struct it87_data *it87_update_device(struct device *dev)
                        if (i >= data->num_temp_limit)
                                continue;
 
-                       if (has_temp_offset(data) && i < data->num_temp_offset)
+                       if (i < data->num_temp_offset)
                                data->temp[i][3] =
                                  it87_read_value(data,
                                                  data->REG_TEMP_OFFSET[i]);
@@ -2471,7 +2469,7 @@ static umode_t it87_temp_is_visible(struct kobject *kobj,
                return attr->mode;
        }
 
-       if (a == 5 && (!has_temp_offset(data) || i >= data->num_temp_offset))
+       if (a == 5 && i >= data->num_temp_offset)
                return 0;
 
        if (a == 6 && !data->has_beep)