Changeset 1535

Show
Ignore:
Timestamp:
09/18/02 21:17:30 (6 years ago)
Author:
phil
Message:

(Phil) Applied Alexander Malysh <amalysh@web.de>'s patch for
MC1066 support.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/CONTRIBUTORS

    r1528 r1535  
    7777* Alexander Malysh <amalysh@web.de> 
    7878  Author of the i2c-sis630 bus driver. 
     79  Added Onsemi MC1066 support to the adm1021 driver. 
    7980 
  • lm-sensors/trunk/doc/chips/adm1021

    r1299 r1535  
    4646    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e (inclusive) 
    4747    Datasheet: Publicly available at the TI website 
     48  * Onsemi MC1066 
     49    Prefix `mc1066' 
     50    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e (inclusive) 
     51    Datasheet: Publicly available at the Onsemi website 
    4852 
    4953 
     
    7478* probe_range: short array (min = 1, max = 48) 
    7579  List of adapter,start-addr,end-addr triples to scan additionally 
     80* read_only: int (0 = disable, 1 = enable , default 0) 
     81  Read only mode.This is useful for Laptop's if BIOS managed Thermal Zone (Fan on/off). 
     82  Otherwise it confuse BIOS by writing any limit register's. 
    7683 
    7784 
     
    204211  remote_temp_over       SENSORS_MAX1617A_REMOTE_TEMP_OVER        remote_temp:1 
    205212            alarms                 SENSORS_MAX1617A_ALARMS             alarms:1 
     213 
     214 
     215Chip `mc1066' 
     216             LABEL        LABEL CLASS      COMPUTE CLASS ACCESS MAGNITUDE 
     217              temp               NONE               NONE     R     0 
     218          temp_low               temp               temp     RW    0 
     219         temp_over               temp               temp     RW    0 
     220       remote_temp               NONE               NONE     R     0 
     221   remote_temp_low        remote_temp        remote_temp     RW    0 
     222  remote_temp_over        remote_temp        remote_temp     RW    0 
     223            alarms               NONE               NONE     R     0 
     224 
     225             LABEL                          FEATURE SYMBOL        SYSCTL FILE:NR 
     226              temp                    SENSORS_MAX1617_TEMP               temp:3 
     227          temp_low               SENSORS_MAX1617_TEMP_HYST               temp:2 
     228         temp_over               SENSORS_MAX1617_TEMP_OVER               temp:1 
     229       remote_temp             SENSORS_MAX1617_REMOTE_TEMP        remote_temp:3 
     230   remote_temp_low        SENSORS_MAX1617_REMOTE_TEMP_HYST        remote_temp:2 
     231  remote_temp_over        SENSORS_MAX1617_REMOTE_TEMP_OVER        remote_temp:1 
     232            alarms                  SENSORS_MAX1617_ALARMS             alarms:1 
     233 
    206234 
    207235 
  • lm-sensors/trunk/etc/sensors.conf.eg

    r1502 r1535  
    13381338   set    aout        0 
    13391339 
    1340 chip "adm1021-*" "adm1023-*" "max1617-*" "max1617a-*" "thmc10-*" "lm84-*" "gl523sm-*" 
     1340chip "adm1021-*" "adm1023-*" "max1617-*" "max1617a-*" "thmc10-*" "lm84-*" "gl523sm-*" "mc1066-*" 
    13411341 
    13421342   label temp           "Board" 
  • lm-sensors/trunk/kernel/chips/adm1021.c

    r1201 r1535  
    5050 
    5151/* Insmod parameters */ 
    52 SENSORS_INSMOD_7(adm1021, adm1023, max1617, max1617a, thmc10, lm84, gl523sm); 
     52SENSORS_INSMOD_8(adm1021, adm1023, max1617, max1617a, thmc10, lm84, gl523sm, mc1066); 
    5353 
    5454/* adm1021 constants specified below */ 
     
    5959#define ADM1021_REG_REMOTE_TEMP 0x01 
    6060#define ADM1021_REG_STATUS 0x02 
    61 #define ADM1021_REG_MAN_ID 0x0FE        /* 0x41 = AMD, 0x49 = TI, 0x4D = Maxim, 0x23 = Genesys */ 
     61#define ADM1021_REG_MAN_ID 0x0FE        /* 0x41 = AMD, 0x49 = TI, 0x4D = Maxim, 0x23 = Genesys , 0x54 = Onsemi*/ 
    6262#define ADM1021_REG_DEV_ID 0x0FF        /* ADM1021 = 0x0X, ADM1023 = 0x3X */ 
    6363#define ADM1021_REG_DIE_CODE 0x0FF      /* MAX1617A */ 
     
    156156static void adm1021_update_client(struct i2c_client *client); 
    157157 
     158/* (amalysh) read only mode, otherwise any limit's writing confuse BIOS */ 
     159static int read_only = 0; 
     160 
    158161 
    159162/* This is the driver that will be inserted */ 
     
    281284                        (new_client, ADM1021_REG_CONV_RATE_R) == 0x00) 
    282285                        kind = lm84; 
     286                else if (i == 0x54) 
     287                        kind = mc1066; 
    283288                else 
    284289                        kind = max1617; 
     
    306311                type_name = "gl523sm"; 
    307312                client_name = "GL523SM chip"; 
     313        } else if (kind == mc1066) { 
     314                type_name = "mc1066"; 
     315                client_name = "MC1066 chip"; 
    308316        } else { 
    309317#ifdef DEBUG 
     
    421429int adm1021_write_value(struct i2c_client *client, u8 reg, u16 value) 
    422430{ 
     431        if (read_only > 0) 
     432                return 0; 
     433 
    423434        return i2c_smbus_write_byte_data(client, reg, value); 
    424435} 
     
    642653MODULE_DESCRIPTION("adm1021 driver"); 
    643654 
     655MODULE_PARM(read_only, "i"); 
     656MODULE_PARM_DESC(read_only, "Don't set any values, read only mode"); 
     657 
    644658int init_module(void) 
    645659{ 
  • lm-sensors/trunk/lib/chips.c

    r1502 r1535  
    29952995 { SENSORS_ADM1021_PREFIX, adm1021_features }, 
    29962996 { SENSORS_MAX1617_PREFIX, max1617_features }, 
     2997 { SENSORS_MC1066_PREFIX, max1617_features }, 
    29972998 { SENSORS_MAX1617A_PREFIX, max1617a_features }, 
    29982999                /* Cheat on LM84 for now - no separate #defines */ 
  • lm-sensors/trunk/lib/chips.h

    r1502 r1535  
    188188 
    189189#define SENSORS_MAX1617_PREFIX "max1617" 
     190#define SENSORS_MC1066_PREFIX "mc1066" 
    190191 
    191192#define SENSORS_MAX1617_TEMP 51 /* R */ 
  • lm-sensors/trunk/prog/detect/sensors-detect

    r1533 r1535  
    909909       i2c_addrs => [0x18..0x1a,0x29..0x2b,0x4c..0x4e], 
    910910       i2c_detect => sub { adm1021_detect 5, @_ }, 
     911     }, 
     912     { 
     913       name => "Onsemi MC1066", 
     914       driver => "adm1021", 
     915       i2c_addrs => [0x18..0x1a,0x29..0x2b,0x4c..0x4e], 
     916       i2c_detect => sub { adm1021_detect 6, @_ }, 
    911917     }, 
    912918     { 
     
    22632269 
    22642270# $_[0]: Chip to detect 
    2265 #   (0 = ADM1021, 1 = MAX1617, 2 = MAX1617A, 3 = THMC10, 4 = LM84, 5 = GL523
     2271#   (0 = ADM1021, 1 = MAX1617, 2 = MAX1617A, 3 = THMC10, 4 = LM84, 5 = GL523, 6 = MC1066
    22662272# $_[1]: A reference to the file descriptor to access this chip. 
    22672273#        We may assume an i2c_set_slave_addr was already done. 
     
    22852291  return if $chip == 2 and i2c_smbus_read_byte_data($file,0xfe) != 0x4d and 
    22862292                           i2c_smbus_read_byte_data($file,0xff) != 0x01; 
     2293  return if $chip == 6 and i2c_smbus_read_byte_data($file,0xfe) != 0x54; 
    22872294  # The remaining things are flaky at best. Perhaps something can be done 
    22882295  # with the fact that some registers are unreadable? 
  • lm-sensors/trunk/prog/sensors/main.c

    r1502 r1535  
    302302           !strcmp(name.prefix,"max1617a") || !strcmp(name.prefix, "thmc10") || 
    303303           !strcmp(name.prefix,"lm84") || !strcmp(name.prefix, "gl523") || 
    304            !strcmp(name.prefix, "adm1023")
     304           !strcmp(name.prefix, "adm1023") || !strcmp(name.prefix, "mc1066")
    305305    print_adm1021(&name); 
    306306  else if (!strcmp(name.prefix,"adm9240") ||