Changeset 5260
- Timestamp:
- 05/22/08 14:01:33 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/branches/lm-sensors-3.0.0/prog/detect/sensors-detect
r5258 r5260 58 58 # Each entry must have a vendid (Vendor ID), devid (Device ID) and 59 59 # procid (string as appears in /proc/pci; see linux/driver/pci, 60 # either pci.c or oldproc.c). If no driver is written yet, set the 60 # either pci.c or oldproc.c). If no driver is written yet, set the 61 61 # driver (Driver Name) field to "to-be-written". 62 62 # The match (Match Description) field should contain a regular expression 63 63 # matching the adapter name as it would appear in /proc/bus/i2c or /sys. 64 @pci_adapters = ( 65 { 64 @pci_adapters = ( 65 { 66 66 vendid => 0x8086, 67 67 devid => 0x7113, … … 69 69 driver => "i2c-piix4", 70 70 match => qr/^SMBus PIIX4 adapter at /, 71 } ,72 { 71 }, 72 { 73 73 vendid => 0x8086, 74 74 devid => 0x7603, 75 75 procid => "Intel 82372FB PIIX5 ACPI", 76 76 driver => "to-be-tested", 77 } ,78 { 77 }, 78 { 79 79 vendid => 0x8086, 80 80 devid => 0x719b, … … 82 82 driver => "i2c-piix4", 83 83 match => qr/^SMBus PIIX4 adapter at /, 84 } ,85 { 84 }, 85 { 86 86 vendid => 0x8086, 87 87 devid => 0x2413, … … 89 89 driver => "i2c-i801", 90 90 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/, 91 } ,92 { 91 }, 92 { 93 93 vendid => 0x8086, 94 94 devid => 0x2423, … … 96 96 driver => "i2c-i801", 97 97 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/, 98 } ,99 { 98 }, 99 { 100 100 vendid => 0x8086, 101 101 devid => 0x2443, … … 103 103 driver => "i2c-i801", 104 104 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/, 105 } ,106 { 105 }, 106 { 107 107 vendid => 0x8086, 108 108 devid => 0x2483, … … 110 110 driver => "i2c-i801", 111 111 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/, 112 } ,113 { 112 }, 113 { 114 114 vendid => 0x8086, 115 115 devid => 0x24C3, … … 117 117 driver => "i2c-i801", 118 118 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/, 119 } ,120 { 119 }, 120 { 121 121 vendid => 0x8086, 122 122 devid => 0x24D3, … … 124 124 driver => "i2c-i801", 125 125 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/, 126 } ,127 { 126 }, 127 { 128 128 vendid => 0x8086, 129 129 devid => 0x25A4, … … 131 131 driver => "i2c-i801", 132 132 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/, 133 } ,134 { 133 }, 134 { 135 135 vendid => 0x8086, 136 136 devid => 0x269B, … … 145 145 driver => "i2c-i801", 146 146 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/, 147 } ,148 { 147 }, 148 { 149 149 vendid => 0x8086, 150 150 devid => 0x27DA, … … 152 152 driver => "i2c-i801", 153 153 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/, 154 } ,155 { 154 }, 155 { 156 156 vendid => 0x8086, 157 157 devid => 0x283E, … … 159 159 driver => "i2c-i801", 160 160 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/, 161 }, 162 { 161 }, 162 { 163 163 vendid => 0x8086, 164 164 devid => 0x2930, … … 167 167 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/, 168 168 }, 169 { 169 { 170 170 vendid => 0x8086, 171 171 devid => 0x5032, … … 173 173 driver => "i2c-i801", 174 174 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/, 175 }, 175 }, 176 176 { 177 177 vendid => 0x8086, … … 195 195 match => qr/^SMBus SCH adapter at [0-9a-f]{4}/, 196 196 }, 197 { 197 { 198 198 vendid => 0x1106, 199 199 devid => 0x3040, … … 201 201 driver => "i2c-via", 202 202 match => qr/^VIA i2c/, 203 } ,204 { 203 }, 204 { 205 205 vendid => 0x1106, 206 206 devid => 0x3050, … … 208 208 driver => "i2c-viapro", 209 209 match => qr/^SMBus V(IA|ia) Pro adapter at/, 210 } ,211 { 210 }, 211 { 212 212 vendid => 0x1106, 213 213 devid => 0x3051, … … 215 215 driver => "i2c-viapro", 216 216 match => qr/^SMBus V(IA|ia) Pro adapter at/, 217 } ,218 { 217 }, 218 { 219 219 vendid => 0x1106, 220 220 devid => 0x3057, … … 222 222 driver => "i2c-viapro", 223 223 match => qr/^SMBus V(IA|ia) Pro adapter at/, 224 } ,225 { 224 }, 225 { 226 226 vendid => 0x1106, 227 227 devid => 0x3074, … … 229 229 driver => "i2c-viapro", 230 230 match => qr/^SMBus V(IA|ia) Pro adapter at/, 231 } ,232 { 231 }, 232 { 233 233 vendid => 0x1106, 234 234 devid => 0x3147, … … 236 236 driver => "i2c-viapro", 237 237 match => qr/^SMBus V(IA|ia) Pro adapter at/, 238 } ,239 { 238 }, 239 { 240 240 vendid => 0x1106, 241 241 devid => 0x3177, … … 243 243 driver => "i2c-viapro", 244 244 match => qr/^SMBus V(IA|ia) Pro adapter at/, 245 } ,245 }, 246 246 { 247 247 vendid => 0x1106, … … 250 250 driver => "i2c-viapro", 251 251 match => qr/^SMBus V(IA|ia) Pro adapter at/, 252 } ,252 }, 253 253 { 254 254 vendid => 0x1106, … … 257 257 driver => "i2c-viapro", 258 258 match => qr/^SMBus V(IA|ia) Pro adapter at/, 259 } ,260 { 259 }, 260 { 261 261 vendid => 0x1106, 262 262 devid => 0x8235, … … 264 264 driver => "i2c-viapro", 265 265 match => qr/^SMBus V(IA|ia) Pro adapter at/, 266 } ,267 { 266 }, 267 { 268 268 vendid => 0x1106, 269 269 devid => 0x3287, … … 271 271 driver => "i2c-viapro", 272 272 match => qr/^SMBus V(IA|ia) Pro adapter at/, 273 } ,273 }, 274 274 { 275 275 vendid => 0x1106, … … 284 284 procid => "Silicon Integrated Systems SIS5581/5582/5597/5598 (To be written - Do not use 5595 drivers)", 285 285 driver => "to-be-written", 286 } ,286 }, 287 287 { 288 288 vendid => 0x1039, … … 290 290 procid => "Silicon Integrated Systems SIS5598 (To be written - Do not use 5595 drivers)", 291 291 driver => "to-be-written", 292 } ,292 }, 293 293 { 294 294 vendid => 0x1039, … … 296 296 procid => "Silicon Integrated Systems SIS540 (To be written - Do not use 5595 drivers)", 297 297 driver => "to-be-written", 298 } ,298 }, 299 299 { 300 300 vendid => 0x1039, … … 303 303 driver => "i2c-sis630", 304 304 match => qr/^SMBus SIS630 adapter at [0-9a-f]{4}/, 305 } ,305 }, 306 306 { 307 307 vendid => 0x1039, … … 310 310 driver => "i2c-sis630", 311 311 match => qr/^SMBus SIS630 adapter at [0-9a-f]{4}/, 312 } ,312 }, 313 313 # 314 314 # Both Ali chips below have same PCI ID. Can't be helped. Only one should load. … … 335 335 match => qr/^SMBus ALi 1563 Adapter @/, 336 336 }, 337 { 337 { 338 338 vendid => 0x1022, 339 339 devid => 0x740b, … … 342 342 match => qr/^SMBus AMD756 adapter at [0-9a-f]{4}/, 343 343 }, 344 { 344 { 345 345 vendid => 0x1022, 346 346 devid => 0x7413, … … 349 349 match => qr/^SMBus AMD766 adapter at [0-9a-f]{4}/, 350 350 }, 351 { 351 { 352 352 vendid => 0x1022, 353 353 devid => 0x7443, … … 356 356 match => qr/^SMBus AMD768 adapter at [0-9a-f]{4}/, 357 357 }, 358 { 358 { 359 359 vendid => 0x1022, 360 360 devid => 0x746b, … … 363 363 match => qr/^SMBus AMD8111 adapter at [0-9a-f]{4}/, 364 364 }, 365 { 365 { 366 366 vendid => 0x1022, 367 367 devid => 0x746a, … … 376 376 driver => "i2c-amd756", 377 377 match => qr/^SMBus nVidia nForce adapter at [0-9a-f]{4}/, 378 } ,379 { 378 }, 379 { 380 380 vendid => 0x10de, 381 381 devid => 0x0064, … … 383 383 driver => "i2c-nforce2", 384 384 match => qr/^SMBus nForce2 adapter at /, 385 }, 385 }, 386 386 { 387 387 vendid => 0x10de, … … 390 390 driver => "i2c-nforce2", 391 391 match => qr/^SMBus nForce2 adapter at /, 392 }, 392 }, 393 393 { 394 394 vendid => 0x10de, … … 397 397 driver => "i2c-nforce2", 398 398 match => qr/^SMBus nForce2 adapter at /, 399 }, 399 }, 400 400 { 401 401 vendid => 0x10de, … … 404 404 driver => "i2c-nforce2", 405 405 match => qr/^SMBus nForce2 adapter at /, 406 }, 406 }, 407 407 { 408 408 vendid => 0x10de, … … 411 411 driver => "i2c-nforce2", 412 412 match => qr/^SMBus nForce2 adapter at /, 413 }, 413 }, 414 414 { 415 415 vendid => 0x10de, … … 453 453 driver => "i2c-piix4", 454 454 match => qr/^SMBus PIIX4 adapter at /, 455 } ,456 { 455 }, 456 { 457 457 vendid => 0x1055, 458 458 devid => 0x9463, … … 460 460 driver => "i2c-piix4", 461 461 match => qr/^SMBus PIIX4 adapter at /, 462 } ,463 { 462 }, 463 { 464 464 vendid => 0x1166, 465 465 devid => 0x0201, … … 467 467 driver => "i2c-piix4", 468 468 match => qr/^SMBus PIIX4 adapter at /, 469 } ,470 { 469 }, 470 { 471 471 vendid => 0x1166, 472 472 devid => 0x0203, … … 474 474 driver => "i2c-piix4", 475 475 match => qr/^SMBus PIIX4 adapter at /, 476 } ,476 }, 477 477 { 478 478 vendid => 0x1166, … … 482 482 match => qr/^SMBus PIIX4 adapter at /, 483 483 }, 484 { 484 { 485 485 vendid => 0x1002, 486 486 devid => 0x4353, … … 488 488 driver => "i2c-piix4", 489 489 match => qr/^SMBus PIIX4 adapter at /, 490 } ,491 { 490 }, 491 { 492 492 vendid => 0x1002, 493 493 devid => 0x4363, … … 495 495 driver => "i2c-piix4", 496 496 match => qr/^SMBus PIIX4 adapter at /, 497 } ,498 { 497 }, 498 { 499 499 vendid => 0x1002, 500 500 devid => 0x4372, … … 502 502 driver => "i2c-piix4", 503 503 match => qr/^SMBus PIIX4 adapter at /, 504 } ,505 { 504 }, 505 { 506 506 vendid => 0x1002, 507 507 devid => 0x4385, … … 509 509 driver => "i2c-piix4", 510 510 match => qr/^SMBus PIIX4 adapter at /, 511 } ,511 }, 512 512 { 513 513 vendid => 0x100B, … … 553 553 driver => "i2c-sis5595", 554 554 match => qr/^SMBus SIS5595 adapter at [0-9a-f]{4}/, 555 } ,555 }, 556 556 ); 557 557 … … 563 563 driver => "i2c-sis645", 564 564 match => qr/^SiS645 SMBus adapter at [0-9a-f]{4}/, 565 } ,565 }, 566 566 { 567 567 vendid => 0x1039, … … 570 570 driver => "i2c-sis645", 571 571 match => qr/^SiS645 SMBus adapter at 0x[0-9a-f]{4}/, 572 } ,572 }, 573 573 { 574 574 vendid => 0x1039, … … 577 577 driver => "i2c-sis645", 578 578 match => qr/^SiS645 SMBus adapter at 0x[0-9a-f]{4}/, 579 } ,579 }, 580 580 ); 581 581 … … 587 587 driver => "i2c-sis96x", 588 588 match => qr/^SiS96x SMBus adapter at 0x[0-9a-f]{4}/, 589 } ,589 }, 590 590 ); 591 591 592 # This is a list of all recognized chips. 592 # This is a list of all recognized chips. 593 593 # Each entry must have the following fields: 594 594 # name: The full chip name … … 615 615 name => "Myson MTP008", 616 616 driver => "mtp008", 617 i2c_addrs => [0x2c..0x2e], 617 i2c_addrs => [0x2c..0x2e], 618 618 i2c_detect => sub { mtp008_detect(@_); }, 619 } ,619 }, 620 620 { 621 621 name => "National Semiconductor LM78", 622 622 driver => "lm78", 623 i2c_addrs => [0x28..0x2f], 623 i2c_addrs => [0x28..0x2f], 624 624 i2c_detect => sub { lm78_detect(0, @_); }, 625 625 isa_addrs => [0x290], 626 626 isa_detect => sub { lm78_isa_detect(0, @_); }, 627 627 alias_detect => sub { lm78_alias_detect(0, @_); }, 628 } ,628 }, 629 629 { 630 630 name => "National Semiconductor LM78-J", 631 631 driver => "lm78", 632 i2c_addrs => [0x28..0x2f], 632 i2c_addrs => [0x28..0x2f], 633 633 i2c_detect => sub { lm78_detect(1, @_); }, 634 634 isa_addrs => [0x290], 635 635 isa_detect => sub { lm78_isa_detect(1, @_); }, 636 636 alias_detect => sub { lm78_alias_detect(1, @_); }, 637 } ,637 }, 638 638 { 639 639 name => "National Semiconductor LM79", 640 640 driver => "lm78", 641 i2c_addrs => [0x28..0x2f], 641 i2c_addrs => [0x28..0x2f], 642 642 i2c_detect => sub { lm78_detect(2, @_); }, 643 643 isa_addrs => [0x290], 644 644 isa_detect => sub { lm78_isa_detect(2, @_); }, 645 645 alias_detect => sub { lm78_alias_detect(2, @_); }, 646 } ,646 }, 647 647 { 648 648 name => "National Semiconductor LM75", … … 771 771 driver => "w83781d", 772 772 i2c_detect => sub { w83781d_detect(0, @_); }, 773 i2c_addrs => [0x28..0x2f], 773 i2c_addrs => [0x28..0x2f], 774 774 isa_addrs => [0x290], 775 775 isa_detect => sub { w83781d_isa_detect(0, @_); }, 776 776 alias_detect => sub { w83781d_alias_detect(0, @_); }, 777 } ,777 }, 778 778 { 779 779 name => "Winbond W83782D", 780 780 driver => "w83781d", 781 i2c_addrs => [0x28..0x2f], 781 i2c_addrs => [0x28..0x2f], 782 782 i2c_detect => sub { w83781d_detect(1, @_); }, 783 783 isa_addrs => [0x290], 784 784 isa_detect => sub { w83781d_isa_detect(1, @_); }, 785 785 alias_detect => sub { w83781d_alias_detect(1, @_); }, 786 } ,786 }, 787 787 { 788 788 name => "Winbond W83783S", … … 790 790 i2c_addrs => [0x2d], 791 791 i2c_detect => sub { w83781d_detect(2, @_); }, 792 } ,792 }, 793 793 { 794 794 name => "Winbond W83792D", … … 818 818 name => "Winbond W83627EHF", 819 819 driver => "use-isa-instead", 820 i2c_addrs => [0x28..0x2f], 820 i2c_addrs => [0x28..0x2f], 821 821 i2c_detect => sub { w83781d_detect(9, @_); }, 822 822 }, … … 824 824 name => "Winbond W83627DHG", 825 825 driver => "use-isa-instead", 826 i2c_addrs => [0x28..0x2f], 826 i2c_addrs => [0x28..0x2f], 827 827 i2c_detect => sub { w83781d_detect(10, @_); }, 828 828 }, … … 832 832 i2c_addrs => [0x28..0x2f], 833 833 i2c_detect => sub { w83781d_detect(4, @_); }, 834 } ,834 }, 835 835 { 836 836 name => "Asus AS99127F (rev.2)", … … 838 838 i2c_addrs => [0x28..0x2f], 839 839 i2c_detect => sub { w83781d_detect(5, @_); }, 840 } ,840 }, 841 841 { 842 842 name => "Asus ASB100 Bach", … … 844 844 i2c_addrs => [0x28..0x2f], 845 845 i2c_detect => sub { w83781d_detect(6, @_); }, 846 } ,846 }, 847 847 { 848 848 name => "Asus ASM58 Mozart-2", … … 850 850 i2c_addrs => [0x77], 851 851 i2c_detect => sub { mozart_detect(0, @_); }, 852 } ,852 }, 853 853 { 854 854 name => "Asus AS2K129R Mozart-2", … … 856 856 i2c_addrs => [0x77], 857 857 i2c_detect => sub { mozart_detect(1, @_); }, 858 } ,858 }, 859 859 { 860 860 name => "Asus Mozart-2", … … 862 862 i2c_addrs => [0x77], 863 863 i2c_detect => sub { mozart_detect(2, @_); }, 864 } ,864 }, 865 865 { 866 866 name => "Winbond W83L784R/AR/G", … … 868 868 i2c_addrs => [0x2d], 869 869 i2c_detect => sub { w83l784r_detect(0, @_); }, 870 } ,870 }, 871 871 { 872 872 name => "Winbond W83L785R/G", … … 874 874 i2c_addrs => [0x2d], 875 875 i2c_detect => sub { w83l784r_detect(1, @_); }, 876 } ,876 }, 877 877 { 878 878 name => "Winbond W83L786NR/NG/R/G", … … 884 884 name => "Winbond W83L785TS-S", 885 885 driver => "w83l785ts", 886 i2c_addrs => [0x2e], 886 i2c_addrs => [0x2e], 887 887 i2c_detect => sub { w83l785ts_detect(0, @_); }, 888 } ,888 }, 889 889 { 890 890 name => "Genesys Logic GL518SM Revision 0x00", … … 922 922 i2c_addrs => [0x48..0x4f], 923 923 i2c_detect => sub { ds1621_detect(@_); }, 924 } ,924 }, 925 925 { 926 926 name => "Dallas Semiconductor DS1780", … … 938 938 name => "Analog Devices ADM1026", 939 939 driver => "adm1026", 940 i2c_addrs => [0x2c, 0x2d,0x2e],940 i2c_addrs => [0x2c, 0x2d, 0x2e], 941 941 i2c_detect => sub { adm1026_detect(0, @_); }, 942 942 }, … … 956 956 name => "Analog Devices ADM1021", 957 957 driver => "adm1021", 958 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],958 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 959 959 i2c_detect => sub { adm1021_detect(0, @_); }, 960 960 }, … … 962 962 name => "Analog Devices ADM1021A/ADM1023", 963 963 driver => "adm1021", 964 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],964 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 965 965 i2c_detect => sub { adm1021_detect(1, @_); }, 966 966 }, … … 968 968 name => "Maxim MAX1617", 969 969 driver => "adm1021", 970 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],970 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 971 971 i2c_detect => sub { adm1021_detect(2, @_); }, 972 972 }, … … 974 974 name => "Maxim MAX1617A", 975 975 driver => "adm1021", 976 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],976 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 977 977 i2c_detect => sub { adm1021_detect(3, @_); }, 978 978 }, … … 980 980 name => "Maxim MAX1668", 981 981 driver => "max1668", 982 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],982 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 983 983 i2c_detect => sub { max1668_detect(0, @_); }, 984 984 }, … … 986 986 name => "Maxim MAX1805", 987 987 driver => "max1668", 988 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],988 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 989 989 i2c_detect => sub { max1668_detect(1, @_); }, 990 990 }, … … 992 992 name => "Maxim MAX1989", 993 993 driver => "max1668", 994 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],994 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 995 995 i2c_detect => sub { max1668_detect(2, @_); }, 996 996 }, … … 998 998 name => "Maxim MAX6650/MAX6651", 999 999 driver => "max6650", 1000 i2c_addrs => [0x1b, 0x1f,0x48,0x4b],1000 i2c_addrs => [0x1b, 0x1f, 0x48, 0x4b], 1001 1001 i2c_detect => sub { max6650_detect(0, @_); }, 1002 1002 }, … … 1010 1010 name => "TI THMC10", 1011 1011 driver => "adm1021", 1012 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],1012 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 1013 1013 i2c_detect => sub { adm1021_detect(4, @_); }, 1014 1014 }, … … 1016 1016 name => "National Semiconductor LM84", 1017 1017 driver => "adm1021", 1018 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],1018 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 1019 1019 i2c_detect => sub { adm1021_detect(5, @_); }, 1020 1020 }, … … 1022 1022 name => "Genesys Logic GL523SM", 1023 1023 driver => "adm1021", 1024 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],1024 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 1025 1025 i2c_detect => sub { adm1021_detect(6, @_); }, 1026 1026 }, … … 1028 1028 name => "Onsemi MC1066", 1029 1029 driver => "adm1021", 1030 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],1030 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 1031 1031 i2c_detect => sub { adm1021_detect(7, @_); }, 1032 1032 }, … … 1040 1040 name => "National Semiconductor LM82/LM83", 1041 1041 driver => "lm83", 1042 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],1042 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 1043 1043 i2c_detect => sub { lm83_detect(0, @_); }, 1044 1044 }, … … 1428 1428 1429 1429 1430 # This is a list of all recognized superio chips. 1430 # This is a list of all recognized superio chips. 1431 1431 # Each entry must have the following fields: 1432 1432 # name: The full chip name … … 1798 1798 ], 1799 1799 # Non-standard SMSC detection callback and chip list. These chips differ 1800 # from the standard ones listed above in that the device ID register 1800 # from the standard ones listed above in that the device ID register 1801 1801 # address is 0x0d instead of 0x20 (as specified by the ISA PNP spec). 1802 1802 ns_detect => \&smsc_ns_detect_superio, … … 2097 2097 sub parse_not_to_scan 2098 2098 { 2099 my ($min, $max,$to_parse) = @_;2100 my @ranges = split /\s*, \s*/, $to_parse;2099 my ($min, $max, $to_parse) = @_; 2100 my @ranges = split /\s*, \s*/, $to_parse; 2101 2101 my @res; 2102 2102 my $range; … … 2126 2126 sub any_list_match 2127 2127 { 2128 my ($list1, $list2) = @_;2129 my ($el1, $el2);2128 my ($list1, $list2) = @_; 2129 my ($el1, $el2); 2130 2130 foreach $el1 (@$list1) { 2131 2131 foreach $el2 (@$list2) { … … 2157 2157 sub inb 2158 2158 { 2159 my ($res, $nrchars);2159 my ($res, $nrchars); 2160 2160 sysseek IOPORTS, $_[0], 0 or return -1; 2161 2161 $nrchars = sysread IOPORTS, $res, 1; 2162 2162 return -1 if not defined $nrchars or $nrchars != 1; 2163 $res = unpack "C", $res;2163 $res = unpack "C", $res; 2164 2164 return $res; 2165 2165 } … … 2183 2183 sub isa_read_byte 2184 2184 { 2185 outb $_[0], $_[2];2185 outb $_[0], $_[2]; 2186 2186 return inb $_[1]; 2187 2187 } … … 2194 2194 sub isa_write_byte 2195 2195 { 2196 outb $_[0], $_[2];2197 outb $_[1], $_[3];2196 outb $_[0], $_[2]; 2197 outb $_[1], $_[3]; 2198 2198 } 2199 2199 … … 2233 2233 close INPUTFILE; 2234 2234 } 2235 2235 2236 2236 if (!$use_udev) { 2237 2237 # Try some known default udev db locations, just in case … … 2283 2283 my ($vers, $plvl, $slvl) = @_; 2284 2284 return 1 if ($kernel_version[0] > $vers || 2285 ($kernel_version[0] == $vers && 2286 ($kernel_version[1] > $plvl || 2287 ($kernel_version[1] == $plvl && 2285 ($kernel_version[0] == $vers && 2286 ($kernel_version[1] > $plvl || 2287 ($kernel_version[1] == $plvl && 2288 2288 ($kernel_version[2] >= $slvl))))); 2289 2289 return 0; … … 2391 2391 { 2392 2392 my $device = shift; 2393 2393 2394 2394 my $link = readlink("$device/driver"); 2395 2395 return unless defined $link; … … 2470 2470 $record{vendid} = $vend >> 16; 2471 2471 $record{devid} = $vend & 0xffff; 2472 2472 2473 2473 push @pci_list, \%record; 2474 2474 } … … 2503 2503 2504 2504 # first, determine which driver if any... 2505 if (kernel_version_at_least(2, 6,0)) {2505 if (kernel_version_at_least(2, 6, 0)) { 2506 2506 if (exists $pci_list{"1039:0016"}) { 2507 2507 $driver = "i2c-sis96x"; … … 2509 2509 $driver = "i2c-sis5595"; 2510 2510 } 2511 } elsif (kernel_version_at_least(2, 4,0)) {2511 } elsif (kernel_version_at_least(2, 4, 0)) { 2512 2512 if (exists $pci_list{"1039:0008"}) { 2513 2513 if ((exists $pci_list{"1039:0645"}) || … … 2604 2604 $device->{vendid}, $device->{devid}, pci_busid($device); 2605 2605 } 2606 2606 2607 2607 if (! @res) { 2608 2608 print "Sorry, no supported PCI bus adapters found.\n"; … … 2665 2665 sub i2c_set_slave_addr 2666 2666 { 2667 my ($file, $addr) = @_;2667 my ($file, $addr) = @_; 2668 2668 $addr += 0; # Make sure it's a number not a string 2669 2669 ioctl $file, IOCTL_I2C_SLAVE, $addr or return 0; … … 2671 2671 } 2672 2672 2673 # i2c_smbus_access is based upon the corresponding C function (see 2673 # i2c_smbus_access is based upon the corresponding C function (see 2674 2674 # <linux/i2c-dev.h>). You should not need to call this directly. 2675 2675 # Exact calling conventions are intricate; read i2c-dev.c if you really need … … 2682 2682 # Returns: 0 on failure, 1 on success. 2683 2683 # Note that we need to get back to Integer boundaries through the 'x2' 2684 # in the pack. This is very compiler-dependent; I wish there was some other 2684 # in the pack. This is very compiler-dependent; I wish there was some other 2685 2685 # way to do this. 2686 2686 sub i2c_smbus_access 2687 2687 { 2688 my ($file, $read_write,$command,$size,$data) = @_;2688 my ($file, $read_write, $command, $size, $data) = @_; 2689 2689 my $data_array = pack "C32", @$data; 2690 my $ioctl_data = pack "C2x2Ip", ($read_write, $command,$size,$data_array);2690 my $ioctl_data = pack "C2x2Ip", ($read_write, $command, $size, $data_array); 2691 2691 ioctl $file, IOCTL_I2C_SMBUS, $ioctl_data or return 0; 2692 @{$_[4]} = unpack "C32", $data_array;2692 @{$_[4]} = unpack "C32", $data_array; 2693 2693 return 1; 2694 2694 } … … 2699 2699 sub i2c_smbus_write_quick 2700 2700 { 2701 my ($file, $value) = @_;2701 my ($file, $value) = @_; 2702 2702 my @data; 2703 2703 i2c_smbus_access $file, $value, 0, SMBUS_QUICK, \@data … … 2722 2722 sub i2c_smbus_read_byte_data 2723 2723 { 2724 my ($file, $command) = @_;2724 my ($file, $command) = @_; 2725 2725 my @data; 2726 2726 i2c_smbus_access $file, SMBUS_READ, $command, SMBUS_BYTE_DATA, \@data … … 2728 2728 return $data[0]; 2729 2729 } 2730 2730 2731 2731 # $_[0]: Reference to an opened filehandle 2732 2732 # $_[1]: Command byte (usually register number) … … 2736 2736 # and only start using word reads when there is a good chance that 2737 2737 # the detection will succeed. 2738 # Note: some devices use the wrong endiannes; use swap_bytes to correct for 2738 # Note: some devices use the wrong endiannes; use swap_bytes to correct for 2739 2739 # this. 2740 2740 sub i2c_smbus_read_word_data 2741 2741 { 2742 my ($file, $command) = @_;2742 my ($file, $command) = @_; 2743 2743 my @data; 2744 2744 i2c_smbus_access $file, SMBUS_READ, $command, SMBUS_WORD_DATA, \@data … … 2839 2839 # with field 'i2c_sub_addrs', containing a reference to a list of 2840 2840 # other I2C addresses (if this is an I2C detection) 2841 # with field 'isa_addr' containing the ISA address this chip is on 2841 # with field 'isa_addr' containing the ISA address this chip is on 2842 2842 # (if this is an ISA detection) 2843 2843 # with field 'conf', containing the confidence level of this detection … … 2853 2853 sub add_i2c_to_chips_detected 2854 2854 { 2855 my ($chipdriver, $datahash) = @_;2856 my ($i, $new_detected_ref,$new_misdetected_ref,$detected_ref,$misdetected_ref,2857 $main_entry, $detected_entry,$put_in_detected,@hash_addrs,@entry_addrs,2855 my ($chipdriver, $datahash) = @_; 2856 my ($i, $new_detected_ref, $new_misdetected_ref, $detected_ref, $misdetected_ref, 2857 $main_entry, $detected_entry, $put_in_detected, @hash_addrs, @entry_addrs, 2858 2858 $do_not_add); 2859 2859 … … 2907 2907 # be told to ignore valid addresses). 2908 2908 @hash_addrs = ($datahash->{i2c_addr}); 2909 push @hash_addrs, @{$datahash->{i2c_sub_addrs}} 2909 push @hash_addrs, @{$datahash->{i2c_sub_addrs}} 2910 2910 if exists $datahash->{i2c_sub_addrs}; 2911 2911 foreach $main_entry (@chips_detected) { … … 2918 2918 if ($detected_ref->[$i]->{i2c_devnr} == $datahash->{i2c_devnr} and 2919 2919 any_list_match \@entry_addrs, \@hash_addrs) { 2920 push @$misdetected_ref, $detected_ref->[$i]2920 push @$misdetected_ref, $detected_ref->[$i] 2921 2921 unless $chipdriver eq $main_entry->{driver}; 2922 2922 splice @$detected_ref, $i, 1; … … 2928 2928 push @$new_detected_ref, $datahash; 2929 2929 } else { 2930 # No hard work here 2930 # No hard work here 2931 2931 push @$new_misdetected_ref, $datahash 2932 2932 unless $do_not_add; … … 2942 2942 sub add_isa_to_chips_detected 2943 2943 { 2944 my ($alias_detect, $chipdriver,$datahash) = @_;2945 my ($i, $new_detected_ref,$new_misdetected_ref,$detected_ref,$misdetected_ref,2946 $main_entry, $isalias);2944 my ($alias_detect, $chipdriver, $datahash) = @_; 2945 my ($i, $new_detected_ref, $new_misdetected_ref, $detected_ref, $misdetected_ref, 2946 $main_entry, $isalias); 2947 2947 2948 2948 # First determine where the hash has to be added. … … 2975 2975 next; 2976 2976 binmode FILE; 2977 i2c_set_slave_addr \*FILE, $new_misdetected_ref->[$i]->{i2c_addr} or2977 i2c_set_slave_addr \*FILE, $new_misdetected_ref->[$i]->{i2c_addr} or 2978 2978 print("Can't set I2C address for ", 2979 2979 "$dev_i2c$new_misdetected_ref->[$i]->{i2c_devnr}?!?\n"), 2980 2980 next; 2981 if (&$alias_detect ($datahash->{isa_addr}, \*FILE,2981 if (&$alias_detect ($datahash->{isa_addr}, \*FILE, 2982 2982 $new_misdetected_ref->[$i]->{i2c_addr})) { 2983 2983 $new_misdetected_ref->[$i]->{isa_addr} = $datahash->{isa_addr}; 2984 return $new_misdetected_ref->[$i]; 2984 return $new_misdetected_ref->[$i]; 2985 2985 } 2986 2986 } … … 2997 2997 next; 2998 2998 binmode FILE; 2999 i2c_set_slave_addr \*FILE, $new_detected_ref->[$i]->{i2c_addr} or2999 i2c_set_slave_addr \*FILE, $new_detected_ref->[$i]->{i2c_addr} or 3000 3000 print("Can't set I2C address for ", 3001 3001 "$dev_i2c$new_detected_ref->[$i]->{i2c_devnr}?!?\n"), 3002 3002 next; 3003 if (&$alias_detect ($datahash->{isa_addr}, \*FILE,3003 if (&$alias_detect ($datahash->{isa_addr}, \*FILE, 3004 3004 $new_detected_ref->[$i]->{i2c_addr})) { 3005 3005 $new_detected_ref->[$i]->{isa_addr} = $datahash->{isa_addr}; … … 3027 3027 unless $main_entry->{driver} eq $chipdriver; 3028
