Changeset 5408
- Timestamp:
- 11/24/08 14:24:00 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/branches/lm-sensors-3.0.0/prog/detect/sensors-detect
r5407 r5408 54 54 # either pci.c or oldproc.c). If no driver is written yet, set the 55 55 # driver (Driver Name) field to "to-be-written". 56 # The match (Match Description) field should contain a regular expression57 # matching the adapter name as it would appear in /sys/class/i2c-adapter.58 56 @pci_adapters = ( 59 57 { … … 62 60 procid => "Intel 82371AB PIIX4 ACPI", 63 61 driver => "i2c-piix4", 64 match => qr/^SMBus PIIX4 adapter at /,65 62 }, 66 63 { … … 75 72 procid => "Intel 82443MX Mobile", 76 73 driver => "i2c-piix4", 77 match => qr/^SMBus PIIX4 adapter at /,78 74 }, 79 75 { … … 82 78 procid => "Intel 82801AA ICH", 83 79 driver => "i2c-i801", 84 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/,85 80 }, 86 81 { … … 89 84 procid => "Intel 82801AB ICH0", 90 85 driver => "i2c-i801", 91 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/,92 86 }, 93 87 { … … 96 90 procid => "Intel 82801BA ICH2", 97 91 driver => "i2c-i801", 98 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/,99 92 }, 100 93 { … … 103 96 procid => "Intel 82801CA/CAM ICH3", 104 97 driver => "i2c-i801", 105 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/,106 98 }, 107 99 { … … 110 102 procid => "Intel 82801DB ICH4", 111 103 driver => "i2c-i801", 112 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/,113 104 }, 114 105 { … … 117 108 procid => "Intel 82801EB ICH5", 118 109 driver => "i2c-i801", 119 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/,120 110 }, 121 111 { … … 124 114 procid => "Intel 6300ESB", 125 115 driver => "i2c-i801", 126 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/,127 116 }, 128 117 { … … 131 120 procid => "Intel Enterprise Southbridge - ESB2", 132 121 driver => "i2c-i801", 133 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/,134 122 }, 135 123 { … … 138 126 procid => "Intel 82801FB ICH6", 139 127 driver => "i2c-i801", 140 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/,141 128 }, 142 129 { … … 145 132 procid => "Intel 82801G ICH7", 146 133 driver => "i2c-i801", 147 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/,148 134 }, 149 135 { … … 152 138 procid => "Intel 82801H ICH8", 153 139 driver => "i2c-i801", 154 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/,155 140 }, 156 141 { … … 159 144 procid => "Intel ICH9", 160 145 driver => "i2c-i801", 161 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/,162 146 }, 163 147 { … … 166 150 procid => "Intel Tolapai", 167 151 driver => "i2c-i801", 168 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/,169 152 }, 170 153 { … … 173 156 procid => "Intel ICH10", 174 157 driver => "i2c-i801", 175 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/,176 158 }, 177 159 { … … 180 162 procid => "Intel ICH10", 181 163 driver => "i2c-i801", 182 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/,183 164 }, 184 165 { … … 187 168 procid => "Intel SCH", 188 169 driver => "i2c-isch", 189 match => qr/^SMBus SCH adapter at [0-9a-f]{4}/,190 170 }, 191 171 { … … 194 174 procid => "VIA Technologies VT82C586B Apollo ACPI", 195 175 driver => "i2c-via", 196 match => qr/^VIA i2c/,197 176 }, 198 177 { … … 201 180 procid => "VIA Technologies VT82C596 Apollo ACPI", 202 181 driver => "i2c-viapro", 203 match => qr/^SMBus V(IA|ia) Pro adapter at/,204 182 }, 205 183 { … … 208 186 procid => "VIA Technologies VT82C596B ACPI", 209 187 driver => "i2c-viapro", 210 match => qr/^SMBus V(IA|ia) Pro adapter at/,211 188 }, 212 189 { … … 215 192 procid => "VIA Technologies VT82C686 Apollo ACPI", 216 193 driver => "i2c-viapro", 217 match => qr/^SMBus V(IA|ia) Pro adapter at/,218 194 }, 219 195 { … … 222 198 procid => "VIA Technologies VT8233 VLink South Bridge", 223 199 driver => "i2c-viapro", 224 match => qr/^SMBus V(IA|ia) Pro adapter at/,225 200 }, 226 201 { … … 229 204 procid => "VIA Technologies VT8233A South Bridge", 230 205 driver => "i2c-viapro", 231 match => qr/^SMBus V(IA|ia) Pro adapter at/,232 206 }, 233 207 { … … 236 210 procid => "VIA Technologies VT8233A/8235 South Bridge", 237 211 driver => "i2c-viapro", 238 match => qr/^SMBus V(IA|ia) Pro adapter at/,239 212 }, 240 213 { … … 243 216 procid => "VIA Technologies VT8237 South Bridge", 244 217 driver => "i2c-viapro", 245 match => qr/^SMBus V(IA|ia) Pro adapter at/,246 218 }, 247 219 { … … 250 222 procid => "VIA Technologies VT8237A South Bridge", 251 223 driver => "i2c-viapro", 252 match => qr/^SMBus V(IA|ia) Pro adapter at/,253 224 }, 254 225 { … … 257 228 procid => "VIA Technologies VT8231 South Bridge", 258 229 driver => "i2c-viapro", 259 match => qr/^SMBus V(IA|ia) Pro adapter at/,260 230 }, 261 231 { … … 264 234 procid => "VIA Technologies VT8251 South Bridge", 265 235 driver => "i2c-viapro", 266 match => qr/^SMBus V(IA|ia) Pro adapter at/,267 236 }, 268 237 { … … 271 240 procid => "VIA Technologies CX700 South Bridge", 272 241 driver => "i2c-viapro", 273 match => qr/^SMBus V(IA|ia) Pro adapter at/,274 242 }, 275 243 { … … 278 246 procid => "VIA Technologies VX800/VX820 South Bridge", 279 247 driver => "i2c-viapro", 280 match => qr/^SMBus V(IA|ia) Pro adapter at/,281 248 }, 282 249 { … … 303 270 procid => "Silicon Integrated Systems SIS630", 304 271 driver => "i2c-sis630", 305 match => qr/^SMBus SIS630 adapter at [0-9a-f]{4}/,306 272 }, 307 273 { … … 310 276 procid => "Silicon Integrated Systems SIS730", 311 277 driver => "i2c-sis630", 312 match => qr/^SMBus SIS630 adapter at [0-9a-f]{4}/,313 278 }, 314 279 # … … 320 285 procid => "Acer Labs 1533/1543", 321 286 driver => "i2c-ali15x3", 322 match => qr/^SMBus ALI15X3 adapter at/,323 287 }, 324 288 { … … 327 291 procid => "Acer Labs 1535", 328 292 driver => "i2c-ali1535", 329 match => qr/^SMBus ALI1535 adapter at/,330 293 }, 331 294 { … … 334 297 procid => "Acer Labs 1563", 335 298 driver => "i2c-ali1563", 336 match => qr/^SMBus ALi 1563 Adapter @/,337 299 }, 338 300 { … … 341 303 procid => "AMD-756 Athlon ACPI", 342 304 driver => "i2c-amd756", 343 match => qr/^SMBus AMD756 adapter at [0-9a-f]{4}/,344 305 }, 345 306 { … … 348 309 procid => "AMD-766 Athlon ACPI", 349 310 driver => "i2c-amd756", 350 match => qr/^SMBus AMD766 adapter at [0-9a-f]{4}/,351 311 }, 352 312 { … … 355 315 procid => "AMD-768 System Management", 356 316 driver => "i2c-amd756", 357 match => qr/^SMBus AMD768 adapter at [0-9a-f]{4}/,358 317 }, 359 318 { … … 362 321 procid => "AMD-8111 ACPI", 363 322 driver => "i2c-amd756", 364 match => qr/^SMBus AMD8111 adapter at [0-9a-f]{4}/,365 323 }, 366 324 { … … 369 327 procid => "AMD-8111 SMBus 2.0", 370 328 driver => "i2c-amd8111", 371 match => qr/^SMBus2 AMD8111 adapter at [0-9a-f]{4}/,372 329 }, 373 330 { … … 376 333 procid => "nVidia nForce SMBus", 377 334 driver => "i2c-amd756", 378 match => qr/^SMBus nVidia nForce adapter at [0-9a-f]{4}/,379 335 }, 380 336 { … … 383 339 procid => "nVidia Corporation nForce2 SMBus (MCP)", 384 340 driver => "i2c-nforce2", 385 match => qr/^SMBus nForce2 adapter at /,386 341 }, 387 342 { … … 390 345 procid => "nVidia Corporation nForce2 Ultra 400 SMBus (MCP)", 391 346 driver => "i2c-nforce2", 392 match => qr/^SMBus nForce2 adapter at /,393 347 }, 394 348 { … … 397 351 procid => "nVidia Corporation nForce3 Pro150 SMBus (MCP)", 398 352 driver => "i2c-nforce2", 399 match => qr/^SMBus nForce2 adapter at /,400 353 }, 401 354 { … … 404 357 procid => "nVidia Corporation nForce3 250Gb SMBus (MCP)", 405 358 driver => "i2c-nforce2", 406 match => qr/^SMBus nForce2 adapter at /,407 359 }, 408 360 { … … 411 363 procid => "nVidia Corporation nForce4 SMBus (MCP)", 412 364 driver => "i2c-nforce2", 413 match => qr/^SMBus nForce2 adapter at /,414 365 }, 415 366 { … … 418 369 procid => "nVidia Corporation nForce4 SMBus (MCP-04)", 419 370 driver => "i2c-nforce2", 420 match => qr/^SMBus nForce2 adapter at /,421 371 }, 422 372 { … … 425 375 procid => "nVidia Corporation nForce4 SMBus (MCP51)", 426 376 driver => "i2c-nforce2", 427 match => qr/^SMBus nForce2 adapter at /,428 377 }, 429 378 { … … 432 381 procid => "nVidia Corporation nForce4 SMBus (MCP55)", 433 382 driver => "i2c-nforce2", 434 match => qr/^SMBus nForce2 adapter at /,435 383 }, 436 384 { … … 439 387 procid => "nVidia Corporation nForce4 SMBus (MCP61)", 440 388 driver => "i2c-nforce2", 441 match => qr/^SMBus nForce2 adapter at /,442 389 }, 443 390 { … … 446 393 procid => "nVidia Corporation nForce4 SMBus (MCP65)", 447 394 driver => "i2c-nforce2", 448 match => qr/^SMBus nForce2 adapter at /,449 395 }, 450 396 { … … 453 399 procid => "ServerWorks OSB4 South Bridge", 454 400 driver => "i2c-piix4", 455 match => qr/^SMBus PIIX4 adapter at /,456 401 }, 457 402 { … … 460 405 procid => "SMSC Victory66 South Bridge", 461 406 driver => "i2c-piix4", 462 match => qr/^SMBus PIIX4 adapter at /,463 407 }, 464 408 { … … 467 411 procid => "ServerWorks CSB5 South Bridge", 468 412 driver => "i2c-piix4", 469 match => qr/^SMBus PIIX4 adapter at /,470 413 }, 471 414 { … … 474 417 procid => "ServerWorks CSB6 South Bridge", 475 418 driver => "i2c-piix4", 476 match => qr/^SMBus PIIX4 adapter at /,477 419 }, 478 420 { … … 481 423 procid => "ServerWorks HT-1000 South Bridge", 482 424 driver => "i2c-piix4", 483 match => qr/^SMBus PIIX4 adapter at /,484 425 }, 485 426 { … … 488 429 procid => "ATI Technologies Inc ATI SMBus", 489 430 driver => "i2c-piix4", 490 match => qr/^SMBus PIIX4 adapter at /,491 431 }, 492 432 { … … 495 435 procid => "ATI Technologies Inc ATI SMBus", 496 436 driver => "i2c-piix4", 497 match => qr/^SMBus PIIX4 adapter at /,498 437 }, 499 438 { … … 502 441 procid => "ATI Technologies Inc IXP SB400 SMBus Controller", 503 442 driver => "i2c-piix4", 504 match => qr/^SMBus PIIX4 adapter at /,505 443 }, 506 444 { … … 509 447 procid => "ATI Technologies Inc SB600 SMBus", 510 448 driver => "i2c-piix4", 511 match => qr/^SMBus PIIX4 adapter at /,512 449 }, 513 450 { … … 516 453 procid => "SCx200 Bridge", 517 454 driver => "scx200_acb", 518 match => qr/^(NatSemi SCx200 ACCESS\.bus|SCx200 ACB\d+) /,519 455 }, 520 456 { … … 523 459 procid => "SC1100 Bridge", 524 460 driver => "scx200_acb", 525 match => qr/^(NatSemi SCx200 ACCESS\.bus|SCx200 ACB\d+) /,526 461 }, 527 462 { … … 530 465 procid => "CS5535 ISA bridge", 531 466 driver => "scx200_acb", 532 match => qr/^CS5535 ACB\d+ /,533 467 }, 534 468 { … … 537 471 procid => "CS5536 [Geode companion] ISA", 538 472 driver => "scx200_acb", 539 match => qr/^CS553[56] ACB\d+ /,540 473 }, 541 474 ); … … 553 486 procid => "Silicon Integrated Systems SIS5595", 554 487 driver => "i2c-sis5595", 555 match => qr/^SMBus SIS5595 adapter at [0-9a-f]{4}/,556 488 }, 557 489 ); … … 563 495 procid => "Silicon Integrated Systems SMBus Controller", 564 496 driver => "i2c-sis96x", 565 match => qr/^SiS96x SMBus adapter at 0x[0-9a-f]{4}/, 566 }, 497 }, 498 ); 499 500 # Look-up table to find out an I2C bus' driver based on the bus name. 501 # The match field should contain a regular expression matching the I2C 502 # bus name as it would appear in /sys/class/i2c-adapter. 503 # Note that new drivers probably don't need to be added to this table 504 # if they bind to their device, as we will be able to get the driver name 505 # from sysfs directly. 506 use vars qw(@i2c_adapter_names); 507 @i2c_adapter_names = ( 508 { driver => "i2c-piix4", match => qr/^SMBus PIIX4 adapter at / }, 509 { driver => "i2c-i801", match => qr/^SMBus I801 adapter at / }, 510 { driver => "i2c-via", match => qr/^VIA i2c/ }, 511 { driver => "i2c-viapro", match => qr/^SMBus V(IA|ia) Pro adapter at / }, 512 { driver => "i2c-sis5595", match => qr/^SMBus SIS5595 adapter at / }, 513 { driver => "i2c-sis630", match => qr/^SMBus SIS630 adapter at / }, 514 { driver => "i2c-sis96x", match => qr/^SiS96x SMBus adapter at / }, 515 { driver => "i2c-ali15x3", match => qr/^SMBus ALI15X3 adapter at / }, 516 { driver => "i2c-ali1535", match => qr/^SMBus ALI1535 adapter at/ }, 517 { driver => "i2c-ali1563", match => qr/^SMBus ALi 1563 Adapter @ / }, 518 { driver => "i2c-amd756", match => qr/^SMBus (AMD756|AMD766|AMD768|AMD8111|nVidia nForce) adapter at / }, 519 { driver => "i2c-amd8111", match => qr/^SMBus2 AMD8111 adapter at / }, 520 { driver => "i2c-nforce2", match => qr/^SMBus nForce2 adapter at / }, 521 { driver => "scx200_acb", match => qr/^(NatSemi SCx200 ACCESS\.bus|SCx200 ACB\d+|CS553[56] ACB\d+) / }, 567 522 ); 568 523 … … 2371 2326 # fails, fall back to searching our list of known I2C adapters. 2372 2327 $entry->{'driver'} = sysfs_device_driver("${class_dir}/i2c-$1/device") 2373 || find_adapter_driver($entry->{'name'}); 2328 || find_i2c_adapter_driver($entry->{'name'}) 2329 || 'UNKNOWN'; 2330 print $entry->{'driver'}, "\n"; 2374 2331 $i2c_adapters[$1] = $entry; 2375 2332 } … … 2576 2533 2577 2534 # $_[0]: Adapter description as found in /sys/class/i2c-adapter 2578 sub find_adapter_driver 2579 { 2580 my $adapter; 2581 for $adapter (@pci_adapters) { 2582 return $adapter->{driver} 2583 if (exists $adapter->{match} && $_[0] =~ $adapter->{match}); 2584 } 2585 return "UNKNOWN"; 2535 sub find_i2c_adapter_driver 2536 { 2537 my $name = shift; 2538 my $entry; 2539 2540 foreach $entry (@i2c_adapter_names) { 2541 return $entry->{driver} 2542 if $name =~ $entry->{match}; 2543 } 2586 2544 } 2587 2545
