Changeset 5449
- Timestamp:
- 11/27/08 22:46:01 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/branches/lm-sensors-3.0.0/prog/detect/sensors-detect
r5448 r5449 2269 2269 next unless m/^i2c-(\d+)$/; 2270 2270 $entry = {}; # New entry 2271 $entry->{ 'name'} = sysfs_device_attribute("${class_dir}/i2c-$1", "name")2272 || sysfs_device_attribute("${class_dir}/i2c-$1/device", "name");2273 next if $entry->{ 'name'} eq "ISA main adapter";2271 $entry->{name} = sysfs_device_attribute("${class_dir}/i2c-$1", "name") 2272 || sysfs_device_attribute("${class_dir}/i2c-$1/device", "name"); 2273 next if $entry->{name} eq "ISA main adapter"; 2274 2274 2275 2275 # First try to get the I2C adapter driver name from sysfs, and if it 2276 2276 # fails, fall back to searching our list of known I2C adapters. 2277 $entry->{ 'driver'} = sysfs_device_driver("${class_dir}/i2c-$1/device")2278 || find_i2c_adapter_driver($entry->{'name'})2279 || 'UNKNOWN';2277 $entry->{driver} = sysfs_device_driver("${class_dir}/i2c-$1/device") 2278 || find_i2c_adapter_driver($entry->{name}) 2279 || 'UNKNOWN'; 2280 2280 $i2c_adapters[$1] = $entry; 2281 2281 } … … 2447 2447 2448 2448 # first, determine which driver if any... 2449 if (exists $pci_list{ "1039:0016"}) {2449 if (exists $pci_list{'1039:0016'}) { 2450 2450 $driver = "i2c-sis96x"; 2451 } elsif (exists $pci_list{ "1039:0008"}) {2451 } elsif (exists $pci_list{'1039:0008'}) { 2452 2452 $driver = "i2c-sis5595"; 2453 2453 } … … 2920 2920 2921 2921 foreach my $chip (@chip_ids) { 2922 next unless defined $chip->{ 'i2c_addrs'};2923 next if $chip->{ 'driver'} eq 'not-a-sensor';2924 foreach $addr (@{$chip->{ 'i2c_addrs'}}) {2922 next unless defined $chip->{i2c_addrs}; 2923 next if $chip->{driver} eq 'not-a-sensor'; 2924 foreach $addr (@{$chip->{i2c_addrs}}) { 2925 2925 $used[$addr]++; 2926 2926 } … … 5067 5067 my $probecpu; 5068 5068 foreach $probecpu (@cpu) { 5069 if ($probecpu->{ 'vendor_id'} eq 'GenuineIntel' &&5070 $probecpu->{ 'cpu family'} == 6 &&5071 ($probecpu->{ 'model'} == 14 ||5072 $probecpu->{ 'model'} == 15 ||5073 $probecpu->{ 'model'} == 0x16 ||5074 $probecpu->{ 'model'} == 0x17)) {5069 if ($probecpu->{vendor_id} eq 'GenuineIntel' && 5070 $probecpu->{cpu_family} == 6 && 5071 ($probecpu->{model} == 14 || 5072 $probecpu->{model} == 15 || 5073 $probecpu->{model} == 0x16 || 5074 $probecpu->{model} == 0x17)) { 5075 5075 return 9; 5076 5076 } … … 5084 5084 my $probecpu; 5085 5085 foreach $probecpu (@cpu) { 5086 if ($probecpu->{ 'vendor_id'} eq 'CentaurHauls' &&5087 $probecpu->{ 'cpu family'} == 6 &&5088 ($probecpu->{ 'model'} == 0xa ||5089 $probecpu->{ 'model'} == 0xd)) {5086 if ($probecpu->{vendor_id} eq 'CentaurHauls' && 5087 $probecpu->{cpu_family} == 6 && 5088 ($probecpu->{model} == 0xa || 5089 $probecpu->{model} == 0xd)) { 5090 5090 return 9; 5091 5091 } … … 5287 5287 for (my $dev_nr = 0; $dev_nr < @i2c_adapters; $dev_nr++) { 5288 5288 next unless exists $i2c_adapters[$dev_nr]; 5289 my $adap = $i2c_adapters[$dev_nr]->{ 'name'};5289 my $adap = $i2c_adapters[$dev_nr]->{name}; 5290 5290 print "\n"; 5291 5291 print "Next adapter: $adap (i2c-$dev_nr)\n"; … … 5304 5304 @not_to_scan = parse_not_to_scan(0x03, 0x77, $inp2); 5305 5305 } 5306 scan_adapter($dev_nr, $adap, $i2c_adapters[$dev_nr]->{ 'driver'},5306 scan_adapter($dev_nr, $adap, $i2c_adapters[$dev_nr]->{driver}, 5307 5307 \@not_to_scan) unless $inp =~ /^\s*[Nn]/; 5308 5308 }
