Changeset 2367
- Timestamp:
- 03/19/04 19:22:30 (9 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/prog/detect/sensors-detect (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/prog/detect/sensors-detect
r2365 r2367 781 781 saa1064_detect w83l784r_detect mozart_detect max6650_detect 782 782 fscher_detect adm1029_detect adm1031_detect max6900_detect 783 m5879_detect );783 m5879_detect pca9540_detect); 784 784 785 785 # This is a list of all recognized chips. … … 1252 1252 i2c_addrs => [0x38..0x3b], 1253 1253 i2c_detect => sub { saa1064_detect @_ }, 1254 }, 1255 { 1256 name => "Philips Semiconductors PCA9540", 1257 driver => "pca9540", 1258 i2c_addrs => [0x70], 1259 i2c_detect => sub { pca9540_detect @_ }, 1254 1260 }, 1255 1261 { … … 3805 3811 if $status == 0x80; 3806 3812 return 4; 3813 } 3814 3815 # $_[0]: A reference to the file descriptor to access this chip. 3816 # We may assume an i2c_set_slave_addr was already done. 3817 # $_[1]: Address 3818 # Returns: undef if not detected, 1 if detected 3819 # Detection is rather difficult, since the PCA9540 has a single register. 3820 # Fortunately, no other device is known to live at this address. 3821 sub pca9540_detect 3822 { 3823 my ($file, $addr) = @_; 3824 my $reg = i2c_smbus_read_byte($file); 3825 3826 return if ($reg & 0xf7); 3827 return if $reg != i2c_smbus_read_byte($file); 3828 return if $reg != i2c_smbus_read_byte($file); 3829 return if $reg != i2c_smbus_read_byte($file); 3830 3831 return 1; 3807 3832 } 3808 3833
