Changeset 2017

Show
Ignore:
Timestamp:
10/13/03 05:01:45 (10 years ago)
Author:
mds
Message:

several bmcsensors fixes:

  • fix voltage scaling
  • swap voltage limits
  • use lower critical rather than upper hysteresis for non-temperature sensors
  • increase libsensors support to 20 voltage, 10 fan, 10 temperature sensors Tickets 1406 and 1407.
Location:
lm-sensors/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/CHANGES

    r2014 r2017  
    1818----------------------------------------------------------------------------- 
    19192.8.2 (???) 
     20  Library: Fix bmcsensors scaling, increase number of sensors 
    2021  Module i2c-sis630: sync with 2.6.0-X driver version.  
     22  Module bmcsensors: Fix voltage scaling, voltage and fan limits 
    2123 
    2224 
  • lm-sensors/trunk/kernel/chips/bmcsensors.c

    r1779 r2017  
    6464 
    6565static void bmcsensors_update_client(struct i2c_client *client); 
    66 static int bmcsensors_find(int *address); 
    6766static void bmcsensors_reserve_sdr(void); 
    6867 
     
    7069static void bmcsensors_all(struct i2c_client *client, int operation, 
    7170                        int ctl_name, int *nrels_mag, long *results); 
     71#if 0 
    7272static void bmcsensors_alarms(struct i2c_client *client, int operation, 
    7373                           int ctl_name, int *nrels_mag, long *results); 
     
    7676static void bmcsensors_pwm(struct i2c_client *client, int operation, 
    7777                        int ctl_name, int *nrels_mag, long *results); 
     78#endif 
    7879static void bmcsensors_get_sdr(u16 resid, u16 record, u8 offset); 
    7980static void bmcsensors_get_reading(struct i2c_client *client, int i); 
    80  
    81 static int bmcsensors_id = 0; 
    8281 
    8382static struct i2c_driver bmcsensors_driver = { 
     
    103102}; 
    104103 
    105 static bmcsensors_initialized; 
     104static int bmcsensors_initialized; 
    106105 
    107106#define MAX_SDR_ENTRIES 50 
     
    124123        u8 nominal; 
    125124        u8 limits[SDR_LIMITS]; 
    126         int lim1, lim2; 
     125        int lim1, lim2;         /* index into limits for reported upper and lower limit */ 
    127126        u8 lim1_write, lim2_write; 
    128127        u8 string_type; 
     
    239238/* select two out of the 8 possible readable thresholds, and place indexes into the limits 
    240239   array into lim1 and lim2. Set writable flags */ 
    241 static void bmcsensors_select_thresholds(int i) 
    242 { 
    243         u8 capab = sdrd[i].capab; 
    244         u16 mask = sdrd[i].thresh_mask; 
    245  
    246         sdrd[i].lim1 = -1; 
    247         sdrd[i].lim2 = -1; 
    248         sdrd[i].lim1_write = 0; 
    249         sdrd[i].lim2_write = 0; 
     240static void bmcsensors_select_thresholds(struct sdrdata * sd) 
     241{ 
     242        u8 capab = sd->capab; 
     243        u16 mask = sd->thresh_mask; 
     244 
     245        sd->lim1 = -1; 
     246        sd->lim2 = -1; 
     247        sd->lim1_write = 0; 
     248        sd->lim2_write = 0; 
    250249 
    251250        if(((capab & 0x0c) == 0x04) ||  /* readable thresholds ? */ 
     
    253252                /* select upper threshold */ 
    254253                if(mask & 0x10) {                       /* upper crit */ 
    255                         sdrd[i].lim1 = 1; 
     254                        sd->lim1 = 1; 
    256255                        if((capab & 0x0c) == 0x08 && (mask & 0x1000)) 
    257                                 sdrd[i].lim1_write = 1; 
     256                                sd->lim1_write = 1; 
    258257                } 
    259258                else if(mask & 0x20) {          /* upper non-recov */ 
    260                         sdrd[i].lim1 = 0; 
     259                        sd->lim1 = 0; 
    261260                        if((capab & 0x0c) == 0x08 && (mask & 0x2000)) 
    262                                 sdrd[i].lim1_write = 1; 
     261                                sd->lim1_write = 1; 
    263262                } 
    264263                else if(mask & 0x08) {          /* upper non-crit */ 
    265                         sdrd[i].lim1 = 2; 
     264                        sd->lim1 = 2; 
    266265                        if((capab & 0x0c) == 0x08 && (mask & 0x0800)) 
    267                                 sdrd[i].lim1_write = 1; 
     266                                sd->lim1_write = 1; 
    268267                } 
    269268 
    270269                /* select lower threshold */ 
    271                 if(((capab & 0x30) == 0x10) ||  /* readable hysteresis ? */ 
    272                    ((capab & 0x30) == 0x20))    /* pos hyst */ 
    273                         sdrd[i].lim2 = 6; 
     270                if((((capab & 0x30) == 0x10) ||         /* readable ? */ 
     271                    ((capab & 0x30) == 0x20)) &&        /* pos hyst */ 
     272                   sd->stype == STYPE_TEMP) 
     273                        sd->lim2 = 6; 
    274274                else if(mask & 0x02) {          /* lower crit */ 
    275                         sdrd[i].lim2 = 4; 
     275                        sd->lim2 = 4; 
    276276                        if((capab & 0x0c) == 0x08 && (mask & 0x0200)) 
    277                                 sdrd[i].lim2_write = 1; 
     277                                sd->lim2_write = 1; 
    278278                } 
    279279                else if(mask & 0x04) {          /* lower non-recov */ 
    280                         sdrd[i].lim2 = 3; 
     280                        sd->lim2 = 3; 
    281281                        if((capab & 0x0c) == 0x08 && (mask & 0x0400)) 
    282                                 sdrd[i].lim2_write = 1; 
     282                                sd->lim2_write = 1; 
    283283                } 
    284284                else if(mask & 0x01) {          /* lower non-crit */ 
    285                         sdrd[i].lim2 = 5; 
     285                        sd->lim2 = 5; 
    286286                        if((capab & 0x0c) == 0x08 && (mask & 0x0100)) 
    287                                 sdrd[i].lim2_write = 1; 
    288                 } 
    289         } 
    290  
    291         if(sdrd[i].lim1 >= 0) 
    292                 printk(KERN_INFO "bmcsensors.o: sensor %d: using %s for upper limit\n", 
    293                         i, threshold_text[sdrd[i].lim1]); 
     287                                sd->lim2_write = 1; 
     288                } 
     289        } 
     290 
     291        /* fixme swap lim1/lim2 if m < 0 */ 
     292        if(sd->lim1 >= 0) 
     293                printk(KERN_INFO "bmcsensors.o: using %s for upper limit\n", 
     294                        threshold_text[sd->lim1]); 
    294295#ifdef DEBUG 
    295296        else 
    296                 printk(KERN_INFO "bmcsensors.o: sensor %d: no readable upper limit\n", i); 
    297 #endif 
    298         if(sdrd[i].lim2 >= 0) 
    299                 printk(KERN_INFO "bmcsensors.o: sensor %d: using %s for lower limit\n", 
    300                         i, threshold_text[sdrd[i].lim2]); 
     297                printk(KERN_INFO "bmcsensors.o: no readable upper limit\n"); 
     298#endif 
     299        if(sd->lim2 >= 0) 
     300                printk(KERN_INFO "bmcsensors.o: using %s for lower limit\n", 
     301                        threshold_text[sd->lim2]); 
    301302#ifdef DEBUG 
    302303        else 
    303                 printk(KERN_INFO "bmcsensors.o: sensor %d: no readable lower limit\n", i); 
     304                printk(KERN_INFO "bmcsensors.o: no readable lower limit\n"); 
    304305#endif 
    305306} 
     
    369370                                bmcsensors_dir_table[i].procname, id); 
    370371                } 
    371                 bmcsensors_select_thresholds(i); 
     372                bmcsensors_select_thresholds(sdrd + i); 
    372373                if(sdrd[i].linear != 0) { 
    373374                        printk(KERN_INFO 
     
    441442{ 
    442443        u16 record; 
    443         int type, length, owner, lun, number, entity, instance, init; 
    444         int stype, code; 
     444        int type; 
     445        int stype; 
    445446        int id_length; 
    446447        int i; 
    447448        int rstate = STATE_SDR; 
    448         struct ipmi_msg txmsg; 
    449449        unsigned char * data; 
    450450        u8 id[SDR_MAX_UNPACKED_ID_LENGTH]; 
     
    849849 
    850850/* need better way to map from sysctl to sdrd record number */ 
    851 static int find_sdrd(int sysctl) 
     851static struct sdrdata * find_sdrd(int sysctl) 
    852852{ 
    853853        int i; 
     
    855855        for(i = 0; i < sdrd_count; i++) 
    856856                if(sdrd[i].sysctl == sysctl) 
    857                         return i; 
    858         return -1; 
     857                        return sdrd + i; 
     858        return NULL; 
    859859} 
    860860 
     
    862862static const int exps[] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000}; 
    863863 
    864 static int decplaces(int i) 
    865 { 
    866         u8 k2; 
    867  
    868         k2 = sdrd[i].k >> 4; 
    869         if(k2 < 8) 
     864/* Return 0 for fan, 2 for temp, 3 for voltage 
     865   We could make it variable based on the accuracy (= log10(m * 10**k2)); 
     866   this would work for /proc output, however libsensors resolution 
     867   is statically set in lib/chips.c */ 
     868static int decplaces(struct sdrdata *sd) 
     869{ 
     870        switch(sd->stype) { 
     871        case STYPE_TEMP: 
     872                return 2; 
     873        case STYPE_CURR: 
     874        case STYPE_VOLT: 
     875                return 3; 
     876        case STYPE_FAN: 
     877        default: 
    870878                return 0; 
    871         else 
    872                 return 16 - k2; 
    873 } 
    874  
    875 static long convert_value(u8 value, int i) 
     879        } 
     880} 
     881 
     882/* convert a raw value to a reading. IMPI V1.5 Section 30 */ 
     883static long conv_val(int value, struct sdrdata *sd) 
    876884{ 
    877885        u8 k1, k2; 
    878886        long r; 
    879887 
    880 /* fixme signed/unsigned */ 
    881         r = value * sdrd[i].m; 
    882  
    883         k1 = sdrd[i].k & 0x0f; 
    884         k2 = sdrd[i].k >> 4; 
     888        r = value * sd->m; 
     889        k1 = sd->k & 0x0f; 
     890        k2 = sd->k >> 4; 
    885891        if(k1 < 8) 
    886                 r += sdrd[i].b * exps[k1]; 
     892                r += sd->b * exps[k1]; 
    887893        else 
    888                 r += sdrd[i].b / exps[16 - k1]; 
     894                r += sd->b / exps[16 - k1]; 
     895        r *= exps[decplaces(sd)]; 
    889896        if(k2 < 8) 
    890897                r *= exps[k2]; 
    891 /* 
    892         taken care of by nrels_mag 
    893898        else 
    894899                r /= exps[16 - k2]; 
    895 */ 
    896900        return r; 
    897901} 
     
    903907                 int *nrels_mag, long *results) 
    904908{ 
    905         int i; 
     909        struct sdrdata *sd; 
     910/* 
    906911        struct bmcsensors_data *data = client->data; 
    907  
    908         if((i = find_sdrd(ctl_name)) < 0) { 
     912*/ 
     913 
     914        if((sd = find_sdrd(ctl_name)) == NULL) { 
    909915                *nrels_mag = 0; 
    910916                return;          
    911917        } 
    912918        if (operation == SENSORS_PROC_REAL_INFO) 
    913                 *nrels_mag = decplaces(i); 
     919                *nrels_mag = decplaces(sd); 
    914920        else if (operation == SENSORS_PROC_REAL_READ) { 
    915921                bmcsensors_update_client(client); 
    916                 if(sdrd[i].stype == STYPE_FAN) { /* lower limit only */ 
    917                         if(sdrd[i].lim2 >= 0) 
    918                                 results[0] = convert_value(sdrd[i].limits[sdrd[i].lim2], i); 
    919                         else 
    920                                 results[0] = 0; 
    921                         results[1] = convert_value(sdrd[i].reading, i); 
     922                if(sd->lim2 >= 0) { 
     923                        if(sd->stype == STYPE_TEMP)   /* upper limit first */ 
     924                                results[0] = 
     925                                    conv_val(sd->limits[sd->lim1], sd); 
     926                        else                          /* lower limit first */ 
     927                                results[0] = 
     928                                    conv_val(sd->limits[sd->lim2], sd); 
     929                } else 
     930                        results[0] = 0; 
     931                if(sd->stype == STYPE_FAN) { /* lower limit only */ 
     932                        results[1] = conv_val(sd->reading, sd); 
    922933                        *nrels_mag = 2; 
    923934                } else { 
    924                         if(sdrd[i].lim1 >= 0) 
    925                                 results[0] = convert_value(sdrd[i].limits[sdrd[i].lim1], i); 
    926                         else 
    927                                 results[0] = 0; 
    928                         results[2] = convert_value(sdrd[i].reading, i); 
    929                         if(sdrd[i].lim2 >= 0) { 
    930                                 results[1] = convert_value(sdrd[i].limits[sdrd[i].lim2], i); 
    931                                 if(sdrd[i].lim2 == 6) /* pos. threshold */ 
    932                                         results[1] = results[0] - results[1]; 
     935                        if(sd->lim1 >= 0) { 
     936                                if(sd->stype == STYPE_TEMP) {   /* lower 2nd */ 
     937                                        results[1] = 
     938                                           conv_val(sd->limits[sd->lim2], sd); 
     939                                        if(sd->lim2 == 6)    /* pos. thresh. */ 
     940                                                results[1] = results[0] - 
     941                                                             results[1]; 
     942                                } else                          /* upper 2nd */ 
     943                                        results[1] = 
     944                                           conv_val(sd->limits[sd->lim1], sd); 
    933945                        } else 
    934946                                results[1] = 0; 
     947                        results[2] = conv_val(sd->reading, sd); 
    935948                        *nrels_mag = 3; 
    936949                } 
    937950        } else if (operation == SENSORS_PROC_REAL_WRITE) { 
    938951                if (*nrels_mag >= 1) { 
    939                 } 
    940         } 
    941 } 
    942  
     952                        /* unimplemented */ 
     953                } 
     954        } 
     955} 
     956 
     957#if 0 
    943958static void bmcsensors_alarms(struct i2c_client *client, int operation, int ctl_name, 
    944959                    int *nrels_mag, long *results) 
    945960{ 
    946961        struct bmcsensors_data *data = client->data; 
    947 #if 0 
    948962        if (operation == SENSORS_PROC_REAL_INFO) 
    949963                *nrels_mag = 0; 
     
    953967                *nrels_mag = 1; 
    954968        } 
    955 #endif 
    956 } 
     969} 
     970#endif 
    957971 
    958972static int __init sm_bmcsensors_init(void) 
  • lm-sensors/trunk/lib/chips.c

    r1987 r2017  
    42734273  {  
    42744274    { SENSORS_BMC_IN1, "in1", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
    4275                         SENSORS_MODE_R, BMC_SYSCTL_IN1, VALUE(3), 2 }, 
     4275                        SENSORS_MODE_R, BMC_SYSCTL_IN1, VALUE(3), 3 }, 
    42764276    { SENSORS_BMC_IN1_MIN, "in1_min", SENSORS_BMC_IN1, 
    42774277                            SENSORS_BMC_IN1, 
    4278                             SENSORS_MODE_RW, BMC_SYSCTL_IN1, VALUE(1), 2 }, 
     4278                            SENSORS_MODE_RW, BMC_SYSCTL_IN1, VALUE(1), 3 }, 
    42794279    { SENSORS_BMC_IN1_MAX, "in1_max", SENSORS_BMC_IN1, 
    42804280                            SENSORS_BMC_IN1, 
    4281                             SENSORS_MODE_RW, BMC_SYSCTL_IN1, VALUE(2), 2 }, 
     4281                            SENSORS_MODE_RW, BMC_SYSCTL_IN1, VALUE(2), 3 }, 
    42824282    { SENSORS_BMC_IN1+1, "in2", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
    4283                         SENSORS_MODE_R, BMC_SYSCTL_IN1+1, VALUE(3), 2 }, 
     4283                        SENSORS_MODE_R, BMC_SYSCTL_IN1+1, VALUE(3), 3 }, 
    42844284    { SENSORS_BMC_IN1_MIN+1, "in2_min", SENSORS_BMC_IN1+1, 
    42854285                            SENSORS_BMC_IN1+1, 
    4286                             SENSORS_MODE_RW, BMC_SYSCTL_IN1+1, VALUE(1), 2 }, 
     4286                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+1, VALUE(1), 3 }, 
    42874287    { SENSORS_BMC_IN1_MAX+1, "in2_max", SENSORS_BMC_IN1+1, 
    42884288                            SENSORS_BMC_IN1+1, 
    4289                             SENSORS_MODE_RW, BMC_SYSCTL_IN1+1, VALUE(2), 2 }, 
     4289                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+1, VALUE(2), 3 }, 
    42904290    { SENSORS_BMC_IN1+2, "in3", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
    4291                         SENSORS_MODE_R, BMC_SYSCTL_IN1+2, VALUE(3), 2 }, 
     4291                        SENSORS_MODE_R, BMC_SYSCTL_IN1+2, VALUE(3), 3 }, 
    42924292    { SENSORS_BMC_IN1_MIN+2, "in3_min", SENSORS_BMC_IN1+2, 
    42934293                            SENSORS_BMC_IN1+2, 
    4294                             SENSORS_MODE_RW, BMC_SYSCTL_IN1+2, VALUE(1), 2 }, 
     4294                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+2, VALUE(1), 3 }, 
    42954295    { SENSORS_BMC_IN1_MAX+2, "in3_max", SENSORS_BMC_IN1+2, 
    42964296                            SENSORS_BMC_IN1+2, 
    4297                             SENSORS_MODE_RW, BMC_SYSCTL_IN1+2, VALUE(2), 2 }, 
     4297                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+2, VALUE(2), 3 }, 
    42984298    { SENSORS_BMC_IN1+3, "in4", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
    4299                         SENSORS_MODE_R, BMC_SYSCTL_IN1+3, VALUE(3), 2 }, 
     4299                        SENSORS_MODE_R, BMC_SYSCTL_IN1+3, VALUE(3), 3 }, 
    43004300    { SENSORS_BMC_IN1_MIN+3, "in4_min", SENSORS_BMC_IN1+3, 
    43014301                            SENSORS_BMC_IN1+3, 
    4302                             SENSORS_MODE_RW, BMC_SYSCTL_IN1+3, VALUE(1), 2 }, 
     4302                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+3, VALUE(1), 3 }, 
    43034303    { SENSORS_BMC_IN1_MAX+3, "in4_max", SENSORS_BMC_IN1+3, 
    43044304                            SENSORS_BMC_IN1+3, 
    4305                             SENSORS_MODE_RW, BMC_SYSCTL_IN1+3, VALUE(2), 2 }, 
     4305                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+3, VALUE(2), 3 }, 
    43064306    { SENSORS_BMC_IN1+4, "in5", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
    4307                         SENSORS_MODE_R, BMC_SYSCTL_IN1+4, VALUE(3), 2 }, 
     4307                        SENSORS_MODE_R, BMC_SYSCTL_IN1+4, VALUE(3), 3 }, 
    43084308    { SENSORS_BMC_IN1_MIN+4, "in5_min", SENSORS_BMC_IN1+4, 
    43094309                            SENSORS_BMC_IN1+4, 
    4310                             SENSORS_MODE_RW, BMC_SYSCTL_IN1+4, VALUE(1), 2 }, 
     4310                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+4, VALUE(1), 3 }, 
    43114311    { SENSORS_BMC_IN1_MAX+4, "in5_max", SENSORS_BMC_IN1+4, 
    43124312                            SENSORS_BMC_IN1+4, 
    4313                             SENSORS_MODE_RW, BMC_SYSCTL_IN1+4, VALUE(2), 2 }, 
     4313                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+4, VALUE(2), 3 }, 
    43144314    { SENSORS_BMC_IN1+5, "in6", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
    4315                         SENSORS_MODE_R, BMC_SYSCTL_IN1+5, VALUE(3), 2 }, 
     4315                        SENSORS_MODE_R, BMC_SYSCTL_IN1+5, VALUE(3), 3 }, 
    43164316    { SENSORS_BMC_IN1_MIN+5, "in6_min", SENSORS_BMC_IN1+5, 
    43174317                            SENSORS_BMC_IN1+5, 
    4318                             SENSORS_MODE_RW, BMC_SYSCTL_IN1+5, VALUE(1), 2 }, 
     4318                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+5, VALUE(1), 3 }, 
    43194319    { SENSORS_BMC_IN1_MAX+5, "in6_max", SENSORS_BMC_IN1+5, 
    43204320                            SENSORS_BMC_IN1+5, 
    4321                             SENSORS_MODE_RW, BMC_SYSCTL_IN1+5, VALUE(2), 2 }, 
     4321                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+5, VALUE(2), 3 }, 
    43224322    { SENSORS_BMC_IN1+6, "in7", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
    4323                         SENSORS_MODE_R, BMC_SYSCTL_IN1+6, VALUE(3), 2 }, 
     4323                        SENSORS_MODE_R, BMC_SYSCTL_IN1+6, VALUE(3), 3 }, 
    43244324    { SENSORS_BMC_IN1_MIN+6, "in7_min", SENSORS_BMC_IN1+6, 
    43254325                            SENSORS_BMC_IN1+6, 
    4326                             SENSORS_MODE_RW, BMC_SYSCTL_IN1+6, VALUE(1), 2 }, 
     4326                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+6, VALUE(1), 3 }, 
    43274327    { SENSORS_BMC_IN1_MAX+6, "in7_max", SENSORS_BMC_IN1+6, 
    43284328                            SENSORS_BMC_IN1+6, 
    4329                             SENSORS_MODE_RW, BMC_SYSCTL_IN1+6, VALUE(2), 2 }, 
     4329                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+6, VALUE(2), 3 }, 
     4330 
     4331    { SENSORS_BMC_IN1+7, "in8", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
     4332                        SENSORS_MODE_R, BMC_SYSCTL_IN1+7, VALUE(3), 3 }, 
     4333    { SENSORS_BMC_IN1_MIN+7, "in8_min", SENSORS_BMC_IN1+7, 
     4334                            SENSORS_BMC_IN1+7, 
     4335                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+7, VALUE(1), 3 }, 
     4336    { SENSORS_BMC_IN1_MAX+7, "in8_max", SENSORS_BMC_IN1+7, 
     4337                            SENSORS_BMC_IN1+7, 
     4338                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+7, VALUE(2), 3 }, 
     4339    { SENSORS_BMC_IN1+8, "in9", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
     4340                        SENSORS_MODE_R, BMC_SYSCTL_IN1+8, VALUE(3), 3 }, 
     4341    { SENSORS_BMC_IN1_MIN+8, "in9_min", SENSORS_BMC_IN1+8, 
     4342                            SENSORS_BMC_IN1+8, 
     4343                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+8, VALUE(1), 3 }, 
     4344    { SENSORS_BMC_IN1_MAX+8, "in9_max", SENSORS_BMC_IN1+8, 
     4345                            SENSORS_BMC_IN1+8, 
     4346                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+8, VALUE(2), 3 }, 
     4347    { SENSORS_BMC_IN1+9, "in10", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
     4348                        SENSORS_MODE_R, BMC_SYSCTL_IN1+9, VALUE(3), 3 }, 
     4349    { SENSORS_BMC_IN1_MIN+9, "in10_min", SENSORS_BMC_IN1+9, 
     4350                            SENSORS_BMC_IN1+9, 
     4351                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+9, VALUE(1), 3 }, 
     4352    { SENSORS_BMC_IN1_MAX+9, "in10_max", SENSORS_BMC_IN1+9, 
     4353                            SENSORS_BMC_IN1+9, 
     4354                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+9, VALUE(2), 3 }, 
     4355    { SENSORS_BMC_IN1+10, "in11", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
     4356                        SENSORS_MODE_R, BMC_SYSCTL_IN1+10, VALUE(3), 3 }, 
     4357    { SENSORS_BMC_IN1_MIN+10, "in11_min", SENSORS_BMC_IN1+10, 
     4358                            SENSORS_BMC_IN1+10, 
     4359                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+10, VALUE(1), 3 }, 
     4360    { SENSORS_BMC_IN1_MAX+10, "in11_max", SENSORS_BMC_IN1+10, 
     4361                            SENSORS_BMC_IN1+10, 
     4362                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+10, VALUE(2), 3 }, 
     4363    { SENSORS_BMC_IN1+11, "in12", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
     4364                        SENSORS_MODE_R, BMC_SYSCTL_IN1+11, VALUE(3), 3 }, 
     4365    { SENSORS_BMC_IN1_MIN+11, "in12_min", SENSORS_BMC_IN1+11, 
     4366                            SENSORS_BMC_IN1+11, 
     4367                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+11, VALUE(1), 3 }, 
     4368    { SENSORS_BMC_IN1_MAX+11, "in12_max", SENSORS_BMC_IN1+11, 
     4369                            SENSORS_BMC_IN1+11, 
     4370                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+11, VALUE(2), 3 }, 
     4371    { SENSORS_BMC_IN1+12, "in13", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
     4372                        SENSORS_MODE_R, BMC_SYSCTL_IN1+12, VALUE(3), 3 }, 
     4373    { SENSORS_BMC_IN1_MIN+12, "in13_min", SENSORS_BMC_IN1+12, 
     4374                            SENSORS_BMC_IN1+12, 
     4375                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+12, VALUE(1), 3 }, 
     4376    { SENSORS_BMC_IN1_MAX+12, "in13_max", SENSORS_BMC_IN1+12, 
     4377                            SENSORS_BMC_IN1+12, 
     4378                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+12, VALUE(2), 3 }, 
     4379    { SENSORS_BMC_IN1+13, "in14", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
     4380                        SENSORS_MODE_R, BMC_SYSCTL_IN1+13, VALUE(3), 3 }, 
     4381    { SENSORS_BMC_IN1_MIN+13, "in14_min", SENSORS_BMC_IN1+13, 
     4382                            SENSORS_BMC_IN1+13, 
     4383                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+13, VALUE(1), 3 }, 
     4384    { SENSORS_BMC_IN1_MAX+13, "in14_max", SENSORS_BMC_IN1+13, 
     4385                            SENSORS_BMC_IN1+13, 
     4386                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+13, VALUE(2), 3 }, 
     4387    { SENSORS_BMC_IN1+14, "in15", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
     4388                        SENSORS_MODE_R, BMC_SYSCTL_IN1+14, VALUE(3), 3 }, 
     4389    { SENSORS_BMC_IN1_MIN+14, "in15_min", SENSORS_BMC_IN1+14, 
     4390                            SENSORS_BMC_IN1+14, 
     4391                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+14, VALUE(1), 3 }, 
     4392    { SENSORS_BMC_IN1_MAX+14, "in15_max", SENSORS_BMC_IN1+14, 
     4393                            SENSORS_BMC_IN1+14, 
     4394                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+14, VALUE(2), 3 }, 
     4395    { SENSORS_BMC_IN1+15, "in16", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
     4396                        SENSORS_MODE_R, BMC_SYSCTL_IN1+15, VALUE(3), 3 }, 
     4397    { SENSORS_BMC_IN1_MIN+15, "in16_min", SENSORS_BMC_IN1+15, 
     4398                            SENSORS_BMC_IN1+15, 
     4399                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+15, VALUE(1), 3 }, 
     4400    { SENSORS_BMC_IN1_MAX+15, "in16_max", SENSORS_BMC_IN1+15, 
     4401                            SENSORS_BMC_IN1+15, 
     4402                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+15, VALUE(2), 3 }, 
     4403    { SENSORS_BMC_IN1+16, "in17", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
     4404                        SENSORS_MODE_R, BMC_SYSCTL_IN1+16, VALUE(3), 3 }, 
     4405    { SENSORS_BMC_IN1_MIN+16, "in17_min", SENSORS_BMC_IN1+16, 
     4406                            SENSORS_BMC_IN1+16, 
     4407                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+16, VALUE(1), 3 }, 
     4408    { SENSORS_BMC_IN1_MAX+16, "in17_max", SENSORS_BMC_IN1+16, 
     4409                            SENSORS_BMC_IN1+16, 
     4410                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+16, VALUE(2), 3 }, 
     4411    { SENSORS_BMC_IN1+17, "in18", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
     4412                        SENSORS_MODE_R, BMC_SYSCTL_IN1+17, VALUE(3), 3 }, 
     4413    { SENSORS_BMC_IN1_MIN+17, "in18_min", SENSORS_BMC_IN1+17, 
     4414                            SENSORS_BMC_IN1+17, 
     4415                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+17, VALUE(1), 3 }, 
     4416    { SENSORS_BMC_IN1_MAX+17, "in18_max", SENSORS_BMC_IN1+17, 
     4417                            SENSORS_BMC_IN1+17, 
     4418                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+17, VALUE(2), 3 }, 
     4419    { SENSORS_BMC_IN1+18, "in19", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
     4420                        SENSORS_MODE_R, BMC_SYSCTL_IN1+18, VALUE(3), 3 }, 
     4421    { SENSORS_BMC_IN1_MIN+18, "in19_min", SENSORS_BMC_IN1+18, 
     4422                            SENSORS_BMC_IN1+18, 
     4423                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+18, VALUE(1), 3 }, 
     4424    { SENSORS_BMC_IN1_MAX+18, "in19_max", SENSORS_BMC_IN1+18, 
     4425                            SENSORS_BMC_IN1+18, 
     4426                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+18, VALUE(2), 3 }, 
     4427    { SENSORS_BMC_IN1+19, "in20", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
     4428                        SENSORS_MODE_R, BMC_SYSCTL_IN1+19, VALUE(3), 3 }, 
     4429    { SENSORS_BMC_IN1_MIN+19, "in20_min", SENSORS_BMC_IN1+19, 
     4430                            SENSORS_BMC_IN1+19, 
     4431                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+19, VALUE(1), 3 }, 
     4432    { SENSORS_BMC_IN1_MAX+19, "in20_max", SENSORS_BMC_IN1+19, 
     4433                            SENSORS_BMC_IN1+19, 
     4434                            SENSORS_MODE_RW, BMC_SYSCTL_IN1+19, VALUE(2), 3 }, 
    43304435    { SENSORS_BMC_FAN1, "fan1", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 
    43314436                         SENSORS_MODE_R, BMC_SYSCTL_FAN1, VALUE(2), 0 }, 
     
    43424447    { SENSORS_BMC_FAN1+6, "fan7", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 
    43434448                         SENSORS_MODE_R, BMC_SYSCTL_FAN1+6, VALUE(2), 0 }, 
     4449    { SENSORS_BMC_FAN1+7, "fan8", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 
     4450                         SENSORS_MODE_R, BMC_SYSCTL_FAN1+7, VALUE(2), 0 }, 
     4451    { SENSORS_BMC_FAN1+8, "fan9", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 
     4452                         SENSORS_MODE_R, BMC_SYSCTL_FAN1+8, VALUE(2), 0 }, 
     4453    { SENSORS_BMC_FAN1+9, "fan10", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 
     4454                         SENSORS_MODE_R, BMC_SYSCTL_FAN1+9, VALUE(2), 0 }, 
    43444455    { SENSORS_BMC_FAN1_MIN, "fan1_min", SENSORS_BMC_FAN1, 
    43454456                             SENSORS_BMC_FAN1, 
     
    43634474                             SENSORS_BMC_FAN1+6, 
    43644475                             SENSORS_MODE_RW, BMC_SYSCTL_FAN1+6, VALUE(1), 0 }, 
     4476    { SENSORS_BMC_FAN1_MIN+7, "fan8_min", SENSORS_BMC_FAN1+7, 
     4477                             SENSORS_BMC_FAN1+7, 
     4478                             SENSORS_MODE_RW, BMC_SYSCTL_FAN1+7, VALUE(1), 0 }, 
     4479    { SENSORS_BMC_FAN1_MIN+8, "fan9_min", SENSORS_BMC_FAN1+8, 
     4480                             SENSORS_BMC_FAN1+8, 
     4481                             SENSORS_MODE_RW, BMC_SYSCTL_FAN1+8, VALUE(1), 0 }, 
     4482    { SENSORS_BMC_FAN1_MIN+9, "fan10_min", SENSORS_BMC_FAN1+9, 
     4483                             SENSORS_BMC_FAN1+9, 
     4484                             SENSORS_MODE_RW, BMC_SYSCTL_FAN1+9, VALUE(1), 0 }, 
    43654485    { SENSORS_BMC_TEMP1, "temp1", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 
    4366                          SENSORS_MODE_R, BMC_SYSCTL_TEMP1, VALUE(3), 0 }, 
     4486                         SENSORS_MODE_R, BMC_SYSCTL_TEMP1, VALUE(3), 2 }, 
    43674487    { SENSORS_BMC_TEMP1_MIN, "temp1_min", SENSORS_BMC_TEMP1, 
    43684488                              SENSORS_BMC_TEMP1, SENSORS_MODE_RW,  
    4369                               BMC_SYSCTL_TEMP1, VALUE(2), 0 }, 
     4489                              BMC_SYSCTL_TEMP1, VALUE(2), 2 }, 
    43704490    { SENSORS_BMC_TEMP1_MAX, "temp1_max", SENSORS_BMC_TEMP1, 
    43714491                              SENSORS_BMC_TEMP1, SENSORS_MODE_RW,  
    4372                               BMC_SYSCTL_TEMP1, VALUE(1), 0 }, 
     4492                              BMC_SYSCTL_TEMP1, VALUE(1), 2 }, 
    43734493    { SENSORS_BMC_TEMP1+1, "temp2", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 
    4374                          SENSORS_MODE_R, BMC_SYSCTL_TEMP1+1, VALUE(3), 0 }, 
     4494                         SENSORS_MODE_R, BMC_SYSCTL_TEMP1+1, VALUE(3), 2 }, 
    43754495    { SENSORS_BMC_TEMP1_MIN+1, "temp2_min", SENSORS_BMC_TEMP1+1, 
    43764496                              SENSORS_BMC_TEMP1+1, SENSORS_MODE_RW,  
    4377                               BMC_SYSCTL_TEMP1+1, VALUE(2), 0 }, 
     4497                              BMC_SYSCTL_TEMP1+1, VALUE(2), 2 }, 
    43784498    { SENSORS_BMC_TEMP1_MAX+1, "temp2_max", SENSORS_BMC_TEMP1+1, 
    43794499                              SENSORS_BMC_TEMP1+1, SENSORS_MODE_RW,  
    4380                               BMC_SYSCTL_TEMP1+1, VALUE(1), 0 }, 
     4500                              BMC_SYSCTL_TEMP1+1, VALUE(1), 2 }, 
    43814501    { SENSORS_BMC_TEMP1+2, "temp3", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 
    4382                          SENSORS_MODE_R, BMC_SYSCTL_TEMP1+2, VALUE(3), 0 }, 
     4502                         SENSORS_MODE_R, BMC_SYSCTL_TEMP1+2, VALUE(3), 2 }, 
    43834503    { SENSORS_BMC_TEMP1_MIN+2, "temp3_min", SENSORS_BMC_TEMP1+2, 
    43844504                              SENSORS_BMC_TEMP1+2, SENSORS_MODE_RW,  
    4385                               BMC_SYSCTL_TEMP1+2, VALUE(2), 0 }, 
     4505                              BMC_SYSCTL_TEMP1+2, VALUE(2), 2 }, 
    43864506    { SENSORS_BMC_TEMP1_MAX+2, "temp3_max", SENSORS_BMC_TEMP1+2, 
    43874507                              SENSORS_BMC_TEMP1+2, SENSORS_MODE_RW,  
    4388                               BMC_SYSCTL_TEMP1+2, VALUE(1), 0 }, 
    4389         /* scalings from here down */ 
     4508                              BMC_SYSCTL_TEMP1+2, VALUE(1), 2 }, 
    43904509    { SENSORS_BMC_TEMP1+3, "temp4", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 
    4391                          SENSORS_MODE_R, BMC_SYSCTL_TEMP1+3, VALUE(3), 1 }, 
     4510                         SENSORS_MODE_R, BMC_SYSCTL_TEMP1+3, VALUE(3), 2 }, 
    43924511    { SENSORS_BMC_TEMP1_MIN+3, "temp4_min", SENSORS_BMC_TEMP1+3, 
    43934512                              SENSORS_BMC_TEMP1+3, SENSORS_MODE_RW,  
    4394                               BMC_SYSCTL_TEMP1+3, VALUE(2), 1 }, 
     4513                              BMC_SYSCTL_TEMP1+3, VALUE(2), 2 }, 
    43954514    { SENSORS_BMC_TEMP1_MAX+3, "temp4_max", SENSORS_BMC_TEMP1+3, 
    43964515                              SENSORS_BMC_TEMP1+3, SENSORS_MODE_RW,  
    4397                               BMC_SYSCTL_TEMP1+3, VALUE(1), 1 }, 
     4516                              BMC_SYSCTL_TEMP1+3, VALUE(1), 2 }, 
    43984517    { SENSORS_BMC_TEMP1+4, "temp5", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 
    4399                          SENSORS_MODE_R, BMC_SYSCTL_TEMP1+4, VALUE(3), 1 }, 
     4518                         SENSORS_MODE_R, BMC_SYSCTL_TEMP1+4, VALUE(3), 2 }, 
    44004519    { SENSORS_BMC_TEMP1_MIN+4, "temp5_min", SENSORS_BMC_TEMP1+4, 
    44014520                              SENSORS_BMC_TEMP1+4, SENSORS_MODE_RW,  
    4402                               BMC_SYSCTL_TEMP1+4, VALUE(2), 1 }, 
     4521                              BMC_SYSCTL_TEMP1+4, VALUE(2), 2 }, 
    44034522    { SENSORS_BMC_TEMP1_MAX+4, "temp5_max", SENSORS_BMC_TEMP1+4, 
    44044523                              SENSORS_BMC_TEMP1+4, SENSORS_MODE_RW,  
    4405                               BMC_SYSCTL_TEMP1+4, VALUE(1), 1 }, 
     4524                              BMC_SYSCTL_TEMP1+4, VALUE(1), 2 }, 
    44064525    { SENSORS_BMC_TEMP1+5, "temp6", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 
    4407                          SENSORS_MODE_R, BMC_SYSCTL_TEMP1+5, VALUE(3), 1 }, 
     4526                         SENSORS_MODE_R, BMC_SYSCTL_TEMP1+5, VALUE(3), 2 }, 
    44084527    { SENSORS_BMC_TEMP1_MIN+5, "temp6_min", SENSORS_BMC_TEMP1+5, 
    44094528                              SENSORS_BMC_TEMP1+5, SENSORS_MODE_RW,  
    4410                               BMC_SYSCTL_TEMP1+5, VALUE(2), 1 }, 
     4529                              BMC_SYSCTL_TEMP1+5, VALUE(2), 2 }, 
    44114530    { SENSORS_BMC_TEMP1_MAX+5, "temp6_max", SENSORS_BMC_TEMP1+5, 
    44124531                              SENSORS_BMC_TEMP1+5, SENSORS_MODE_RW,  
    4413                               BMC_SYSCTL_TEMP1+5, VALUE(1), 1 }, 
     4532                              BMC_SYSCTL_TEMP1+5, VALUE(1), 2 }, 
    44144533    { SENSORS_BMC_TEMP1+6, "temp7", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 
    4415                          SENSORS_MODE_R, BMC_SYSCTL_TEMP1+6, VALUE(3), 1 }, 
     4534                         SENSORS_MODE_R, BMC_SYSCTL_TEMP1+6, VALUE(3), 2 }, 
    44164535    { SENSORS_BMC_TEMP1_MIN+6, "temp7_min", SENSORS_BMC_TEMP1+6, 
    44174536                              SENSORS_BMC_TEMP1+6, SENSORS_MODE_RW,  
    4418                               BMC_SYSCTL_TEMP1+6, VALUE(2), 1 }, 
     4537                              BMC_SYSCTL_TEMP1+6, VALUE(2), 2 }, 
    44194538    { SENSORS_BMC_TEMP1_MAX+6, "temp7_max", SENSORS_BMC_TEMP1+6, 
    44204539                              SENSORS_BMC_TEMP1+6, SENSORS_MODE_RW,  
    4421                               BMC_SYSCTL_TEMP1+6, VALUE(1), 1 }, 
     4540                              BMC_SYSCTL_TEMP1+6, VALUE(1), 2 }, 
     4541    { SENSORS_BMC_TEMP1+7, "temp8", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 
     4542                         SENSORS_MODE_R, BMC_SYSCTL_TEMP1+7, VALUE(3), 2 }, 
     4543    { SENSORS_BMC_TEMP1_MIN+7, "temp8_min", SENSORS_BMC_TEMP1+7, 
     4544                              SENSORS_BMC_TEMP1+7, SENSORS_MODE_RW,  
     4545                              BMC_SYSCTL_TEMP1+7, VALUE(2), 2 }, 
     4546    { SENSORS_BMC_TEMP1_MAX+7, "temp8_max", SENSORS_BMC_TEMP1+7, 
     4547                              SENSORS_BMC_TEMP1+7, SENSORS_MODE_RW,  
     4548                              BMC_SYSCTL_TEMP1+7, VALUE(1), 2 }, 
     4549    { SENSORS_BMC_TEMP1+8, "temp9", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 
     4550                         SENSORS_MODE_R, BMC_SYSCTL_TEMP1+8, VALUE(3), 2 }, 
     4551    { SENSORS_BMC_TEMP1_MIN+8, "temp9_min", SENSORS_BMC_TEMP1+8, 
     4552                              SENSORS_BMC_TEMP1+8, SENSORS_MODE_RW,  
     4553                              BMC_SYSCTL_TEMP1+8, VALUE(2), 2 }, 
     4554    { SENSORS_BMC_TEMP1_MAX+8, "temp9_max", SENSORS_BMC_TEMP1+8, 
     4555                              SENSORS_BMC_TEMP1+8, SENSORS_MODE_RW,  
     4556                              BMC_SYSCTL_TEMP1+8, VALUE(1), 2 }, 
     4557    { SENSORS_BMC_TEMP1+9, "temp10", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 
     4558                         SENSORS_MODE_R, BMC_SYSCTL_TEMP1+9, VALUE(3), 2 }, 
     4559    { SENSORS_BMC_TEMP1_MIN+9, "temp10_min", SENSORS_BMC_TEMP1+9, 
     4560                              SENSORS_BMC_TEMP1+9, SENSORS_MODE_RW,  
     4561                              BMC_SYSCTL_TEMP1+9, VALUE(2), 2 }, 
     4562    { SENSORS_BMC_TEMP1_MAX+9, "temp10_max", SENSORS_BMC_TEMP1+9, 
     4563                              SENSORS_BMC_TEMP1+9, SENSORS_MODE_RW,  
     4564                              BMC_SYSCTL_TEMP1+9, VALUE(1), 2 }, 
    44224565    { SENSORS_BMC_ALARMS, "alarms", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,  
    44234566                           SENSORS_MODE_R, BMC_SYSCTL_ALARMS, VALUE(1), 0 },