Changeset 1658
- Timestamp:
- 12/01/02 22:30:13 (6 years ago)
- Files:
-
- lm-sensors/trunk/doc/busses/i2c-amd8111 (modified) (1 diff)
- lm-sensors/trunk/kernel/busses/Module.mk (modified) (1 diff)
- lm-sensors/trunk/kernel/busses/i2c-amd8111.c (modified) (7 diffs)
- lm-sensors/trunk/mkpatch/mkpatch.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/trunk/doc/busses/i2c-amd8111
r1656 r1658 46 46 supported by this driver, and the SMBus 1.0 adapter is supported 47 47 by the i2c-amd756 driver. 48 49 The 8111 used with the AMD Hammer. While the module should work either with50 CONFIG_X86 or CONFIG_X86_64, it will only be compiled with CONFIG_X86_6451 (as it was the easiest way to prevent compilation in 2.2 kernels).52 If you would like to compile it for CONFIG_X86, modify kernel/busses/Module.mk.lm-sensors/trunk/kernel/busses/Module.mk
r1656 r1658 41 41 KERNELBUSSESTARGETS += $(MODULE_DIR)/i2c-amd756.o 42 42 endif 43 # Should also work for CONFIG_X86 but this is the easiest way to prevent compilation in 2.2 kernels...44 ifeq ($(shell if grep -q '^CONFIG_X86_64=' $(LINUX)/.config; then echo 1; fi),1)45 43 ifneq ($(shell if grep -q '^CONFIG_I2C_AMD8111=y' $(LINUX)/.config; then echo 1; fi),1) 46 44 KERNELBUSSESTARGETS += $(MODULE_DIR)/i2c-amd8111.o 47 endif48 45 endif 49 46 ifneq ($(shell if grep -q '^CONFIG_I2C_HYDRA=y' $(LINUX)/.config; then echo 1; fi),1) lm-sensors/trunk/kernel/busses/i2c-amd8111.c
r1656 r1658 26 26 #endif 27 27 28 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) 29 #define min_t(t, x, y) (((x)<(y))?(x):(y)) 30 #define __devinit 31 #define __devexit 32 #define __devinitdata 33 struct pci_device_id { 34 unsigned int vendor, device; 35 unsigned int subvendor, subdevice; 36 unsigned int class, class_mask; 37 unsigned long driver_data; 38 }; 39 struct pci_driver { 40 struct list_head node; 41 char *name; 42 const struct pci_device_id *id_table; 43 int (*probe)(struct pci_dev *dev, const struct pci_device_id *id); 44 void (*remove)(struct pci_dev *dev); 45 }; 46 #define PCI_ANY_ID 0xffff 47 #define IORESOURCE_IO 0x00000100 48 #endif 49 50 #ifdef MODULE_LICENSE 28 51 MODULE_LICENSE("GPL"); 52 #endif 29 53 MODULE_AUTHOR ("Vojtech Pavlik <vojtech@suse.cz>"); 30 54 MODULE_DESCRIPTION("AMD8111 SMBus 2.0 driver"); … … 360 384 return -1; 361 385 362 if (!(smbus = kmalloc(sizeof(struct amd_smbus), GFP_KERNEL)))386 if (!(smbus = (void*)kmalloc(sizeof(struct amd_smbus), GFP_KERNEL))) 363 387 return -1; 364 388 memset(smbus, 0, sizeof(struct amd_smbus)); … … 369 393 smbus->size = pci_resource_len(dev, 0); 370 394 395 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,14) 371 396 if (!request_region(smbus->base, smbus->size, "amd8111 SMBus 2.0")) { 372 397 kfree(smbus); 373 398 return -1; 374 399 } 400 #else 401 if (check_region(smbus->base, smbus->size) < 0) { 402 kfree(smbus); 403 return -1; 404 } 405 request_region(smbus->base, smbus->size, "amd8111 SMBus 2.0"); 406 #endif 375 407 376 408 sprintf(smbus->adapter.name, "SMBus2 AMD8111 adapter at %04x", smbus->base); … … 390 422 pci_write_config_dword(smbus->dev, AMD_PCI_MISC, 0); 391 423 424 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) 425 printk(KERN_INFO "i2c-amd8111.c: AMD8111 SMBus 2.0 adapter at %#x\n", smbus->base); 426 #else 392 427 printk(KERN_INFO "i2c-amd8111.c: AMD8111 SMBus 2.0 adapter at pci%s\n", dev->slot_name); 428 #endif 393 429 return 0; 394 430 } … … 396 432 static void __devexit amd8111_remove(struct pci_dev *dev) 397 433 { 398 struct amd_smbus *smbus = pci_get_drvdata(dev);434 struct amd_smbus *smbus = (void*) pci_get_drvdata(dev); 399 435 if (i2c_del_adapter(&smbus->adapter)) { 400 436 printk(KERN_WARNING "i2c-amd8111.c: Failed to unregister adapter.\n"); … … 408 444 {{ 0x1022, 0x746a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 409 445 { 0 }}; 446 447 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) 448 449 static struct pci_dev *amd8111_devs[8] = { NULL, /* ... */ }; 450 static int amd8111_devcnt = 0; 451 452 int i2c_amd_8111_init(void) 453 { 454 struct pci_dev *pci; 455 struct pci_device_id *id; 456 int found = 0; 457 458 for (id = amd8111_id_table; id->vendor; id++) { 459 pci = NULL; 460 while ((pci = pci_find_device(id->vendor, id->device, pci))) 461 if (amd8111_devcnt < 8 && !amd8111_probe(pci, id)) 462 amd8111_devs[amd8111_devcnt++] = pci; 463 } 464 465 return found ? 0 : -ENODEV; 466 } 467 468 #ifdef MODULE 469 int init_module(void) 470 { 471 return i2c_amd8111_init(); 472 } 473 474 int cleanup_module(void) 475 { 476 int i; 477 for (i = 0; i < amd8111_devcnt; i++) 478 amd8111_remove(amd8111_devs[i]); 479 } 480 #endif 481 482 #else 410 483 411 484 static struct pci_driver amd8111_driver = { … … 428 501 module_init(amd8111_init); 429 502 module_exit(amd8111_exit); 503 504 #endif lm-sensors/trunk/mkpatch/mkpatch.pl
r1631 r1658 80 80 m@Acer Labs ALI 1535@ or 81 81 m@Acer Labs ALI 1533 and 1543C@ or 82 m@AMD 756/766@ or 82 m@AMD 756/766/768/8111@ or 83 m@AMD 8111 SMBus 2.0@ or 83 84 m@Apple Hydra Mac I/O@ or 84 85 m@Intel I801@ or … … 143 144 is running. 144 145 145 AMD 756/766/768 146 AMD 756/766/768/8111 146 147 CONFIG_I2C_AMD756 147 148 If you say yes to this option, support will be included for the AMD 148 756/766/768 mainboard I2C interfaces. This can also be 149 756/766/768/8111 mainboard I2C interfaces. This can also be 150 built as a module which can be inserted and removed while the kernel 151 is running. 152 153 AMD 8111 SMBus 2.0 154 CONFIG_I2C_AMD8111 155 If you say yes to this option, support will be included for the AMD 156 8111 mainboard SMBus 2.0 interface. This can also be 149 157 built as a module which can be inserted and removed while the kernel 150 158 is running. … … 801 809 dep_tristate ' Acer Labs ALI 1533 and 1543C' CONFIG_I2C_ALI15X3 $CONFIG_I2C 802 810 dep_tristate ' Apple Hydra Mac I/O' CONFIG_I2C_HYDRA $CONFIG_I2C_ALGOBIT 803 dep_tristate ' AMD 756/766/768' CONFIG_I2C_AMD756 $CONFIG_I2C 811 dep_tristate ' AMD 756/766/768/8111' CONFIG_I2C_AMD756 $CONFIG_I2C 812 dep_tristate ' AMD 8111 SMBus 2.0' CONFIG_I2C_AMD8111 $CONFIG_I2C 804 813 dep_tristate ' DEC Tsunami I2C interface' CONFIG_I2C_TSUNAMI $CONFIG_I2C_ALGOBIT $CONFIG_ALPHA 805 814 dep_tristate ' Intel 82801AA, AB, BA, DB' CONFIG_I2C_I801 $CONFIG_I2C … … 1173 1182 obj-$(CONFIG_I2C_ALI15X3) += i2c-ali15x3.o 1174 1183 obj-$(CONFIG_I2C_AMD756) += i2c-amd756.o 1184 obj-$(CONFIG_I2C_AMD8111) += i2c-amd8111.o 1175 1185 obj-$(CONFIG_I2C_HYDRA) += i2c-hydra.o 1176 1186 obj-$(CONFIG_I2C_I801) += i2c-i801.o … … 1214 1224 endif 1215 1225 1226 ifeq ($(CONFIG_I2C_AMD8111),y) 1227 L_OBJS += i2c-amd8111.o 1228 else 1229 ifeq ($(CONFIG_I2C_AMD8111),m) 1230 M_OBJS += i2c-amd8111.o 1231 endif 1232 endif 1233 1216 1234 ifeq ($(CONFIG_I2C_HYDRA),y) 1217 1235 L_OBJS += i2c-hydra.o … … 1364 1382 extern int i2c_amd756_init(void); 1365 1383 #endif 1384 #ifdef CONFIG_I2C_AMD8111 1385 extern int i2c_amd8111_init(void); 1386 #endif 1366 1387 #ifdef CONFIG_I2C_HYDRA 1367 1388 extern int i2c_hydra_init(void); … … 1414 1435 #ifdef CONFIG_I2C_AMD756 1415 1436 i2c_amd756_init(); 1437 #endif 1438 #ifdef CONFIG_I2C_AMD8111 1439 i2c_amd8111_init(); 1416 1440 #endif 1417 1441 #ifdef CONFIG_I2C_HYDRA
