]> git.sur5r.net Git - groeck-it87/commitdiff
Report actual chip name, not its ID
authorGuenter Roeck <linux@roeck-us.net>
Mon, 2 Oct 2017 21:08:29 +0000 (14:08 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 3 Oct 2017 00:24:29 +0000 (17:24 -0700)
For some recent chips (at least IT8792E/IT8795E), the value of the chip ID
register does not match the chip name. Display the textual, not the value
of the ID register, in the kernel log.

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

diff --git a/it87.c b/it87.c
index 9f1d38bdc07c09c6065e2c649a307ef56304c348..2acc57b73b2ed5adcfe3d7225dc6a21513a63978 100644 (file)
--- a/it87.c
+++ b/it87.c
@@ -341,7 +341,7 @@ static const u16 IT87_REG_TEMP_SRC1[] =     { 0x21d, 0x21e, 0x21f };
 
 struct it87_devices {
        const char *name;
-       const char * const suffix;
+       const char * const model;
        u32 features;
        u8 num_temp_limit;
        u8 num_temp_offset;
@@ -383,7 +383,7 @@ struct it87_devices {
 static const struct it87_devices it87_devices[] = {
        [it87] = {
                .name = "it87",
-               .suffix = "F",
+               .model = "IT87F",
                .features = FEAT_OLD_AUTOPWM | FEAT_FANCTL_ONOFF,
                                                /* may need to overwrite */
                .num_temp_limit = 3,
@@ -392,7 +392,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8712] = {
                .name = "it8712",
-               .suffix = "F",
+               .model = "IT8712F",
                .features = FEAT_OLD_AUTOPWM | FEAT_VID | FEAT_FANCTL_ONOFF,
                                                /* may need to overwrite */
                .num_temp_limit = 3,
@@ -401,7 +401,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8716] = {
                .name = "it8716",
-               .suffix = "F",
+               .model = "IT8716F",
                .features = FEAT_16BIT_FANS | FEAT_VID
                  | FEAT_FAN16_CONFIG | FEAT_FIVE_FANS | FEAT_PWM_FREQ2
                  | FEAT_FANCTL_ONOFF,
@@ -411,7 +411,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8718] = {
                .name = "it8718",
-               .suffix = "F",
+               .model = "IT8718F",
                .features = FEAT_16BIT_FANS | FEAT_VID
                  | FEAT_TEMP_OLD_PECI | FEAT_FAN16_CONFIG | FEAT_FIVE_FANS
                  | FEAT_PWM_FREQ2 | FEAT_FANCTL_ONOFF,
@@ -422,7 +422,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8720] = {
                .name = "it8720",
-               .suffix = "F",
+               .model = "IT8720F",
                .features = FEAT_16BIT_FANS | FEAT_VID
                  | FEAT_TEMP_OLD_PECI | FEAT_FAN16_CONFIG | FEAT_FIVE_FANS
                  | FEAT_PWM_FREQ2 | FEAT_FANCTL_ONOFF,
@@ -433,7 +433,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8721] = {
                .name = "it8721",
-               .suffix = "F",
+               .model = "IT8721F",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
                  | FEAT_TEMP_OLD_PECI | FEAT_TEMP_PECI
                  | FEAT_FAN16_CONFIG | FEAT_FIVE_FANS | FEAT_IN7_INTERNAL
@@ -446,7 +446,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8728] = {
                .name = "it8728",
-               .suffix = "F",
+               .model = "IT8728F",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
                  | FEAT_TEMP_PECI | FEAT_FIVE_FANS
                  | FEAT_IN7_INTERNAL | FEAT_PWM_FREQ2 | FEAT_SCALING
@@ -458,7 +458,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8732] = {
                .name = "it8732",
-               .suffix = "F",
+               .model = "IT8732F",
                .features = FEAT_NEWER_AUTOPWM | FEAT_16BIT_FANS
                  | FEAT_TEMP_OLD_PECI | FEAT_TEMP_PECI
                  | FEAT_10_9MV_ADC | FEAT_IN7_INTERNAL | FEAT_FOUR_FANS
@@ -471,7 +471,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8771] = {
                .name = "it8771",
-               .suffix = "E",
+               .model = "IT8771E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
                  | FEAT_TEMP_PECI | FEAT_IN7_INTERNAL
                  | FEAT_PWM_FREQ2 | FEAT_SCALING | FEAT_FANCTL_ONOFF,
@@ -486,7 +486,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8772] = {
                .name = "it8772",
-               .suffix = "E",
+               .model = "IT8772E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
                  | FEAT_TEMP_PECI | FEAT_IN7_INTERNAL
                  | FEAT_PWM_FREQ2 | FEAT_SCALING | FEAT_FANCTL_ONOFF,
@@ -501,7 +501,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8781] = {
                .name = "it8781",
-               .suffix = "F",
+               .model = "IT8781F",
                .features = FEAT_16BIT_FANS
                  | FEAT_TEMP_OLD_PECI | FEAT_FAN16_CONFIG | FEAT_PWM_FREQ2
                  | FEAT_FANCTL_ONOFF,
@@ -512,7 +512,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8782] = {
                .name = "it8782",
-               .suffix = "F",
+               .model = "IT8782F",
                .features = FEAT_16BIT_FANS
                  | FEAT_TEMP_OLD_PECI | FEAT_FAN16_CONFIG | FEAT_PWM_FREQ2
                  | FEAT_FANCTL_ONOFF,
@@ -523,7 +523,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8783] = {
                .name = "it8783",
-               .suffix = "E/F",
+               .model = "IT8783E/F",
                .features = FEAT_16BIT_FANS
                  | FEAT_TEMP_OLD_PECI | FEAT_FAN16_CONFIG | FEAT_PWM_FREQ2
                  | FEAT_FANCTL_ONOFF,
@@ -534,7 +534,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8786] = {
                .name = "it8786",
-               .suffix = "E",
+               .model = "IT8786E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
                  | FEAT_TEMP_PECI | FEAT_IN7_INTERNAL
                  | FEAT_PWM_FREQ2 | FEAT_FANCTL_ONOFF,
@@ -545,7 +545,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8790] = {
                .name = "it8790",
-               .suffix = "E",
+               .model = "IT8790E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_10_9MV_ADC | FEAT_SCALING
                  | FEAT_16BIT_FANS | FEAT_TEMP_PECI
                  | FEAT_IN7_INTERNAL | FEAT_PWM_FREQ2 | FEAT_FANCTL_ONOFF,
@@ -556,7 +556,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8792] = {
                .name = "it8792",
-               .suffix = "E",
+               .model = "IT8792E/IT8795E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_10_9MV_ADC | FEAT_SCALING
                  | FEAT_16BIT_FANS | FEAT_TEMP_PECI
                  | FEAT_IN7_INTERNAL | FEAT_PWM_FREQ2 | FEAT_FANCTL_ONOFF,
@@ -567,7 +567,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8603] = {
                .name = "it8603",
-               .suffix = "E",
+               .model = "IT8603E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
                  | FEAT_TEMP_PECI | FEAT_IN7_INTERNAL
                  | FEAT_AVCC3 | FEAT_PWM_FREQ2 | FEAT_SCALING,
@@ -578,7 +578,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8606] = {
                .name = "it8606",
-               .suffix = "E",
+               .model = "IT8606E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
                  | FEAT_TEMP_PECI | FEAT_IN7_INTERNAL
                  | FEAT_AVCC3 | FEAT_PWM_FREQ2 | FEAT_SCALING,
@@ -589,7 +589,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8607] = {
                .name = "it8607",
-               .suffix = "E",
+               .model = "IT8607E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
                  | FEAT_TEMP_PECI | FEAT_IN7_INTERNAL | FEAT_NEW_TEMPMAP
                  | FEAT_AVCC3 | FEAT_PWM_FREQ2 | FEAT_SCALING
@@ -601,7 +601,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8613] = {
                .name = "it8613",
-               .suffix = "E",
+               .model = "IT8613E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_11MV_ADC | FEAT_16BIT_FANS
                  | FEAT_TEMP_PECI | FEAT_FIVE_FANS
                  | FEAT_FIVE_PWM | FEAT_IN7_INTERNAL | FEAT_PWM_FREQ2
@@ -613,7 +613,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8620] = {
                .name = "it8620",
-               .suffix = "E",
+               .model = "IT8620E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
                  | FEAT_TEMP_PECI | FEAT_SIX_FANS
                  | FEAT_IN7_INTERNAL | FEAT_SIX_PWM | FEAT_PWM_FREQ2
@@ -626,7 +626,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8622] = {
                .name = "it8622",
-               .suffix = "E",
+               .model = "IT8622E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
                  | FEAT_TEMP_PECI | FEAT_FIVE_FANS | FEAT_FOUR_TEMP
                  | FEAT_FIVE_PWM | FEAT_IN7_INTERNAL | FEAT_PWM_FREQ2
@@ -639,7 +639,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8625] = {
                .name = "it8625",
-               .suffix = "E",
+               .model = "IT8625E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_16BIT_FANS
                  | FEAT_AVCC3 | FEAT_NEW_TEMPMAP
                  | FEAT_11MV_ADC | FEAT_IN7_INTERNAL | FEAT_SIX_FANS
@@ -651,7 +651,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8628] = {
                .name = "it8628",
-               .suffix = "E",
+               .model = "IT8628E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
                  | FEAT_TEMP_PECI | FEAT_SIX_FANS
                  | FEAT_IN7_INTERNAL | FEAT_SIX_PWM | FEAT_PWM_FREQ2
@@ -664,7 +664,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8655] = {
                .name = "it8655",
-               .suffix = "E",
+               .model = "IT8655E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_16BIT_FANS
                  | FEAT_AVCC3 | FEAT_NEW_TEMPMAP | FEAT_SCALING
                  | FEAT_10_9MV_ADC | FEAT_IN7_INTERNAL | FEAT_BANK_SEL
@@ -676,7 +676,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8665] = {
                .name = "it8665",
-               .suffix = "E",
+               .model = "IT8665E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_16BIT_FANS
                  | FEAT_AVCC3 | FEAT_NEW_TEMPMAP | FEAT_SCALING
                  | FEAT_10_9MV_ADC | FEAT_IN7_INTERNAL | FEAT_SIX_FANS
@@ -688,7 +688,7 @@ static const struct it87_devices it87_devices[] = {
        },
        [it8686] = {
                .name = "it8686",
-               .suffix = "E",
+               .model = "IT8686E",
                .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
                  | FEAT_SIX_FANS | FEAT_NEW_TEMPMAP
                  | FEAT_IN7_INTERNAL | FEAT_SIX_PWM | FEAT_PWM_FREQ2
@@ -3104,8 +3104,8 @@ static int __init it87_find(int sioaddr, unsigned short *address,
        if (base)
                snprintf(mmio_str, sizeof(mmio_str), " [MMIO at %pa]", &base);
 
-       pr_info("Found IT%04x%s chip at 0x%x%s, revision %d\n", chip_type,
-               it87_devices[sio_data->type].suffix,
+       pr_info("Found %s chip at 0x%x%s, revision %d\n",
+               it87_devices[sio_data->type].model,
                *address, mmio_str, sio_data->revision);
 
        /* in7 (VSB or VCCH5V) is always internal on some chips */