Changeset 5259
- Timestamp:
- 05/22/08 14:00:52 (6 months ago)
- Files:
-
- lm-sensors/trunk/prog/detect/sensors-detect (modified) (199 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/trunk/prog/detect/sensors-detect
r5250 r5259 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, … … 188 188 match => qr/^SMBus I801 adapter at [0-9a-f]{4}/, 189 189 }, 190 { 190 { 191 191 vendid => 0x1106, 192 192 devid => 0x3040, … … 194 194 driver => "i2c-via", 195 195 match => qr/^VIA i2c/, 196 } ,197 { 196 }, 197 { 198 198 vendid => 0x1106, 199 199 devid => 0x3050, … … 201 201 driver => "i2c-viapro", 202 202 match => qr/^SMBus V(IA|ia) Pro adapter at/, 203 } ,204 { 203 }, 204 { 205 205 vendid => 0x1106, 206 206 devid => 0x3051, … … 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 => 0x3057, … … 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 => 0x3074, … … 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 => 0x3147, … … 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 => 0x3177, … … 236 236 driver => "i2c-viapro", 237 237 match => qr/^SMBus V(IA|ia) Pro adapter at/, 238 } ,238 }, 239 239 { 240 240 vendid => 0x1106, … … 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 } ,253 { 252 }, 253 { 254 254 vendid => 0x1106, 255 255 devid => 0x8235, … … 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 => 0x3287, … … 264 264 driver => "i2c-viapro", 265 265 match => qr/^SMBus V(IA|ia) Pro adapter at/, 266 } ,266 }, 267 267 { 268 268 vendid => 0x1106, … … 277 277 procid => "Silicon Integrated Systems SIS5581/5582/5597/5598 (To be written - Do not use 5595 drivers)", 278 278 driver => "to-be-written", 279 } ,279 }, 280 280 { 281 281 vendid => 0x1039, … … 283 283 procid => "Silicon Integrated Systems SIS5598 (To be written - Do not use 5595 drivers)", 284 284 driver => "to-be-written", 285 } ,285 }, 286 286 { 287 287 vendid => 0x1039, … … 289 289 procid => "Silicon Integrated Systems SIS540 (To be written - Do not use 5595 drivers)", 290 290 driver => "to-be-written", 291 } ,291 }, 292 292 { 293 293 vendid => 0x1039, … … 296 296 driver => "i2c-sis630", 297 297 match => qr/^SMBus SIS630 adapter at [0-9a-f]{4}/, 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 # Both Ali chips below have same PCI ID. Can't be helped. Only one should load. … … 328 328 match => qr/^SMBus ALi 1563 Adapter @/, 329 329 }, 330 { 330 { 331 331 vendid => 0x1022, 332 332 devid => 0x740b, … … 335 335 match => qr/^SMBus AMD756 adapter at [0-9a-f]{4}/, 336 336 }, 337 { 337 { 338 338 vendid => 0x1022, 339 339 devid => 0x7413, … … 342 342 match => qr/^SMBus AMD766 adapter at [0-9a-f]{4}/, 343 343 }, 344 { 344 { 345 345 vendid => 0x1022, 346 346 devid => 0x7443, … … 349 349 match => qr/^SMBus AMD768 adapter at [0-9a-f]{4}/, 350 350 }, 351 { 351 { 352 352 vendid => 0x1022, 353 353 devid => 0x746b, … … 356 356 match => qr/^SMBus AMD8111 adapter at [0-9a-f]{4}/, 357 357 }, 358 { 358 { 359 359 vendid => 0x1022, 360 360 devid => 0x746a, … … 369 369 driver => "i2c-amd756", 370 370 match => qr/^SMBus nVidia nForce adapter at [0-9a-f]{4}/, 371 } ,372 { 371 }, 372 { 373 373 vendid => 0x10de, 374 374 devid => 0x0064, … … 376 376 driver => "i2c-nforce2", 377 377 match => qr/^SMBus nForce2 adapter at /, 378 }, 378 }, 379 379 { 380 380 vendid => 0x10de, … … 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, … … 446 446 driver => "i2c-piix4", 447 447 match => qr/^SMBus PIIX4 adapter at /, 448 } ,449 { 448 }, 449 { 450 450 vendid => 0x1055, 451 451 devid => 0x9463, … … 453 453 driver => "i2c-piix4", 454 454 match => qr/^SMBus PIIX4 adapter at /, 455 } ,456 { 455 }, 456 { 457 457 vendid => 0x1166, 458 458 devid => 0x0201, … … 460 460 driver => "i2c-piix4", 461 461 match => qr/^SMBus PIIX4 adapter at /, 462 } ,463 { 462 }, 463 { 464 464 vendid => 0x1166, 465 465 devid => 0x0203, … … 467 467 driver => "i2c-piix4", 468 468 match => qr/^SMBus PIIX4 adapter at /, 469 } ,469 }, 470 470 { 471 471 vendid => 0x1166, … … 475 475 match => qr/^SMBus PIIX4 adapter at /, 476 476 }, 477 { 477 { 478 478 vendid => 0x1002, 479 479 devid => 0x4353, … … 481 481 driver => "i2c-piix4", 482 482 match => qr/^SMBus PIIX4 adapter at /, 483 } ,484 { 483 }, 484 { 485 485 vendid => 0x1002, 486 486 devid => 0x4363, … … 488 488 driver => "i2c-piix4", 489 489 match => qr/^SMBus PIIX4 adapter at /, 490 } ,491 { 490 }, 491 { 492 492 vendid => 0x1002, 493 493 devid => 0x4372, … … 495 495 driver => "i2c-piix4", 496 496 match => qr/^SMBus PIIX4 adapter at /, 497 } ,498 { 497 }, 498 { 499 499 vendid => 0x1002, 500 500 devid => 0x4385, … … 502 502 driver => "i2c-piix4", 503 503 match => qr/^SMBus PIIX4 adapter at /, 504 } ,504 }, 505 505 { 506 506 vendid => 0x100B, … … 546 546 driver => "i2c-sis5595", 547 547 match => qr/^SMBus SIS5595 adapter at [0-9a-f]{4}/, 548 } ,548 }, 549 549 ); 550 550 … … 556 556 driver => "i2c-sis645", 557 557 match => qr/^SiS645 SMBus adapter at [0-9a-f]{4}/, 558 } ,558 }, 559 559 { 560 560 vendid => 0x1039, … … 563 563 driver => "i2c-sis645", 564 564 match => qr/^SiS645 SMBus adapter at 0x[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 … … 580 580 driver => "i2c-sis96x", 581 581 match => qr/^SiS96x SMBus adapter at 0x[0-9a-f]{4}/, 582 } ,582 }, 583 583 ); 584 584 585 # This is a list of all recognized chips. 585 # This is a list of all recognized chips. 586 586 # Each entry must have the following fields: 587 587 # name: The full chip name … … 608 608 name => "Myson MTP008", 609 609 driver => "mtp008", 610 i2c_addrs => [0x2c..0x2e], 610 i2c_addrs => [0x2c..0x2e], 611 611 i2c_detect => sub { mtp008_detect(@_); }, 612 } ,612 }, 613 613 { 614 614 name => "National Semiconductor LM78", 615 615 driver => "lm78", 616 i2c_addrs => [0x28..0x2f], 616 i2c_addrs => [0x28..0x2f], 617 617 i2c_detect => sub { lm78_detect(0, @_); }, 618 618 isa_addrs => [0x290], 619 619 isa_detect => sub { lm78_isa_detect(0, @_); }, 620 620 alias_detect => sub { lm78_alias_detect(0, @_); }, 621 } ,621 }, 622 622 { 623 623 name => "National Semiconductor LM78-J", 624 624 driver => "lm78", 625 i2c_addrs => [0x28..0x2f], 625 i2c_addrs => [0x28..0x2f], 626 626 i2c_detect => sub { lm78_detect(1, @_); }, 627 627 isa_addrs => [0x290], 628 628 isa_detect => sub { lm78_isa_detect(1, @_); }, 629 629 alias_detect => sub { lm78_alias_detect(1, @_); }, 630 } ,630 }, 631 631 { 632 632 name => "National Semiconductor LM79", 633 633 driver => "lm78", 634 i2c_addrs => [0x28..0x2f], 634 i2c_addrs => [0x28..0x2f], 635 635 i2c_detect => sub { lm78_detect(2, @_); }, 636 636 isa_addrs => [0x290], 637 637 isa_detect => sub { lm78_isa_detect(2, @_); }, 638 638 alias_detect => sub { lm78_alias_detect(2, @_); }, 639 } ,639 }, 640 640 { 641 641 name => "National Semiconductor LM75", … … 764 764 driver => "w83781d", 765 765 i2c_detect => sub { w83781d_detect(0, @_); }, 766 i2c_addrs => [0x28..0x2f], 766 i2c_addrs => [0x28..0x2f], 767 767 isa_addrs => [0x290], 768 768 isa_detect => sub { w83781d_isa_detect(0, @_); }, 769 769 alias_detect => sub { w83781d_alias_detect(0, @_); }, 770 } ,770 }, 771 771 { 772 772 name => "Winbond W83782D", 773 773 driver => "w83781d", 774 i2c_addrs => [0x28..0x2f], 774 i2c_addrs => [0x28..0x2f], 775 775 i2c_detect => sub { w83781d_detect(1, @_); }, 776 776 isa_addrs => [0x290], 777 777 isa_detect => sub { w83781d_isa_detect(1, @_); }, 778 778 alias_detect => sub { w83781d_alias_detect(1, @_); }, 779 } ,779 }, 780 780 { 781 781 name => "Winbond W83783S", … … 783 783 i2c_addrs => [0x2d], 784 784 i2c_detect => sub { w83781d_detect(2, @_); }, 785 } ,785 }, 786 786 { 787 787 name => "Winbond W83792D", … … 811 811 name => "Winbond W83627EHF", 812 812 driver => "use-isa-instead", 813 i2c_addrs => [0x28..0x2f], 813 i2c_addrs => [0x28..0x2f], 814 814 i2c_detect => sub { w83781d_detect(9, @_); }, 815 815 }, … … 817 817 name => "Winbond W83627DHG", 818 818 driver => "use-isa-instead", 819 i2c_addrs => [0x28..0x2f], 819 i2c_addrs => [0x28..0x2f], 820 820 i2c_detect => sub { w83781d_detect(10, @_); }, 821 821 }, … … 825 825 i2c_addrs => [0x28..0x2f], 826 826 i2c_detect => sub { w83781d_detect(4, @_); }, 827 } ,827 }, 828 828 { 829 829 name => "Asus AS99127F (rev.2)", … … 831 831 i2c_addrs => [0x28..0x2f], 832 832 i2c_detect => sub { w83781d_detect(5, @_); }, 833 } ,833 }, 834 834 { 835 835 name => "Asus ASB100 Bach", … … 837 837 i2c_addrs => [0x28..0x2f], 838 838 i2c_detect => sub { w83781d_detect(6, @_); }, 839 } ,839 }, 840 840 { 841 841 name => "Asus ASM58 Mozart-2", … … 843 843 i2c_addrs => [0x77], 844 844 i2c_detect => sub { mozart_detect(0, @_); }, 845 } ,845 }, 846 846 { 847 847 name => "Asus AS2K129R Mozart-2", … … 849 849 i2c_addrs => [0x77], 850 850 i2c_detect => sub { mozart_detect(1, @_); }, 851 } ,851 }, 852 852 { 853 853 name => "Asus Mozart-2", … … 855 855 i2c_addrs => [0x77], 856 856 i2c_detect => sub { mozart_detect(2, @_); }, 857 } ,857 }, 858 858 { 859 859 name => "Winbond W83L784R/AR/G", … … 861 861 i2c_addrs => [0x2d], 862 862 i2c_detect => sub { w83l784r_detect(0, @_); }, 863 } ,863 }, 864 864 { 865 865 name => "Winbond W83L785R/G", … … 867 867 i2c_addrs => [0x2d], 868 868 i2c_detect => sub { w83l784r_detect(1, @_); }, 869 } ,869 }, 870 870 { 871 871 name => "Winbond W83L786NR/NG/R/G", … … 877 877 name => "Winbond W83L785TS-S", 878 878 driver => "w83l785ts", 879 i2c_addrs => [0x2e], 879 i2c_addrs => [0x2e], 880 880 i2c_detect => sub { w83l785ts_detect(0, @_); }, 881 } ,881 }, 882 882 { 883 883 name => "Genesys Logic GL518SM Revision 0x00", … … 915 915 i2c_addrs => [0x48..0x4f], 916 916 i2c_detect => sub { ds1621_detect(@_); }, 917 } ,917 }, 918 918 { 919 919 name => "Dallas Semiconductor DS1780", … … 931 931 name => "Analog Devices ADM1026", 932 932 driver => "adm1026", 933 i2c_addrs => [0x2c, 0x2d,0x2e],933 i2c_addrs => [0x2c, 0x2d, 0x2e], 934 934 i2c_detect => sub { adm1026_detect(0, @_); }, 935 935 }, … … 949 949 name => "Analog Devices ADM1021", 950 950 driver => "adm1021", 951 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],951 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 952 952 i2c_detect => sub { adm1021_detect(0, @_); }, 953 953 }, … … 955 955 name => "Analog Devices ADM1021A/ADM1023", 956 956 driver => "adm1021", 957 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],957 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 958 958 i2c_detect => sub { adm1021_detect(1, @_); }, 959 959 }, … … 961 961 name => "Maxim MAX1617", 962 962 driver => "adm1021", 963 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],963 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 964 964 i2c_detect => sub { adm1021_detect(2, @_); }, 965 965 }, … … 967 967 name => "Maxim MAX1617A", 968 968 driver => "adm1021", 969 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],969 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 970 970 i2c_detect => sub { adm1021_detect(3, @_); }, 971 971 }, … … 973 973 name => "Maxim MAX1668", 974 974 driver => "max1668", 975 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],975 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 976 976 i2c_detect => sub { max1668_detect(0, @_); }, 977 977 }, … … 979 979 name => "Maxim MAX1805", 980 980 driver => "max1668", 981 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],981 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 982 982 i2c_detect => sub { max1668_detect(1, @_); }, 983 983 }, … … 985 985 name => "Maxim MAX1989", 986 986 driver => "max1668", 987 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],987 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 988 988 i2c_detect => sub { max1668_detect(2, @_); }, 989 989 }, … … 991 991 name => "Maxim MAX6650/MAX6651", 992 992 driver => "max6650", 993 i2c_addrs => [0x1b, 0x1f,0x48,0x4b],993 i2c_addrs => [0x1b, 0x1f, 0x48, 0x4b], 994 994 i2c_detect => sub { max6650_detect(0, @_); }, 995 995 }, … … 1003 1003 name => "TI THMC10", 1004 1004 driver => "adm1021", 1005 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],1005 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 1006 1006 i2c_detect => sub { adm1021_detect(4, @_); }, 1007 1007 }, … … 1009 1009 name => "National Semiconductor LM84", 1010 1010 driver => "adm1021", 1011 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],1011 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 1012 1012 i2c_detect => sub { adm1021_detect(5, @_); }, 1013 1013 }, … … 1015 1015 name => "Genesys Logic GL523SM", 1016 1016 driver => "adm1021", 1017 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],1017 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 1018 1018 i2c_detect => sub { adm1021_detect(6, @_); }, 1019 1019 }, … … 1021 1021 name => "Onsemi MC1066", 1022 1022 driver => "adm1021", 1023 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],1023 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 1024 1024 i2c_detect => sub { adm1021_detect(7, @_); }, 1025 1025 }, … … 1033 1033 name => "National Semiconductor LM82/LM83", 1034 1034 driver => "lm83", 1035 i2c_addrs => [0x18..0x1a, 0x29..0x2b,0x4c..0x4e],1035 i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 1036 1036 i2c_detect => sub { lm83_detect(0, @_); }, 1037 1037 }, … … 1421 1421 1422 1422 1423 # This is a list of all recognized superio chips. 1423 # This is a list of all recognized superio chips. 1424 1424 # Each entry must have the following fields: 1425 1425 # name: The full chip name … … 1791 1791 ], 1792 1792 # Non-standard SMSC detection callback and chip list. These chips differ 1793 # from the standard ones listed above in that the device ID register 1793 # from the standard ones listed above in that the device ID register 1794 1794 # address is 0x0d instead of 0x20 (as specified by the ISA PNP spec). 1795 1795 ns_detect => \&smsc_ns_detect_superio, … … 2090 2090 sub parse_not_to_scan 2091 2091 { 2092 my ($min, $max,$to_parse) = @_;2093 my @ranges = split /\s*, \s*/, $to_parse;2092 my ($min, $max, $to_parse) = @_; 2093 my @ranges = split /\s*, \s*/, $to_parse; 2094 2094 my @res; 2095 2095 my $range; … … 2119 2119 sub any_list_match 2120 2120 { 2121 my ($list1, $list2) = @_;2122 my ($el1, $el2);2121 my ($list1, $list2) = @_; 2122 my ($el1, $el2); 2123 2123 foreach $el1 (@$list1) { 2124 2124 foreach $el2 (@$list2) { … … 2150 2150 sub inb 2151 2151 { 2152 my ($res, $nrchars);2152 my ($res, $nrchars); 2153 2153 sysseek IOPORTS, $_[0], 0 or return -1; 2154 2154 $nrchars = sysread IOPORTS, $res, 1; 2155 2155 return -1 if not defined $nrchars or $nrchars != 1; 2156 $res = unpack "C", $res;2156 $res = unpack "C", $res; 2157 2157 return $res; 2158 2158 } … … 2176 2176 sub isa_read_byte 2177 2177 { 2178 outb $_[0], $_[2];2178 outb $_[0], $_[2]; 2179 2179 return inb $_[1]; 2180 2180 } … … 2187 2187 sub isa_write_byte 2188 2188 { 2189 outb $_[0], $_[2];2190 outb $_[1], $_[3];2189 outb $_[0], $_[2]; 2190 outb $_[1], $_[3]; 2191 2191 } 2192 2192 … … 2226 2226 close INPUTFILE; 2227 2227 } 2228 2228 2229 2229 if (!$use_udev) { 2230 2230 # Try some known default udev db locations, just in case … … 2276 2276 my ($vers, $plvl, $slvl) = @_; 2277 2277 return 1 if ($kernel_version[0] > $vers || 2278 ($kernel_version[0] == $vers && 2279 ($kernel_version[1] > $plvl || 2280 ($kernel_version[1] == $plvl && 2278 ($kernel_version[0] == $vers && 2279 ($kernel_version[1] > $plvl || 2280 ($kernel_version[1] == $plvl && 2281 2281 ($kernel_version[2] >= $slvl))))); 2282 2282 return 0; … … 2384 2384 { 2385 2385 my $device = shift; 2386 2386 2387 2387 my $link = readlink("$device/driver"); 2388 2388 return unless defined $link; … … 2463 2463 $record{vendid} = $vend >> 16; 2464 2464 $record{devid} = $vend & 0xffff; 2465 2465 2466 2466 push @pci_list, \%record; 2467 2467 } … … 2496 2496 2497 2497 # first, determine which driver if any... 2498 if (kernel_version_at_least(2, 6,0)) {2498 if (kernel_version_at_least(2, 6, 0)) { 2499 2499 if (exists $pci_list{"1039:0016"}) { 2500 2500 $driver = "i2c-sis96x"; … … 2502 2502 $driver = "i2c-sis5595"; 2503 2503 } 2504 } elsif (kernel_version_at_least(2, 4,0)) {2504 } elsif (kernel_version_at_least(2, 4, 0)) { 2505 2505 if (exists $pci_list{"1039:0008"}) { 2506 2506 if ((exists $pci_list{"1039:0645"}) || … … 2597 2597 $device->{vendid}, $device->{devid}, pci_busid($device); 2598 2598 } 2599 2599 2600 2600 if (! @res) { 2601 2601 print "Sorry, no supported PCI bus adapters found.\n"; … … 2658 2658 sub i2c_set_slave_addr 2659 2659 { 2660 my ($file, $addr) = @_;2660 my ($file, $addr) = @_; 2661 2661 $addr += 0; # Make sure it's a number not a string 2662 2662 ioctl $file, IOCTL_I2C_SLAVE, $addr or return 0; … … 2664 2664 } 2665 2665 2666 # i2c_smbus_access is based upon the corresponding C function (see 2666 # i2c_smbus_access is based upon the corresponding C function (see 2667 2667 # <linux/i2c-dev.h>). You should not need to call this directly. 2668 2668 # Exact calling conventions are intricate; read i2c-dev.c if you really need … … 2675 2675 # Returns: 0 on failure, 1 on success. 2676 2676 # Note that we need to get back to Integer boundaries through the 'x2' 2677 # in the pack. This is very compiler-dependent; I wish there was some other 2677 # in the pack. This is very compiler-dependent; I wish there was some other 2678 2678 # way to do this. 2679 2679 sub i2c_smbus_access 2680 2680 { 2681 my ($file, $read_write,$command,$size,$data) = @_;2681 my ($file, $read_write, $command, $size, $data) = @_; 2682 2682 my $data_array = pack "C32", @$data; 2683 my $ioctl_data = pack "C2x2Ip", ($read_write, $command,$size,$data_array);2683 my $ioctl_data = pack "C2x2Ip", ($read_write, $command, $size, $data_array); 2684 2684 ioctl $file, IOCTL_I2C_SMBUS, $ioctl_data or return 0; 2685 @{$_[4]} = unpack "C32", $data_array;2685 @{$_[4]} = unpack "C32", $data_array; 2686 2686 return 1; 2687 2687 } … … 2692 2692 sub i2c_smbus_write_quick 2693 2693 { 2694 my ($file, $value) = @_;2694 my ($file, $value) = @_; 2695 2695 my @data; 2696 2696 i2c_smbus_access $file, $value, 0, SMBUS_QUICK, \@data … … 2715 2715 sub i2c_smbus_read_byte_data 2716 2716 { 2717 my ($file, $command) = @_;2717 my ($file, $command) = @_; 2718 2718 my @data; 2719 2719 i2c_smbus_access $file, SMBUS_READ, $command, SMBUS_BYTE_DATA, \@data … … 2721 2721 return $data[0]; 2722 2722 } 2723 2723 2724 2724 # $_[0]: Reference to an opened filehandle 2725 2725 # $_[1]: Command byte (usually register number) … … 2729 2729 # and only start using word reads when there is a good chance that 2730 2730 # the detection will succeed. 2731 # Note: some devices use the wrong endiannes; use swap_bytes to correct for 2731 # Note: some devices use the wrong endiannes; use swap_bytes to correct for 2732 2732 # this. 2733 2733 sub i2c_smbus_read_word_data 2734 2734 { 2735 my ($file, $command) = @_;2735 my ($file, $command) = @_; 2736 2736 my @data; 2737 2737 i2c_smbus_access $file, SMBUS_READ, $command, SMBUS_WORD_DATA, \@data … … 2832 2832 # with field 'i2c_sub_addrs', containing a reference to a list of 2833 2833 # other I2C addresses (if this is an I2C detection) 2834 # with field 'isa_addr' containing the ISA address this chip is on 2834 # with field 'isa_addr' containing the ISA address this chip is on 2835 2835 # (if this is an ISA detection) 2836 2836 # with field 'conf', containing the confidence level of this detection … … 2846 2846 sub add_i2c_to_chips_detected 2847 2847 { 2848 my ($chipdriver, $datahash) = @_;2849 my ($i, $new_detected_ref,$new_misdetected_ref,$detected_ref,$misdetected_ref,2850 $main_entry, $detected_entry,$put_in_detected,@hash_addrs,@entry_addrs,2848 my ($chipdriver, $datahash) = @_; 2849 my ($i, $new_detected_ref, $new_misdetected_ref, $detected_ref, $misdetected_ref, 2850 $main_entry, $detected_entry, $put_in_detected, @hash_addrs, @entry_addrs, 2851 2851 $do_not_add); 2852 2852 … … 2900 2900 # be told to ignore valid addresses). 2901 2901 @hash_addrs = ($datahash->{i2c_addr}); 2902 push @hash_addrs, @{$datahash->{i2c_sub_addrs}} 2902 push @hash_addrs, @{$datahash->{i2c_sub_addrs}} 2903 2903 if exists $datahash->{i2c_sub_addrs}; 2904 2904 foreach $main_entry (@chips_detected) { … … 2911 2911 if ($detected_ref->[$i]->{i2c_devnr} == $datahash->{i2c_devnr} and 2912 2912 any_list_match \@entry_addrs, \@hash_addrs) { 2913 push @$misdetected_ref, $detected_ref->[$i]2913 push @$misdetected_ref, $detected_ref->[$i] 2914 2914 unless $chipdriver eq $main_entry->{driver}; 2915 2915 splice @$detected_ref, $i, 1; … … 2921 2921 push @$new_detected_ref, $datahash; 2922 2922 } else { 2923 # No hard work here 2923 # No hard work here 2924 2924 push @$new_misdetected_ref, $datahash 2925 2925 unless $do_not_add; … … 2935 2935 sub add_isa_to_chips_detected 2936 2936 { 2937 my ($alias_detect, $chipdriver,$datahash) = @_;2938 my ($i, $new_detected_ref,$new_misdetected_ref,$detected_ref,$misdetected_ref,2939 $main_entry, $isalias);2937 my ($alias_detect, $chipdriver, $datahash) = @_; 2938 my ($i, $new_detected_ref, $new_misdetected_ref, $detected_ref, $misdetected_ref, 2939 $main_entry, $isalias); 2940 2940 2941 2941 # First determine where the hash has to be added. … … 2968 2968 next; 2969 2969 binmode FILE; 2970 i2c_set_slave_addr \*FILE, $new_misdetected_ref->[$i]->{i2c_addr} or2970 i2c_set_slave_addr \*FILE, $new_misdetected_ref->[$i]->{i2c_addr} or 2971 2971 print("Can't set I2C address for ", 2972 2972 "$dev_i2c$new_misdetected_ref->[$i]->{i2c_devnr}?!?\n"), 2973 2973 next; 2974 if (&$alias_detect ($datahash->{isa_addr}, \*FILE,2974 if (&$alias_detect ($datahash->{isa_addr}, \*FILE, 2975 2975 $new_misdetected_ref->[$i]->{i2c_addr})) { 2976 2976 $new_misdetected_ref->[$i]->{isa_addr} = $datahash->{isa_addr}; 2977 return $new_misdetected_ref->[$i]; 2977 return $new_misdetected_ref->[$i]; 2978 2978 } 2979 2979 } … … 2990 2990 next; 2991 2991 binmode FILE; 2992 i2c_set_slave_addr \*FILE, $new_detected_ref->[$i]->{i2c_addr} or2992 i2c_set_slave_addr \*FILE, $new_detected_ref->[$i]->{i2c_addr} or 2993 2993 print("Can't set I2C address for ", 2994 2994 "$dev_i2c$new_detected_ref->[$i]->{i2c_devnr}?!?\n"), 2995 2995 next; 2996 if (&$alias_detect ($datahash->{isa_addr}, \*FILE,2996 if (&$alias_detect ($datahash->{isa_addr}, \*FILE, 2997 2997 $new_detected_ref->[$i]->{i2c_addr})) { 2998 2998 $new_detected_ref->[$i]->{isa_addr} = $datahash->{isa_addr}; … … 3020 3020 unless $main_entry->{driver} eq $chipdriver; 3021 3021 } else { 3022
