Changeset 935

Show
Ignore:
Timestamp:
11/27/00 00:07:17 (8 years ago)
Author:
mds
Message:

(mds) add ds1621 driver from Christian Zuckschwerdt (zany@triq.net)

Files:

Legend:

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

    r933 r935  
    2121  Chip modules (all): Update mutex definition (works now for new 2.2 kernels) 
    2222  File sensors.conf.eg: Add mtp008 entries 
    23   Library: Add mtp008 support 
     23  Library: Add ds1621, mtp008 support 
    2424  Module adm1021: Add support for adm1021a / adm1023 
     25  Module ddcmon: allow force and force_ddcmon parameters 
     26  Module ds1621: new 
    2527  Module i2c-ali1535: Enhance error checking and recovery; add mutex 
    26   Module ddcmon: allow force and force_ddcmon parameters 
    2728  Module lm87: update voltage calculations 
    2829  Module mtp008: new 
     
    3031  Module w83781d: fix beep setting via /proc 
    3132  Program mkpatch.pl: more fixes 
    32   Program sensors: Add mtp008 support, add -f (Fahrenheit) option 
    33   Program sensors-detect: Add mtp008 detection 
     33  Program sensors: Add ds1621, mtp008 support, add -f (Fahrenheit) option 
     34  Program sensors-detect: Add ds1621, mtp008 detection 
    3435 
    35362.5.4 (20001012) 
  • lm-sensors/trunk/README

    r909 r935  
    5252                 ADM1023, ADM1025, and ADM9240 
    5353  Asus AS99127F 
    54   Dallas Semiconductor DS1780, DS75, and DS1775 
     54  Dallas Semiconductor DS75, DS1621, DS1775, and DS1780 
    5555  Hewlett Packard Maxilife (several revisions including '99 NBA) 
    5656  Genesys Logic GL518SM (rev 00, 80), GL520SM, GL523SM 
  • lm-sensors/trunk/doc/chips/SUMMARY

    r934 r935  
    5656        ds1780          1       6       2       1 dac   yes     no 
    5757        lm81            1       6       2       1 dac   yes     no 
     58 
     59ds1621 
     60        ds1621          1       -       -       -       yes     no 
    5861 
    5962gl518sm 
  • lm-sensors/trunk/kernel/chips/Module.mk

    r911 r935  
    3737ifneq ($(shell if grep -q '^CONFIG_SENSORS_ADM9240=y' $(LINUX)/.config; then echo 1; fi),1) 
    3838KERNELCHIPSTARGETS += $(MODULE_DIR)/adm9240.o 
     39endif 
     40ifneq ($(shell if grep -q '^CONFIG_SENSORS_DS1621=y' $(LINUX)/.config; then echo 1; fi),1) 
     41KERNELCHIPSTARGETS += $(MODULE_DIR)/ds1621.o 
    3942endif 
    4043ifneq ($(shell if grep -q '^CONFIG_SENSORS_EEPROM=y' $(LINUX)/.config; then echo 1; fi),1) 
  • lm-sensors/trunk/kernel/include/sensors.h

    r909 r935  
    403403#define I2C_DRIVERID_PCF8574 1022 
    404404#define I2C_DRIVERID_MTP008 1023 
     405#define I2C_DRIVERID_DS1621 1024 
    405406 
    406407/* Sysctl IDs */ 
     
    816817#define MTP008_ALARM_TEMP3      0x0200 
    817818 
     819#define DS1621_SYSCTL_TEMP 1200 /* Degrees Celcius * 10 */ 
     820#define DS1621_SYSCTL_ALARMS 2001       /* bitvector */ 
     821#define DS1621_ALARM_TEMP_HIGH 0x40 
     822#define DS1621_ALARM_TEMP_LOW 0x20 
     823#define DS1621_SYSCTL_ENABLE 2002 
     824 
    818825#endif                          /* def SENSORS_SENSORS_H */ 
    819826 
  • lm-sensors/trunk/kernel/sensors.c

    r929 r935  
    923923extern int sensors_adm9024_init(void); 
    924924#endif 
     925#ifdef CONFIG_SENSORS_DS1621 
     926extern int sensors_ds1621_init(void); 
     927#endif 
    925928#ifdef CONFIG_SENSORS_GL518SM 
    926929extern int sensors_gl518sm_init(void); 
     
    957960        sensors_adm9024_init(); 
    958961#endif 
     962#ifdef CONFIG_SENSORS_DS1621 
     963        sensors_ds1621_init(); 
     964#endif 
    959965#ifdef CONFIG_SENSORS_GL518SM 
    960966        sensors_gl518sm_init(); 
  • lm-sensors/trunk/lib/chips.c

    r909 r935  
    19731973  }; 
    19741974 
     1975static sensors_chip_feature ds1621_features[] = 
     1976  { 
     1977    { SENSORS_DS1621_TEMP, "temp", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 
     1978                         SENSORS_MODE_R, DS1621_SYSCTL_TEMP, VALUE(3), 1 }, 
     1979    { SENSORS_DS1621_TEMP_HYST, "temp_hyst", SENSORS_DS1621_TEMP, 
     1980                              SENSORS_DS1621_TEMP, SENSORS_MODE_RW,  
     1981                              DS1621_SYSCTL_TEMP, VALUE(2), 1 }, 
     1982    { SENSORS_DS1621_TEMP_OVER, "temp_over", SENSORS_DS1621_TEMP, 
     1983                              SENSORS_DS1621_TEMP, SENSORS_MODE_RW,  
     1984                              DS1621_SYSCTL_TEMP, VALUE(1), 1 }, 
     1985    { SENSORS_DS1621_ALARMS, "alarms", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 
     1986                           SENSORS_MODE_R, DS1621_SYSCTL_ALARMS, VALUE(1), 0 }, 
     1987    { 0 } 
     1988  }; 
     1989 
    19751990sensors_chip_features sensors_chip_features_list[] = 
    19761991{ 
     
    20152030 { SENSORS_LM87_PREFIX, lm87_features }, 
    20162031 { SENSORS_MTP008_PREFIX, mtp008_features }, 
     2032 { SENSORS_DS1621_PREFIX, ds1621_features }, 
    20172033 { 0 } 
    20182034}; 
  • lm-sensors/trunk/lib/chips.h

    r915 r935  
    902902#define SENSORS_MTP008_BEEP            82 /* RW */ 
    903903 
     904/* DS1621 chips. */ 
     905 
     906#define SENSORS_DS1621_PREFIX "ds1621" 
     907 
     908#define SENSORS_DS1621_TEMP 51 /* R */ 
     909#define SENSORS_DS1621_TEMP_HYST 52 /* RW */ 
     910#define SENSORS_DS1621_TEMP_OVER 53 /* RW */ 
     911#define SENSORS_DS1621_ALARMS 81 /* R */ 
     912 
    904913#endif /* def LIB_SENSORS_CHIPS_H */ 
  • lm-sensors/trunk/prog/detect/sensors-detect

    r909 r935  
    361361            via686a_isa_detect adm1022_detect ltc1710_detect gl525sm_detect 
    362362            lm87_detect ite_detect ite_isa_detect ite_alias_detect 
    363             ddcmonitor_detect); 
     363            ddcmonitor_detect ds1621_detect); 
    364364 
    365365# This is a list of all recognized chips.  
     
    521521       i2c_detect => sub { adm9240_detect 0, @_ } 
    522522     }, 
     523     { 
     524       name => "Dallas Semiconductor DS1621", 
     525       driver => "ds1621", 
     526       i2c_addrs => [0x48..0x4f], 
     527       i2c_detect => sub { ds1621_detect @_}, 
     528     } , 
    523529     { 
    524530       name => "Dallas Semiconductor DS1780", 
     
    15671573} 
    15681574   
     1575# $_[0]: A reference to the file descriptor to access this chip. 
     1576#        We may assume an i2c_set_slave_addr was already done. 
     1577# $_[1]: Address 
     1578# Returns: undef if not detected, (3) if detected, 
     1579#   (6) or (9) if even more bits match.  
     1580# Registers used: 
     1581#   0xAC: Configuration 
     1582# Detection is weak. We check if Bit 3 is set and Bit 2 is clear. 
     1583# The DS1621 will aways have a config like 0x????10??. A even better 
     1584# match would be 0x0??01000. 
     1585sub ds1621_detect 
     1586{ 
     1587  my $i; 
     1588  my ($file,$addr) = @_; 
     1589  my $conf = i2c_smbus_read_byte_data($file,0xAC); 
     1590  return (9) if ($conf & 0x9F) == 0x98; 
     1591  return (6) if ($conf & 0x0F) == 0x08; 
     1592  return (3) if ($conf & 0x0C) == 0x08; 
     1593  return ; 
     1594} 
    15691595 
    15701596# $_[0]: A reference to the file descriptor to access this chip. 
  • lm-sensors/trunk/prog/sensors/chips.c

    r928 r935  
    104104  } 
    105105  return err; 
     106} 
     107 
     108void print_ds1621(const sensors_chip_name *name) 
     109{ 
     110  char *label; 
     111  double cur,hyst,over; 
     112  int alarms, valid; 
     113 
     114  if (!sensors_get_feature(*name,SENSORS_LM78_ALARMS,&cur))  
     115    alarms = cur + 0.5; 
     116  else { 
     117    printf("ERROR: Can't get alarm data!\n"); 
     118    alarms = 0; 
     119  } 
     120 
     121  if (!sensors_get_label_and_valid(*name,SENSORS_DS1621_TEMP,&label,&valid) && 
     122      !sensors_get_feature(*name,SENSORS_DS1621_TEMP,&cur) && 
     123      !sensors_get_feature(*name,SENSORS_DS1621_TEMP_HYST,&hyst) && 
     124      !sensors_get_feature(*name,SENSORS_DS1621_TEMP_OVER,&over))  { 
     125    if (valid) { 
     126      print_label(label,10); 
     127      printf("%6.1f C (high limit: %6.1f C, low limit: %6.1f C)   ", 
     128             cur,over,hyst); 
     129      if (alarms & (DS1621_ALARM_TEMP_HIGH | DS1621_ALARM_TEMP_LOW)) { 
     130        printf("ALARM ("); 
     131        if (alarms & DS1621_ALARM_TEMP_LOW) { 
     132          printf("LOW"); 
     133        } 
     134        if (alarms & DS1621_ALARM_TEMP_HIGH) 
     135          printf("%sHIGH",(alarms & DS1621_ALARM_TEMP_LOW)?",":""); 
     136        printf(")"); 
     137      } 
     138      printf("\n"); 
     139    } 
     140  } else 
     141    printf("ERROR: Can't get temperature data!\n"); 
     142  free_the_label(&label); 
    106143} 
    107144 
  • lm-sensors/trunk/prog/sensors/chips.h

    r909 r935  
    2525extern void print_unknown_chip(const sensors_chip_name *name); 
    2626 
     27extern void print_ds1621(const sensors_chip_name *name); 
    2728extern void print_mtp008(const sensors_chip_name *name); 
    2829extern void print_lm75(const sensors_chip_name *name); 
  • lm-sensors/trunk/prog/sensors/main.c

    r928 r935  
    261261  if (do_unknown) 
    262262    print_unknown_chip(&name); 
     263  else if (!strcmp(name.prefix,"ds1621")) 
     264    print_ds1621(&name); 
    263265  else if (!strcmp(name.prefix,"lm75")) 
    264266    print_lm75(&name);