Changeset 5680

Show
Ignore:
Timestamp:
03/11/09 22:44:32 (6 years ago)
Author:
khali
Message:

Differentiate between PC8374L and WPCD377I. Both chips have the same
device ID so we use the revision register to differentiate between
them, using custom detection functions.

Location:
lm-sensors/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/CHANGES

    r5677 r5680  
    55  sensors-detect: Add nNidia nForce MCP78S SMBus detection 
    66                  Display Super-I/O address even if LD is disabled 
     7                  Differentiate between PC8374L and WPCD377I 
    78 
    893.1.0 "Happy Birthday Lina" (2009-02-28) 
  • lm-sensors/trunk/prog/detect/sensors-detect

    r5677 r5680  
    11641164#  devid_mask (optional): Bitmask to apply before checking the device ID 
    11651165#  logdev: The logical device containing the sensors 
     1166#  check (optional): A function to refine the detection. Will be passed 
     1167#      the index and data ports as parameters. Must return 1 for a matching 
     1168#      device, 0 otherwise. 
    11661169#  features (optional): Features supported by this device, amongst: 
    11671170#      * FEAT_IN 
     
    11781181@superio_ids_natsemi = ( 
    11791182        { 
    1180                 name => "Nat. Semi. PC8374L Super IO Sensors", 
     1183                name => "Nat. Semi. PC8374L Super IO Sensors",  # Also Nuvoton WPCD374L 
    11811184                driver => "to-be-written", 
    11821185                devid => 0xf1, 
     1186                check => sub { 
     1187                        outb($_[0], 0x27); 
     1188                        # Guess work; seen so far: 0x11 
     1189                        return (inb($_[1]) < 0x80); 
     1190                }, 
    11831191                logdev => 0x08, 
    11841192                features => FEAT_IN | FEAT_FAN | FEAT_TEMP, 
     1193        }, { 
     1194                name => "Nuvoton WPCD377I Super IO",    # Also WPCD376I 
     1195                driver => "not-a-sensor", 
     1196                devid => 0xf1, 
     1197                check => sub { 
     1198                        outb($_[0], 0x27); 
     1199                        # Guess work; seen so far: 0x91 (twice) 
     1200                        return (inb($_[1]) >= 0x80); 
     1201                }, 
    11851202        }, { 
    11861203                name => "Nat. Semi. PC87351 Super IO Fan Sensors", 
     
    32053222        my ($addrreg, $datareg, $chip) = @_; 
    32063223        my ($val, $addr); 
     3224 
     3225        if (exists $chip->{check}) { 
     3226                return 0 unless $chip->{check}($addrreg, $datareg); 
     3227        } 
    32073228 
    32083229        printf "\%-60s", "Found `$chip->{name}'";