Changeset 4214

Show
Ignore:
Timestamp:
10/15/06 21:26:10 (2 years ago)
Author:
ruik
Message:

Add the coretemp driver userspace support.

Files:

Legend:

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

    r4213 r4214  
    66           Probe for busses before chips 
    77           Drop support for algorithm names 
     8           Add support for coretemp driver    
    89  Man page i2cdetect.8: Describe the output convention 
    910  Man page sensors.1: Update (option -c) and clean up 
     
    1718  Program sensors-detect: Add SMSC DME1737 detection 
    1819                          Add EPoX EP1308 detection (Hans Edgington) 
     20                          Add Intel Core thermal sensor detection 
    1921 
    20222.10.1 (20060924) 
  • lm-sensors/trunk/lib/chips.c

    r4196 r4214  
    60296029  }; 
    60306030 
     6031static sensors_chip_feature coretemp_features[] = 
     6032  { 
     6033    { SENSORS_CORETEMP_TEMP1, "temp1", NOMAP, NOMAP, 
     6034                       R, NOSYSCTL, VALUE(2), 0 }, 
     6035    { SENSORS_CORETEMP_TEMP1_CRIT, "temp1_crit", SENSORS_CORETEMP_TEMP1, 
     6036                       SENSORS_CORETEMP_TEMP1, R, NOSYSCTL, VALUE(1), 0 }, 
     6037    { SENSORS_CORETEMP_TEMP1_CRIT_ALARM, "temp1_crit_alarm", SENSORS_CORETEMP_TEMP1, 
     6038                       NOMAP, R, NOSYSCTL, VALUE(1), 0 }, 
     6039    { 0 } 
     6040  }; 
    60316041 
    60326042sensors_chip_features sensors_chip_features_list[] = 
     
    61376147 { SENSORS_ABITUGURU_PREFIX, abituguru_features }, 
    61386148 { SENSORS_K8TEMP_PREFIX, k8temp_features }, 
     6149 { SENSORS_CORETEMP_PREFIX, coretemp_features }, 
    61396150 { 0 } 
    61406151}; 
  • lm-sensors/trunk/lib/chips.h

    r4196 r4214  
    22252225#define SENSORS_K8TEMP_TEMP4    0x04 /* R */ 
    22262226 
     2227/* coretemp */ 
     2228 
     2229#define SENSORS_CORETEMP_PREFIX "coretemp" 
     2230#define SENSORS_CORETEMP_TEMP1                  0x01 /* R */ 
     2231#define SENSORS_CORETEMP_TEMP1_CRIT             0x02 /* R */ 
     2232#define SENSORS_CORETEMP_TEMP1_CRIT_ALARM       0x03 /* R */ 
     2233 
    22272234#endif /* def LIB_SENSORS_CHIPS_H */ 
  • lm-sensors/trunk/prog/detect/sensors-detect

    r4211 r4214  
    18491849    detect => sub { k8temp_pci_detect(); }, 
    18501850  }, 
     1851  { 
     1852    name => "Intel Core family thermal sensor", 
     1853    driver => "coretemp", 
     1854    detect => sub { coretemp_detect(); }, 
     1855  }, 
    18511856); 
    18521857 
     
    51255130} 
    51265131 
     5132# Returns: undef if not detected, (9) if detected. 
     5133sub coretemp_detect 
     5134{ 
     5135        my $probecpu; 
     5136        foreach $probecpu (@cpu) { 
     5137                if ($probecpu->{'vendor_id'} eq 'GenuineIntel' &&  
     5138                                $probecpu->{'cpu family'} == 6 && 
     5139                                ($probecpu->{'model'} == 14 || 
     5140                                 $probecpu->{'model'} == 15)) { 
     5141                        return 9; 
     5142                } 
     5143        } 
     5144        return; 
     5145} 
    51275146 
    51285147################ 
  • lm-sensors/trunk/prog/sensors/chips.c

    r4199 r4214  
    62356235} 
    62366236 
     6237void print_coretemp(const sensors_chip_name *name) 
     6238{ 
     6239  char *label; 
     6240  double cur, over, alarm; 
     6241  int valid; 
     6242 
     6243  if (!sensors_get_label_and_valid(*name, SENSORS_CORETEMP_TEMP1, &label, &valid) 
     6244   && !sensors_get_feature(*name, SENSORS_CORETEMP_TEMP1, &cur) 
     6245   && !sensors_get_feature(*name, SENSORS_CORETEMP_TEMP1_CRIT_ALARM, &alarm) 
     6246   && !sensors_get_feature(*name, SENSORS_CORETEMP_TEMP1_CRIT, &over)) { 
     6247    if (valid) { 
     6248      print_label(label, 10); 
     6249      print_temp_info(cur, over, 0, MAXONLY, 0, 0); 
     6250      printf(" %s\n", alarm ? "ALARM" : ""); 
     6251    } 
     6252  } else 
     6253    printf("ERROR: Can't get temperature data!\n"); 
     6254  free(label); 
     6255} 
    62376256 
    62386257void print_unknown_chip(const sensors_chip_name *name) 
  • lm-sensors/trunk/prog/sensors/chips.h

    r4196 r4214  
    7777extern void print_abituguru(const sensors_chip_name *name); 
    7878extern void print_k8temp(const sensors_chip_name *name); 
     79extern void print_coretemp(const sensors_chip_name *name); 
    7980 
    8081#endif /* def PROG_SENSORS_CHIPS_H */ 
  • lm-sensors/trunk/prog/sensors/main.c

    r4207 r4214  
    419419        { "abituguru", print_abituguru }, 
    420420        { "k8temp", print_k8temp }, 
     421        { "coretemp", print_coretemp }, 
    421422        { NULL, NULL } 
    422423};