Changeset 2633

Show
Ignore:
Timestamp:
07/04/04 21:12:18 (4 years ago)
Author:
khali
Message:

Add LM86, MAX6657 and MAX6658 support to the lm90 driver.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/doc/chips/SUMMARY

    r2625 r2633  
    140140        lm90            2       -       -       -       yes     no 
    141141        lm99            2       -       -       -       yes     no 
     142        lm86            2       -       -       -       yes     no 
    142143        adm1032         2       -       -       -       yes     no 
     144        max6657         2       -       -       -       yes     no 
    143145        (lm89 is detected as an lm99) 
    144146        lm89            2       -       -       -       yes     no 
     147        (max6658 is detected as a max6657) 
     148        max6658         2       -       -       -       yes     no 
    145149 
    146150lm92 
  • lm-sensors/trunk/doc/chips/lm90

    r2471 r2633  
    2020    Datasheet: Publicly available at the National Semiconductor website 
    2121               http://www.national.com/pf/LM/LM99.html 
     22  * National Semiconductor LM86 
     23    Prefix: `lm86' 
     24    Addresses scanned: I2C 0x4c 
     25    Datasheet: Publicly available at the National Semiconductor website 
     26               http://www.national.com/pf/LM/LM86.html 
    2227  * Analog Devices ADM1032 
    2328    Prefix: `adm1032' 
     
    2530    Datasheet: Publicly available at the Analog Devices website 
    2631               http://products.analog.com/products/info.asp?product=ADM1032 
     32  * Maxim MAX6657 
     33    Prefix: `max6657' 
     34    Addresses scanned: I2C 0x4c 
     35    Datasheet: Publicly available at the Maxim website 
     36               http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578 
     37  * Maxim MAX6658 
     38    Prefix: `max6657' 
     39    Addresses scanned: I2C 0x4c 
     40    Datasheet: Publicly available at the Maxim website 
     41               http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578 
    2742 
    2843 
     
    4661  List of adapter,address pairs which are unquestionably assumed to contain 
    4762  a `lm99' chip 
     63* force_lm86: short array (min = 1, max = 48) 
     64  List of adapter,address pairs which are unquestionably assumed to contain 
     65  a `lm86' chip 
     66* force_max6657: short array (min = 1, max = 48) 
     67  List of adapter,address pairs which are unquestionably assumed to contain 
     68  a `max6657' chip 
    4869* probe: short array (min = 1, max = 48) 
    4970  List of adapter,address pairs to scan additionally 
     
    6283well as the temperature of up to one external diode. It is compatible 
    6384with many other devices such as the LM86, the LM89, the LM99, the ADM1032, 
    64 the MAX6657 and the MAX6658. Of these, only the ADM1032, LM89 and LM99 are 
    65 supported for now, but the others can be forced (and later added). 
     85the MAX6657 and the MAX6658, all of which are supported by this driver. 
    6686 
    6787The specificity of this family of chipsets over the ADM1021/LM84 
     
    7898  * ALERT is triggered by temperatures over critical limits. 
    7999 
    80 LM89: 
     100LM86 and LM89: 
    81101  * Same as LM90 
    82102  * Better external channel accuracy 
     
    91111  * Up to 64 conversions/s. 
    92112  * ALERT is triggered by open remote sensor. 
     113 
     114MAX6657 and MAX6658: 
     115  * Remote sensor type selecion 
    93116 
    94117All temperature values are given in degrees Celcius. Resolution 
     
    111134------------- 
    112135 
    113 Chips 'lm90', adm1032' and 'lm99
     136Chips 'lm90', adm1032', 'lm99', 'lm86' and 'max6657
    114137 
    115138LABEL                 LABEL CLASS           COMPUTE CLASS          MODE  MAGN 
  • lm-sensors/trunk/etc/sensors.conf.eg

    r2632 r2633  
    17341734 
    17351735 
    1736 chip "lm90-*" "adm1032-*" 
     1736chip "lm90-*" "adm1032-*" "lm86-*" "max6657-*" 
    17371737 
    17381738   label temp1 "M/B Temp" 
  • lm-sensors/trunk/kernel/chips/lm90.c

    r2471 r2633  
    2222 * Note that there is no way to differenciate between both chips. 
    2323 * 
     24 * This driver also supports the LM86, another sensor chip made by 
     25 * National Semiconductor. It is exactly similar to the LM90 except it 
     26 * has a higher accuracy. 
     27 * Complete datasheet can be obtained from National's website at: 
     28 *   http://www.national.com/pf/LM/LM86.html 
     29 * 
    2430 * This driver also supports the ADM1032, a sensor chip made by Analog 
    2531 * Devices. That chip is similar to the LM90, with a few differences 
     
    2733 * obtained from Analog's website at: 
    2834 *   http://products.analog.com/products/info.asp?product=ADM1032 
     35 * Among others, it has a higher accuracy than the LM90, much like the 
     36 * LM86 does. 
     37 * 
     38 * This driver also supports the MAX6657 and MAX6658, sensor chips made 
     39 * by Maxim. These chips are similar to the LM86. Complete datasheet 
     40 * can be obtained at Maxim's website at: 
     41 *   http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578 
     42 * Note that there is no way to differenciate between both chips (but 
     43 * no need either). 
    2944 * 
    3045 * Since the LM90 was the first chipset supported by this driver, most 
     
    6176 * Addresses to scan 
    6277 * Address is fully defined internally and cannot be changed. 
    63  * LM89, LM90, LM99 and ADM1032 have address 0x4c. 
     78 * LM86, LM89, LM90, LM99, ADM1032, MAX6657 and MAX6658 have address 0x4c. 
    6479 * LM89-1, and LM99-1 have address 0x4d. 
    6580 */ 
     
    7489 */ 
    7590 
    76 SENSORS_INSMOD_3(lm90, adm1032, lm99); 
     91SENSORS_INSMOD_5(lm90, adm1032, lm99, lm86, max6657); 
    7792 
    7893/* 
     
    261276        const char *type_name = ""; 
    262277        const char *client_name = ""; 
    263         u8 reg_config1=0, reg_convrate=0; 
    264278 
    265279#ifdef DEBUG 
     
    310324         */ 
    311325 
    312         if (kind < 0) /* detection */ 
    313         { 
     326        /* Default to an LM90 if forced */ 
     327        if (kind == 0) 
     328                kind = lm90; 
     329 
     330        if (kind < 0) /* detection and identification */ 
     331        { 
     332                u8 man_id, chip_id, reg_config1, reg_convrate; 
     333 
     334                man_id = i2c_smbus_read_byte_data(new_client, 
     335                        LM90_REG_R_MAN_ID); 
     336                chip_id = i2c_smbus_read_byte_data(new_client, 
     337                        LM90_REG_R_CHIP_ID); 
    314338                reg_config1 = i2c_smbus_read_byte_data(new_client, 
    315339                        LM90_REG_R_CONFIG1); 
    316340                reg_convrate = i2c_smbus_read_byte_data(new_client, 
    317341                        LM90_REG_R_CONVRATE); 
    318  
    319                 if ((reg_config1 & 0x2A) != 0x00 
    320                  || reg_convrate > 0x0A) 
    321                 { 
    322 #ifdef DEBUG 
    323                         printk(KERN_DEBUG "lm90.o: Detection failed at 0x%02x.\n", 
    324                                 address); 
    325 #endif 
    326                         goto ERROR1; 
    327                 } 
    328         } 
    329  
    330         if (kind <= 0) /* identification */ 
    331         { 
    332                 u8 man_id, chip_id; 
    333  
    334                 man_id = i2c_smbus_read_byte_data(new_client, 
    335                         LM90_REG_R_MAN_ID); 
    336                 chip_id = i2c_smbus_read_byte_data(new_client, 
    337                         LM90_REG_R_CHIP_ID); 
    338342                 
    339343                if (man_id == 0x01) /* National Semiconductor */ 
     
    344348                                LM90_REG_R_CONFIG2); 
    345349 
    346                         if (kind == 0 /* skip detection */ 
    347                          || ((reg_config2 & 0xF8) == 0x00 
    348                           && reg_convrate <= 0x09)
     350                        if ((reg_config1 & 0x2A) == 0x00 
     351                         && (reg_config2 & 0xF8) == 0x00 
     352                         && reg_convrate <= 0x09
    349353                        { 
    350354                                if (address == 0x4C 
    351355                                 && (chip_id & 0xF0) == 0x20) /* LM90 */ 
    352                                 { 
    353356                                        kind = lm90; 
    354                                 } 
    355357                                else if ((chip_id & 0xF0) == 0x30) /* LM89/LM99 */ 
    356                                 { 
    357358                                        kind = lm99; 
    358                                 } 
     359                                else if (address == 0x4C 
     360                                 && (chip_id & 0xF0) == 0x10) /* LM86 */ 
     361                                        kind = lm99; 
    359362                        } 
    360363                } 
     
    363366                        if (address == 0x4C 
    364367                         && (chip_id & 0xF0) == 0x40 /* ADM1032 */ 
    365                          && (kind == 0 /* skip detection */ 
    366                           || (reg_config1 & 0x3F) == 0x00)) 
    367                         { 
     368                         && (reg_config1 & 0x3F) == 0x00 
     369                         && reg_convrate <= 0x0A) 
    368370                                kind = adm1032; 
    369                         } 
     371                } 
     372                else if (man_id == 0x4D) /* Maxim */ 
     373                { 
     374                        if (address == 0x4C 
     375                         && (reg_config1 & 0x1F) == 0 
     376                         && reg_convrate <= 0x09) 
     377                                kind = max6657; 
    370378                } 
    371379        } 
     
    391399                type_name = "lm99"; 
    392400                client_name = "LM99 chip"; 
     401        } 
     402        else if (kind == lm86) 
     403        { 
     404                type_name = "lm86"; 
     405                client_name = "LM86 chip"; 
     406        } 
     407        else if (kind == max6657) 
     408        { 
     409                type_name = "max6657"; 
     410                client_name = "MAX6657 chip"; 
    393411        } 
    394412        else 
  • lm-sensors/trunk/lib/chips.c

    r2618 r2633  
    52155215 { SENSORS_ADM1032_PREFIX, lm90_features }, 
    52165216 { SENSORS_LM99_PREFIX, lm90_features }, 
     5217 { SENSORS_LM86_PREFIX, lm90_features }, 
     5218 { SENSORS_MAX6657_PREFIX, lm90_features }, 
    52175219 { SENSORS_MAX1619_PREFIX, max1619_features }, 
    52185220 { SENSORS_XEONTEMP_PREFIX, xeontemp_features }, 
  • lm-sensors/trunk/lib/chips.h

    r2603 r2633  
    476476#define SENSORS_LM85_ZONE3_SMOOTH          101  /* RW -- zone3_smooth  */ 
    477477 
    478 /* LM89/LM90/LM99/ADM1032 chips */ 
     478/* LM86/LM89/LM90/LM99/ADM1032/MAX6657 chips */ 
    479479 
    480480#define SENSORS_LM90_PREFIX "lm90" 
    481481#define SENSORS_ADM1032_PREFIX "adm1032" 
    482482#define SENSORS_LM99_PREFIX "lm99" 
     483#define SENSORS_LM86_PREFIX "lm86" 
     484#define SENSORS_MAX6657_PREFIX "max6657" 
    483485 
    484486#define SENSORS_LM90_LOCAL_TEMP 51 /* R */ 
  • lm-sensors/trunk/prog/detect/sensors-detect

    r2624 r2633  
    12191219     { 
    12201220       name => "Maxim MAX6657/MAX6658/MAX6659", 
    1221        driver => "to-be-written", 
     1221       driver => "lm90", 
    12221222       i2c_addrs => [0x4c], 
    12231223       i2c_detect => sub { lm90_detect 4, @_ }, 
  • lm-sensors/trunk/prog/sensors/main.c

    r2573 r2633  
    425425        { "adm1032", print_lm90 }, 
    426426        { "lm99", print_lm90 }, 
     427        { "lm86", print_lm90 }, 
     428        { "max6657", print_lm90 }, 
    427429        { "xeontemp", print_xeontemp }, 
    428430        { "max6650", print_max6650 },