diff options
Diffstat (limited to 'drivers/i2c/busses')
36 files changed, 80 insertions, 73 deletions
diff --git a/drivers/i2c/busses/i2c-ali1535.c b/drivers/i2c/busses/i2c-ali1535.c index bd8f1e4d9e6c..906a3ca50db6 100644 --- a/drivers/i2c/busses/i2c-ali1535.c +++ b/drivers/i2c/busses/i2c-ali1535.c | |||
@@ -60,7 +60,7 @@ | |||
60 | #include <linux/i2c.h> | 60 | #include <linux/i2c.h> |
61 | #include <linux/init.h> | 61 | #include <linux/init.h> |
62 | #include <linux/acpi.h> | 62 | #include <linux/acpi.h> |
63 | #include <asm/io.h> | 63 | #include <linux/io.h> |
64 | 64 | ||
65 | 65 | ||
66 | /* ALI1535 SMBus address offsets */ | 66 | /* ALI1535 SMBus address offsets */ |
diff --git a/drivers/i2c/busses/i2c-ali15x3.c b/drivers/i2c/busses/i2c-ali15x3.c index 659f63f5e4af..b14f6d68221d 100644 --- a/drivers/i2c/busses/i2c-ali15x3.c +++ b/drivers/i2c/busses/i2c-ali15x3.c | |||
@@ -67,7 +67,7 @@ | |||
67 | #include <linux/i2c.h> | 67 | #include <linux/i2c.h> |
68 | #include <linux/init.h> | 68 | #include <linux/init.h> |
69 | #include <linux/acpi.h> | 69 | #include <linux/acpi.h> |
70 | #include <asm/io.h> | 70 | #include <linux/io.h> |
71 | 71 | ||
72 | /* ALI15X3 SMBus address offsets */ | 72 | /* ALI15X3 SMBus address offsets */ |
73 | #define SMBHSTSTS (0 + ali15x3_smba) | 73 | #define SMBHSTSTS (0 + ali15x3_smba) |
diff --git a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c index c5a9fa488e7f..03bcd07c4697 100644 --- a/drivers/i2c/busses/i2c-amd756.c +++ b/drivers/i2c/busses/i2c-amd756.c | |||
@@ -43,7 +43,7 @@ | |||
43 | #include <linux/i2c.h> | 43 | #include <linux/i2c.h> |
44 | #include <linux/init.h> | 44 | #include <linux/init.h> |
45 | #include <linux/acpi.h> | 45 | #include <linux/acpi.h> |
46 | #include <asm/io.h> | 46 | #include <linux/io.h> |
47 | 47 | ||
48 | /* AMD756 SMBus address offsets */ | 48 | /* AMD756 SMBus address offsets */ |
49 | #define SMB_ADDR_OFFSET 0xE0 | 49 | #define SMB_ADDR_OFFSET 0xE0 |
diff --git a/drivers/i2c/busses/i2c-amd8111.c b/drivers/i2c/busses/i2c-amd8111.c index 2fbef27b6cd6..af1e5e254b7b 100644 --- a/drivers/i2c/busses/i2c-amd8111.c +++ b/drivers/i2c/busses/i2c-amd8111.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
19 | #include <linux/acpi.h> | 19 | #include <linux/acpi.h> |
20 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
21 | #include <asm/io.h> | 21 | #include <linux/io.h> |
22 | 22 | ||
23 | MODULE_LICENSE("GPL"); | 23 | MODULE_LICENSE("GPL"); |
24 | MODULE_AUTHOR ("Vojtech Pavlik <vojtech@suse.cz>"); | 24 | MODULE_AUTHOR ("Vojtech Pavlik <vojtech@suse.cz>"); |
diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c index 06e1ecb4919f..305c07504f7e 100644 --- a/drivers/i2c/busses/i2c-at91.c +++ b/drivers/i2c/busses/i2c-at91.c | |||
@@ -23,8 +23,7 @@ | |||
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | #include <linux/clk.h> | 24 | #include <linux/clk.h> |
25 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
26 | 26 | #include <linux/io.h> | |
27 | #include <asm/io.h> | ||
28 | 27 | ||
29 | #include <mach/at91_twi.h> | 28 | #include <mach/at91_twi.h> |
30 | #include <mach/board.h> | 29 | #include <mach/board.h> |
diff --git a/drivers/i2c/busses/i2c-elektor.c b/drivers/i2c/busses/i2c-elektor.c index 612255614a66..e5b1a3bf5b80 100644 --- a/drivers/i2c/busses/i2c-elektor.c +++ b/drivers/i2c/busses/i2c-elektor.c | |||
@@ -37,8 +37,8 @@ | |||
37 | #include <linux/isa.h> | 37 | #include <linux/isa.h> |
38 | #include <linux/i2c.h> | 38 | #include <linux/i2c.h> |
39 | #include <linux/i2c-algo-pcf.h> | 39 | #include <linux/i2c-algo-pcf.h> |
40 | #include <linux/io.h> | ||
40 | 41 | ||
41 | #include <asm/io.h> | ||
42 | #include <asm/irq.h> | 42 | #include <asm/irq.h> |
43 | 43 | ||
44 | #include "../algos/i2c-algo-pcf.h" | 44 | #include "../algos/i2c-algo-pcf.h" |
diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c index c21077d248af..d9aa9a649e35 100644 --- a/drivers/i2c/busses/i2c-gpio.c +++ b/drivers/i2c/busses/i2c-gpio.c | |||
@@ -211,7 +211,7 @@ static int __init i2c_gpio_init(void) | |||
211 | 211 | ||
212 | return ret; | 212 | return ret; |
213 | } | 213 | } |
214 | module_init(i2c_gpio_init); | 214 | subsys_initcall(i2c_gpio_init); |
215 | 215 | ||
216 | static void __exit i2c_gpio_exit(void) | 216 | static void __exit i2c_gpio_exit(void) |
217 | { | 217 | { |
diff --git a/drivers/i2c/busses/i2c-hydra.c b/drivers/i2c/busses/i2c-hydra.c index c767295ad1fb..9ff1695d8458 100644 --- a/drivers/i2c/busses/i2c-hydra.c +++ b/drivers/i2c/busses/i2c-hydra.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <linux/i2c.h> | 28 | #include <linux/i2c.h> |
29 | #include <linux/i2c-algo-bit.h> | 29 | #include <linux/i2c-algo-bit.h> |
30 | #include <linux/init.h> | 30 | #include <linux/init.h> |
31 | #include <asm/io.h> | 31 | #include <linux/io.h> |
32 | #include <asm/hydra.h> | 32 | #include <asm/hydra.h> |
33 | 33 | ||
34 | 34 | ||
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 299b918455a3..f4b21f2bb8ed 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c | |||
@@ -138,6 +138,17 @@ static struct pci_dev *I801_dev; | |||
138 | #define FEATURE_I2C_BLOCK_READ (1 << 3) | 138 | #define FEATURE_I2C_BLOCK_READ (1 << 3) |
139 | static unsigned int i801_features; | 139 | static unsigned int i801_features; |
140 | 140 | ||
141 | static const char *i801_feature_names[] = { | ||
142 | "SMBus PEC", | ||
143 | "Block buffer", | ||
144 | "Block process call", | ||
145 | "I2C block read", | ||
146 | }; | ||
147 | |||
148 | static unsigned int disable_features; | ||
149 | module_param(disable_features, uint, S_IRUGO | S_IWUSR); | ||
150 | MODULE_PARM_DESC(disable_features, "Disable selected driver features"); | ||
151 | |||
141 | /* Make sure the SMBus host is ready to start transmitting. | 152 | /* Make sure the SMBus host is ready to start transmitting. |
142 | Return 0 if it is, -EBUSY if it is not. */ | 153 | Return 0 if it is, -EBUSY if it is not. */ |
143 | static int i801_check_pre(void) | 154 | static int i801_check_pre(void) |
@@ -341,9 +352,8 @@ static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data, | |||
341 | do { | 352 | do { |
342 | msleep(1); | 353 | msleep(1); |
343 | status = inb_p(SMBHSTSTS); | 354 | status = inb_p(SMBHSTSTS); |
344 | } | 355 | } while ((!(status & SMBHSTSTS_BYTE_DONE)) |
345 | while ((!(status & SMBHSTSTS_BYTE_DONE)) | 356 | && (timeout++ < MAX_TIMEOUT)); |
346 | && (timeout++ < MAX_TIMEOUT)); | ||
347 | 357 | ||
348 | result = i801_check_post(status, timeout > MAX_TIMEOUT); | 358 | result = i801_check_post(status, timeout > MAX_TIMEOUT); |
349 | if (result < 0) | 359 | if (result < 0) |
@@ -440,9 +450,9 @@ static int i801_block_transaction(union i2c_smbus_data *data, char read_write, | |||
440 | } | 450 | } |
441 | 451 | ||
442 | /* Return negative errno on error. */ | 452 | /* Return negative errno on error. */ |
443 | static s32 i801_access(struct i2c_adapter * adap, u16 addr, | 453 | static s32 i801_access(struct i2c_adapter *adap, u16 addr, |
444 | unsigned short flags, char read_write, u8 command, | 454 | unsigned short flags, char read_write, u8 command, |
445 | int size, union i2c_smbus_data * data) | 455 | int size, union i2c_smbus_data *data) |
446 | { | 456 | { |
447 | int hwpec; | 457 | int hwpec; |
448 | int block = 0; | 458 | int block = 0; |
@@ -511,7 +521,7 @@ static s32 i801_access(struct i2c_adapter * adap, u16 addr, | |||
511 | else | 521 | else |
512 | outb_p(inb_p(SMBAUXCTL) & (~SMBAUXCTL_CRC), SMBAUXCTL); | 522 | outb_p(inb_p(SMBAUXCTL) & (~SMBAUXCTL_CRC), SMBAUXCTL); |
513 | 523 | ||
514 | if(block) | 524 | if (block) |
515 | ret = i801_block_transaction(data, read_write, size, hwpec); | 525 | ret = i801_block_transaction(data, read_write, size, hwpec); |
516 | else | 526 | else |
517 | ret = i801_transaction(xact | ENABLE_INT9); | 527 | ret = i801_transaction(xact | ENABLE_INT9); |
@@ -523,9 +533,9 @@ static s32 i801_access(struct i2c_adapter * adap, u16 addr, | |||
523 | outb_p(inb_p(SMBAUXCTL) & ~(SMBAUXCTL_CRC | SMBAUXCTL_E32B), | 533 | outb_p(inb_p(SMBAUXCTL) & ~(SMBAUXCTL_CRC | SMBAUXCTL_E32B), |
524 | SMBAUXCTL); | 534 | SMBAUXCTL); |
525 | 535 | ||
526 | if(block) | 536 | if (block) |
527 | return ret; | 537 | return ret; |
528 | if(ret) | 538 | if (ret) |
529 | return ret; | 539 | return ret; |
530 | if ((read_write == I2C_SMBUS_WRITE) || (xact == I801_QUICK)) | 540 | if ((read_write == I2C_SMBUS_WRITE) || (xact == I801_QUICK)) |
531 | return 0; | 541 | return 0; |
@@ -585,7 +595,7 @@ static const struct pci_device_id i801_ids[] = { | |||
585 | { 0, } | 595 | { 0, } |
586 | }; | 596 | }; |
587 | 597 | ||
588 | MODULE_DEVICE_TABLE (pci, i801_ids); | 598 | MODULE_DEVICE_TABLE(pci, i801_ids); |
589 | 599 | ||
590 | #if defined CONFIG_INPUT_APANEL || defined CONFIG_INPUT_APANEL_MODULE | 600 | #if defined CONFIG_INPUT_APANEL || defined CONFIG_INPUT_APANEL_MODULE |
591 | static unsigned char apanel_addr; | 601 | static unsigned char apanel_addr; |
@@ -689,10 +699,11 @@ static void __devinit dmi_check_onboard_devices(const struct dmi_header *dm, | |||
689 | } | 699 | } |
690 | #endif | 700 | #endif |
691 | 701 | ||
692 | static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id *id) | 702 | static int __devinit i801_probe(struct pci_dev *dev, |
703 | const struct pci_device_id *id) | ||
693 | { | 704 | { |
694 | unsigned char temp; | 705 | unsigned char temp; |
695 | int err; | 706 | int err, i; |
696 | #if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE | 707 | #if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE |
697 | const char *vendor; | 708 | const char *vendor; |
698 | #endif | 709 | #endif |
@@ -700,26 +711,28 @@ static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id | |||
700 | I801_dev = dev; | 711 | I801_dev = dev; |
701 | i801_features = 0; | 712 | i801_features = 0; |
702 | switch (dev->device) { | 713 | switch (dev->device) { |
703 | case PCI_DEVICE_ID_INTEL_82801EB_3: | 714 | default: |
704 | case PCI_DEVICE_ID_INTEL_ESB_4: | ||
705 | case PCI_DEVICE_ID_INTEL_ICH6_16: | ||
706 | case PCI_DEVICE_ID_INTEL_ICH7_17: | ||
707 | case PCI_DEVICE_ID_INTEL_ESB2_17: | ||
708 | case PCI_DEVICE_ID_INTEL_ICH8_5: | ||
709 | case PCI_DEVICE_ID_INTEL_ICH9_6: | ||
710 | case PCI_DEVICE_ID_INTEL_TOLAPAI_1: | ||
711 | case PCI_DEVICE_ID_INTEL_ICH10_4: | ||
712 | case PCI_DEVICE_ID_INTEL_ICH10_5: | ||
713 | case PCI_DEVICE_ID_INTEL_PCH_SMBUS: | ||
714 | case PCI_DEVICE_ID_INTEL_CPT_SMBUS: | ||
715 | i801_features |= FEATURE_I2C_BLOCK_READ; | 715 | i801_features |= FEATURE_I2C_BLOCK_READ; |
716 | /* fall through */ | 716 | /* fall through */ |
717 | case PCI_DEVICE_ID_INTEL_82801DB_3: | 717 | case PCI_DEVICE_ID_INTEL_82801DB_3: |
718 | i801_features |= FEATURE_SMBUS_PEC; | 718 | i801_features |= FEATURE_SMBUS_PEC; |
719 | i801_features |= FEATURE_BLOCK_BUFFER; | 719 | i801_features |= FEATURE_BLOCK_BUFFER; |
720 | /* fall through */ | ||
721 | case PCI_DEVICE_ID_INTEL_82801CA_3: | ||
722 | case PCI_DEVICE_ID_INTEL_82801BA_2: | ||
723 | case PCI_DEVICE_ID_INTEL_82801AB_3: | ||
724 | case PCI_DEVICE_ID_INTEL_82801AA_3: | ||
720 | break; | 725 | break; |
721 | } | 726 | } |
722 | 727 | ||
728 | /* Disable features on user request */ | ||
729 | for (i = 0; i < ARRAY_SIZE(i801_feature_names); i++) { | ||
730 | if (i801_features & disable_features & (1 << i)) | ||
731 | dev_notice(&dev->dev, "%s disabled by user\n", | ||
732 | i801_feature_names[i]); | ||
733 | } | ||
734 | i801_features &= ~disable_features; | ||
735 | |||
723 | err = pci_enable_device(dev); | 736 | err = pci_enable_device(dev); |
724 | if (err) { | 737 | if (err) { |
725 | dev_err(&dev->dev, "Failed to enable SMBus PCI device (%d)\n", | 738 | dev_err(&dev->dev, "Failed to enable SMBus PCI device (%d)\n", |
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c index 2bef534cbff1..f8ccc0fe95a8 100644 --- a/drivers/i2c/busses/i2c-ibm_iic.c +++ b/drivers/i2c/busses/i2c-ibm_iic.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #include <linux/init.h> | 39 | #include <linux/init.h> |
40 | #include <linux/interrupt.h> | 40 | #include <linux/interrupt.h> |
41 | #include <asm/irq.h> | 41 | #include <asm/irq.h> |
42 | #include <asm/io.h> | 42 | #include <linux/io.h> |
43 | #include <linux/i2c.h> | 43 | #include <linux/i2c.h> |
44 | #include <linux/i2c-id.h> | 44 | #include <linux/i2c-id.h> |
45 | #include <linux/of_platform.h> | 45 | #include <linux/of_platform.h> |
diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c index 5901707fc66a..112c61f7b8cd 100644 --- a/drivers/i2c/busses/i2c-iop3xx.c +++ b/drivers/i2c/busses/i2c-iop3xx.c | |||
@@ -38,8 +38,7 @@ | |||
38 | #include <linux/errno.h> | 38 | #include <linux/errno.h> |
39 | #include <linux/platform_device.h> | 39 | #include <linux/platform_device.h> |
40 | #include <linux/i2c.h> | 40 | #include <linux/i2c.h> |
41 | 41 | #include <linux/io.h> | |
42 | #include <asm/io.h> | ||
43 | 42 | ||
44 | #include "i2c-iop3xx.h" | 43 | #include "i2c-iop3xx.h" |
45 | 44 | ||
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index 3623a4499084..16242063144f 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c | |||
@@ -17,8 +17,7 @@ | |||
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/mv643xx_i2c.h> | 18 | #include <linux/mv643xx_i2c.h> |
19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
20 | 20 | #include <linux/io.h> | |
21 | #include <asm/io.h> | ||
22 | 21 | ||
23 | /* Register defines */ | 22 | /* Register defines */ |
24 | #define MV64XXX_I2C_REG_SLAVE_ADDR 0x00 | 23 | #define MV64XXX_I2C_REG_SLAVE_ADDR 0x00 |
diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c index 4a48dd4ef787..a605a5029cfe 100644 --- a/drivers/i2c/busses/i2c-nforce2.c +++ b/drivers/i2c/busses/i2c-nforce2.c | |||
@@ -57,7 +57,7 @@ | |||
57 | #include <linux/dmi.h> | 57 | #include <linux/dmi.h> |
58 | #include <linux/acpi.h> | 58 | #include <linux/acpi.h> |
59 | #include <linux/slab.h> | 59 | #include <linux/slab.h> |
60 | #include <asm/io.h> | 60 | #include <linux/io.h> |
61 | 61 | ||
62 | MODULE_LICENSE("GPL"); | 62 | MODULE_LICENSE("GPL"); |
63 | MODULE_AUTHOR ("Hans-Frieder Vogt <hfvogt@gmx.net>"); | 63 | MODULE_AUTHOR ("Hans-Frieder Vogt <hfvogt@gmx.net>"); |
@@ -404,10 +404,9 @@ static int __devinit nforce2_probe(struct pci_dev *dev, const struct pci_device_ | |||
404 | 404 | ||
405 | /* SMBus adapter 1 */ | 405 | /* SMBus adapter 1 */ |
406 | res1 = nforce2_probe_smb(dev, 4, NFORCE_PCI_SMB1, &smbuses[0], "SMB1"); | 406 | res1 = nforce2_probe_smb(dev, 4, NFORCE_PCI_SMB1, &smbuses[0], "SMB1"); |
407 | if (res1 < 0) { | 407 | if (res1 < 0) |
408 | dev_err(&dev->dev, "Error probing SMB1.\n"); | ||
409 | smbuses[0].base = 0; /* to have a check value */ | 408 | smbuses[0].base = 0; /* to have a check value */ |
410 | } | 409 | |
411 | /* SMBus adapter 2 */ | 410 | /* SMBus adapter 2 */ |
412 | if (dmi_check_system(nforce2_dmi_blacklist2)) { | 411 | if (dmi_check_system(nforce2_dmi_blacklist2)) { |
413 | dev_err(&dev->dev, "Disabling SMB2 for safety reasons.\n"); | 412 | dev_err(&dev->dev, "Disabling SMB2 for safety reasons.\n"); |
@@ -416,11 +415,10 @@ static int __devinit nforce2_probe(struct pci_dev *dev, const struct pci_device_ | |||
416 | } else { | 415 | } else { |
417 | res2 = nforce2_probe_smb(dev, 5, NFORCE_PCI_SMB2, &smbuses[1], | 416 | res2 = nforce2_probe_smb(dev, 5, NFORCE_PCI_SMB2, &smbuses[1], |
418 | "SMB2"); | 417 | "SMB2"); |
419 | if (res2 < 0) { | 418 | if (res2 < 0) |
420 | dev_err(&dev->dev, "Error probing SMB2.\n"); | ||
421 | smbuses[1].base = 0; /* to have a check value */ | 419 | smbuses[1].base = 0; /* to have a check value */ |
422 | } | ||
423 | } | 420 | } |
421 | |||
424 | if ((res1 < 0) && (res2 < 0)) { | 422 | if ((res1 < 0) && (res2 < 0)) { |
425 | /* we did not find even one of the SMBuses, so we give up */ | 423 | /* we did not find even one of the SMBuses, so we give up */ |
426 | kfree(smbuses); | 424 | kfree(smbuses); |
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c index b4ed4ca802ed..0070371b29f3 100644 --- a/drivers/i2c/busses/i2c-ocores.c +++ b/drivers/i2c/busses/i2c-ocores.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/wait.h> | 19 | #include <linux/wait.h> |
20 | #include <linux/i2c-ocores.h> | 20 | #include <linux/i2c-ocores.h> |
21 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
22 | #include <asm/io.h> | 22 | #include <linux/io.h> |
23 | 23 | ||
24 | struct ocores_i2c { | 24 | struct ocores_i2c { |
25 | void __iomem *base; | 25 | void __iomem *base; |
diff --git a/drivers/i2c/busses/i2c-parport-light.c b/drivers/i2c/busses/i2c-parport-light.c index 5f41ec0f72d2..fc5fbd1012c9 100644 --- a/drivers/i2c/busses/i2c-parport-light.c +++ b/drivers/i2c/busses/i2c-parport-light.c | |||
@@ -33,7 +33,7 @@ | |||
33 | #include <linux/i2c.h> | 33 | #include <linux/i2c.h> |
34 | #include <linux/i2c-algo-bit.h> | 34 | #include <linux/i2c-algo-bit.h> |
35 | #include <linux/i2c-smbus.h> | 35 | #include <linux/i2c-smbus.h> |
36 | #include <asm/io.h> | 36 | #include <linux/io.h> |
37 | #include "i2c-parport.h" | 37 | #include "i2c-parport.h" |
38 | 38 | ||
39 | #define DEFAULT_BASE 0x378 | 39 | #define DEFAULT_BASE 0x378 |
diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c index 846583ed4763..0eb1515541e7 100644 --- a/drivers/i2c/busses/i2c-parport.c +++ b/drivers/i2c/busses/i2c-parport.c | |||
@@ -137,7 +137,7 @@ static int parport_getsda(void *data) | |||
137 | copied. The attaching code will set getscl to NULL for adapters that | 137 | copied. The attaching code will set getscl to NULL for adapters that |
138 | cannot read SCL back, and will also make the data field point to | 138 | cannot read SCL back, and will also make the data field point to |
139 | the parallel port structure. */ | 139 | the parallel port structure. */ |
140 | static struct i2c_algo_bit_data parport_algo_data = { | 140 | static const struct i2c_algo_bit_data parport_algo_data = { |
141 | .setsda = parport_setsda, | 141 | .setsda = parport_setsda, |
142 | .setscl = parport_setscl, | 142 | .setscl = parport_setscl, |
143 | .getsda = parport_getsda, | 143 | .getsda = parport_getsda, |
diff --git a/drivers/i2c/busses/i2c-pasemi.c b/drivers/i2c/busses/i2c-pasemi.c index d3d4a4b43a1d..4174101660c9 100644 --- a/drivers/i2c/busses/i2c-pasemi.c +++ b/drivers/i2c/busses/i2c-pasemi.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include <linux/i2c.h> | 25 | #include <linux/i2c.h> |
26 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | #include <asm/io.h> | 28 | #include <linux/io.h> |
29 | 29 | ||
30 | static struct pci_driver pasemi_smb_driver; | 30 | static struct pci_driver pasemi_smb_driver; |
31 | 31 | ||
diff --git a/drivers/i2c/busses/i2c-pca-isa.c b/drivers/i2c/busses/i2c-pca-isa.c index f7346a9bd95f..bbd77603a417 100644 --- a/drivers/i2c/busses/i2c-pca-isa.c +++ b/drivers/i2c/busses/i2c-pca-isa.c | |||
@@ -30,8 +30,8 @@ | |||
30 | #include <linux/isa.h> | 30 | #include <linux/isa.h> |
31 | #include <linux/i2c.h> | 31 | #include <linux/i2c.h> |
32 | #include <linux/i2c-algo-pca.h> | 32 | #include <linux/i2c-algo-pca.h> |
33 | #include <linux/io.h> | ||
33 | 34 | ||
34 | #include <asm/io.h> | ||
35 | #include <asm/irq.h> | 35 | #include <asm/irq.h> |
36 | 36 | ||
37 | #define DRIVER "i2c-pca-isa" | 37 | #define DRIVER "i2c-pca-isa" |
diff --git a/drivers/i2c/busses/i2c-pca-platform.c b/drivers/i2c/busses/i2c-pca-platform.c index 5b2213df5ed0..ef5c78487eb7 100644 --- a/drivers/i2c/busses/i2c-pca-platform.c +++ b/drivers/i2c/busses/i2c-pca-platform.c | |||
@@ -23,9 +23,9 @@ | |||
23 | #include <linux/i2c-algo-pca.h> | 23 | #include <linux/i2c-algo-pca.h> |
24 | #include <linux/i2c-pca-platform.h> | 24 | #include <linux/i2c-pca-platform.h> |
25 | #include <linux/gpio.h> | 25 | #include <linux/gpio.h> |
26 | #include <linux/io.h> | ||
26 | 27 | ||
27 | #include <asm/irq.h> | 28 | #include <asm/irq.h> |
28 | #include <asm/io.h> | ||
29 | 29 | ||
30 | struct i2c_pca_pf_data { | 30 | struct i2c_pca_pf_data { |
31 | void __iomem *reg_base; | 31 | void __iomem *reg_base; |
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index ee9da6fcf69a..6d14ac2e3c41 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #include <linux/init.h> | 39 | #include <linux/init.h> |
40 | #include <linux/dmi.h> | 40 | #include <linux/dmi.h> |
41 | #include <linux/acpi.h> | 41 | #include <linux/acpi.h> |
42 | #include <asm/io.h> | 42 | #include <linux/io.h> |
43 | 43 | ||
44 | 44 | ||
45 | /* PIIX4 SMBus address offsets */ | 45 | /* PIIX4 SMBus address offsets */ |
diff --git a/drivers/i2c/busses/i2c-pmcmsp.c b/drivers/i2c/busses/i2c-pmcmsp.c index 7b57d5f267e1..dfa7ae9c1b8e 100644 --- a/drivers/i2c/busses/i2c-pmcmsp.c +++ b/drivers/i2c/busses/i2c-pmcmsp.c | |||
@@ -33,7 +33,7 @@ | |||
33 | #include <linux/completion.h> | 33 | #include <linux/completion.h> |
34 | #include <linux/mutex.h> | 34 | #include <linux/mutex.h> |
35 | #include <linux/delay.h> | 35 | #include <linux/delay.h> |
36 | #include <asm/io.h> | 36 | #include <linux/io.h> |
37 | 37 | ||
38 | #define DRV_NAME "pmcmsptwi" | 38 | #define DRV_NAME "pmcmsptwi" |
39 | 39 | ||
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index fbde6f614059..020ff23d762f 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c | |||
@@ -34,9 +34,9 @@ | |||
34 | #include <linux/err.h> | 34 | #include <linux/err.h> |
35 | #include <linux/clk.h> | 35 | #include <linux/clk.h> |
36 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
37 | #include <linux/io.h> | ||
37 | 38 | ||
38 | #include <asm/irq.h> | 39 | #include <asm/irq.h> |
39 | #include <asm/io.h> | ||
40 | #include <plat/i2c.h> | 40 | #include <plat/i2c.h> |
41 | 41 | ||
42 | /* | 42 | /* |
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index ec3256cce91e..72902e0bbfa7 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c | |||
@@ -35,9 +35,9 @@ | |||
35 | #include <linux/clk.h> | 35 | #include <linux/clk.h> |
36 | #include <linux/cpufreq.h> | 36 | #include <linux/cpufreq.h> |
37 | #include <linux/slab.h> | 37 | #include <linux/slab.h> |
38 | #include <linux/io.h> | ||
38 | 39 | ||
39 | #include <asm/irq.h> | 40 | #include <asm/irq.h> |
40 | #include <asm/io.h> | ||
41 | 41 | ||
42 | #include <plat/regs-iic.h> | 42 | #include <plat/regs-iic.h> |
43 | #include <plat/iic.h> | 43 | #include <plat/iic.h> |
diff --git a/drivers/i2c/busses/i2c-s6000.c b/drivers/i2c/busses/i2c-s6000.c index c91359f4965c..cadc0216e02f 100644 --- a/drivers/i2c/busses/i2c-s6000.c +++ b/drivers/i2c/busses/i2c-s6000.c | |||
@@ -36,8 +36,8 @@ | |||
36 | #include <linux/completion.h> | 36 | #include <linux/completion.h> |
37 | #include <linux/interrupt.h> | 37 | #include <linux/interrupt.h> |
38 | #include <linux/platform_device.h> | 38 | #include <linux/platform_device.h> |
39 | #include <linux/io.h> | ||
39 | 40 | ||
40 | #include <asm/io.h> | ||
41 | #include "i2c-s6000.h" | 41 | #include "i2c-s6000.h" |
42 | 42 | ||
43 | #define DRV_NAME "i2c-s6000" | 43 | #define DRV_NAME "i2c-s6000" |
diff --git a/drivers/i2c/busses/i2c-sh7760.c b/drivers/i2c/busses/i2c-sh7760.c index b9680f50f541..4f93da31d3ad 100644 --- a/drivers/i2c/busses/i2c-sh7760.c +++ b/drivers/i2c/busses/i2c-sh7760.c | |||
@@ -16,10 +16,10 @@ | |||
16 | #include <linux/ioport.h> | 16 | #include <linux/ioport.h> |
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
19 | #include <linux/io.h> | ||
19 | 20 | ||
20 | #include <asm/clock.h> | 21 | #include <asm/clock.h> |
21 | #include <asm/i2c-sh7760.h> | 22 | #include <asm/i2c-sh7760.h> |
22 | #include <asm/io.h> | ||
23 | 23 | ||
24 | /* register offsets */ | 24 | /* register offsets */ |
25 | #define I2CSCR 0x0 /* slave ctrl */ | 25 | #define I2CSCR 0x0 /* slave ctrl */ |
diff --git a/drivers/i2c/busses/i2c-sibyte.c b/drivers/i2c/busses/i2c-sibyte.c index 98b1ec489159..3d76a188e42f 100644 --- a/drivers/i2c/busses/i2c-sibyte.c +++ b/drivers/i2c/busses/i2c-sibyte.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | #include <linux/i2c.h> | 24 | #include <linux/i2c.h> |
25 | #include <asm/io.h> | 25 | #include <linux/io.h> |
26 | #include <asm/sibyte/sb1250_regs.h> | 26 | #include <asm/sibyte/sb1250_regs.h> |
27 | #include <asm/sibyte/sb1250_smbus.h> | 27 | #include <asm/sibyte/sb1250_smbus.h> |
28 | 28 | ||
diff --git a/drivers/i2c/busses/i2c-simtec.c b/drivers/i2c/busses/i2c-simtec.c index 78b06107342c..2fc08fbf67a2 100644 --- a/drivers/i2c/busses/i2c-simtec.c +++ b/drivers/i2c/busses/i2c-simtec.c | |||
@@ -24,12 +24,11 @@ | |||
24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
25 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <linux/io.h> | ||
27 | 28 | ||
28 | #include <linux/i2c.h> | 29 | #include <linux/i2c.h> |
29 | #include <linux/i2c-algo-bit.h> | 30 | #include <linux/i2c-algo-bit.h> |
30 | 31 | ||
31 | #include <asm/io.h> | ||
32 | |||
33 | struct simtec_i2c_data { | 32 | struct simtec_i2c_data { |
34 | struct resource *ioarea; | 33 | struct resource *ioarea; |
35 | void __iomem *reg; | 34 | void __iomem *reg; |
diff --git a/drivers/i2c/busses/i2c-sis5595.c b/drivers/i2c/busses/i2c-sis5595.c index 55a71370c79b..437586611d4a 100644 --- a/drivers/i2c/busses/i2c-sis5595.c +++ b/drivers/i2c/busses/i2c-sis5595.c | |||
@@ -61,7 +61,7 @@ | |||
61 | #include <linux/init.h> | 61 | #include <linux/init.h> |
62 | #include <linux/i2c.h> | 62 | #include <linux/i2c.h> |
63 | #include <linux/acpi.h> | 63 | #include <linux/acpi.h> |
64 | #include <asm/io.h> | 64 | #include <linux/io.h> |
65 | 65 | ||
66 | static int blacklist[] = { | 66 | static int blacklist[] = { |
67 | PCI_DEVICE_ID_SI_540, | 67 | PCI_DEVICE_ID_SI_540, |
diff --git a/drivers/i2c/busses/i2c-sis630.c b/drivers/i2c/busses/i2c-sis630.c index 2309c7f1bde2..e6f539e26f65 100644 --- a/drivers/i2c/busses/i2c-sis630.c +++ b/drivers/i2c/busses/i2c-sis630.c | |||
@@ -53,7 +53,7 @@ | |||
53 | #include <linux/init.h> | 53 | #include <linux/init.h> |
54 | #include <linux/i2c.h> | 54 | #include <linux/i2c.h> |
55 | #include <linux/acpi.h> | 55 | #include <linux/acpi.h> |
56 | #include <asm/io.h> | 56 | #include <linux/io.h> |
57 | 57 | ||
58 | /* SIS630 SMBus registers */ | 58 | /* SIS630 SMBus registers */ |
59 | #define SMB_STS 0x80 /* status */ | 59 | #define SMB_STS 0x80 /* status */ |
diff --git a/drivers/i2c/busses/i2c-sis96x.c b/drivers/i2c/busses/i2c-sis96x.c index d43d8f8943dd..86837f0c4cb9 100644 --- a/drivers/i2c/busses/i2c-sis96x.c +++ b/drivers/i2c/busses/i2c-sis96x.c | |||
@@ -38,7 +38,7 @@ | |||
38 | #include <linux/i2c.h> | 38 | #include <linux/i2c.h> |
39 | #include <linux/init.h> | 39 | #include <linux/init.h> |
40 | #include <linux/acpi.h> | 40 | #include <linux/acpi.h> |
41 | #include <asm/io.h> | 41 | #include <linux/io.h> |
42 | 42 | ||
43 | /* base address register in PCI config space */ | 43 | /* base address register in PCI config space */ |
44 | #define SIS96x_BAR 0x04 | 44 | #define SIS96x_BAR 0x04 |
diff --git a/drivers/i2c/busses/i2c-stub.c b/drivers/i2c/busses/i2c-stub.c index 0c770eabe85e..b1b3447942c9 100644 --- a/drivers/i2c/busses/i2c-stub.c +++ b/drivers/i2c/busses/i2c-stub.c | |||
@@ -29,13 +29,16 @@ | |||
29 | #include <linux/i2c.h> | 29 | #include <linux/i2c.h> |
30 | 30 | ||
31 | #define MAX_CHIPS 10 | 31 | #define MAX_CHIPS 10 |
32 | #define STUB_FUNC (I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | \ | ||
33 | I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | \ | ||
34 | I2C_FUNC_SMBUS_I2C_BLOCK) | ||
32 | 35 | ||
33 | static unsigned short chip_addr[MAX_CHIPS]; | 36 | static unsigned short chip_addr[MAX_CHIPS]; |
34 | module_param_array(chip_addr, ushort, NULL, S_IRUGO); | 37 | module_param_array(chip_addr, ushort, NULL, S_IRUGO); |
35 | MODULE_PARM_DESC(chip_addr, | 38 | MODULE_PARM_DESC(chip_addr, |
36 | "Chip addresses (up to 10, between 0x03 and 0x77)"); | 39 | "Chip addresses (up to 10, between 0x03 and 0x77)"); |
37 | 40 | ||
38 | static unsigned long functionality = ~0UL; | 41 | static unsigned long functionality = STUB_FUNC; |
39 | module_param(functionality, ulong, S_IRUGO | S_IWUSR); | 42 | module_param(functionality, ulong, S_IRUGO | S_IWUSR); |
40 | MODULE_PARM_DESC(functionality, "Override functionality bitfield"); | 43 | MODULE_PARM_DESC(functionality, "Override functionality bitfield"); |
41 | 44 | ||
@@ -156,9 +159,7 @@ static s32 stub_xfer(struct i2c_adapter * adap, u16 addr, unsigned short flags, | |||
156 | 159 | ||
157 | static u32 stub_func(struct i2c_adapter *adapter) | 160 | static u32 stub_func(struct i2c_adapter *adapter) |
158 | { | 161 | { |
159 | return (I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | | 162 | return STUB_FUNC & functionality; |
160 | I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | | ||
161 | I2C_FUNC_SMBUS_I2C_BLOCK) & functionality; | ||
162 | } | 163 | } |
163 | 164 | ||
164 | static const struct i2c_algorithm smbus_algorithm = { | 165 | static const struct i2c_algorithm smbus_algorithm = { |
diff --git a/drivers/i2c/busses/i2c-versatile.c b/drivers/i2c/busses/i2c-versatile.c index 5c473833d948..60556012312f 100644 --- a/drivers/i2c/busses/i2c-versatile.c +++ b/drivers/i2c/busses/i2c-versatile.c | |||
@@ -15,8 +15,7 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
18 | 18 | #include <linux/io.h> | |
19 | #include <asm/io.h> | ||
20 | 19 | ||
21 | #define I2C_CONTROL 0x00 | 20 | #define I2C_CONTROL 0x00 |
22 | #define I2C_CONTROLS 0x00 | 21 | #define I2C_CONTROLS 0x00 |
diff --git a/drivers/i2c/busses/i2c-via.c b/drivers/i2c/busses/i2c-via.c index de78283bddbe..7799fe5bda88 100644 --- a/drivers/i2c/busses/i2c-via.c +++ b/drivers/i2c/busses/i2c-via.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include <linux/init.h> | 25 | #include <linux/init.h> |
26 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
27 | #include <linux/i2c-algo-bit.h> | 27 | #include <linux/i2c-algo-bit.h> |
28 | #include <asm/io.h> | 28 | #include <linux/io.h> |
29 | 29 | ||
30 | /* Power management registers */ | 30 | /* Power management registers */ |
31 | #define PM_CFG_REVID 0x08 /* silicon revision code */ | 31 | #define PM_CFG_REVID 0x08 /* silicon revision code */ |
diff --git a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c index d57292e5dae0..4c6fff5f330d 100644 --- a/drivers/i2c/busses/i2c-viapro.c +++ b/drivers/i2c/busses/i2c-viapro.c | |||
@@ -51,7 +51,7 @@ | |||
51 | #include <linux/i2c.h> | 51 | #include <linux/i2c.h> |
52 | #include <linux/init.h> | 52 | #include <linux/init.h> |
53 | #include <linux/acpi.h> | 53 | #include <linux/acpi.h> |
54 | #include <asm/io.h> | 54 | #include <linux/io.h> |
55 | 55 | ||
56 | static struct pci_dev *vt596_pdev; | 56 | static struct pci_dev *vt596_pdev; |
57 | 57 | ||
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c index 684395b6f3e2..4cb4bb009950 100644 --- a/drivers/i2c/busses/scx200_acb.c +++ b/drivers/i2c/busses/scx200_acb.c | |||
@@ -32,7 +32,7 @@ | |||
32 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
33 | #include <linux/mutex.h> | 33 | #include <linux/mutex.h> |
34 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
35 | #include <asm/io.h> | 35 | #include <linux/io.h> |
36 | 36 | ||
37 | #include <linux/scx200.h> | 37 | #include <linux/scx200.h> |
38 | 38 | ||
@@ -552,7 +552,7 @@ static int __init scx200_create_isa(const char *text, unsigned long base, | |||
552 | * the name and the BAR where the I/O address resource is located. ISA | 552 | * the name and the BAR where the I/O address resource is located. ISA |
553 | * devices are flagged with a bar value of -1 */ | 553 | * devices are flagged with a bar value of -1 */ |
554 | 554 | ||
555 | static struct pci_device_id scx200_pci[] = { | 555 | static const struct pci_device_id scx200_pci[] __initconst = { |
556 | { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SCx200_BRIDGE), | 556 | { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SCx200_BRIDGE), |
557 | .driver_data = 0 }, | 557 | .driver_data = 0 }, |
558 | { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SC1100_BRIDGE), | 558 | { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SC1100_BRIDGE), |
diff --git a/drivers/i2c/busses/scx200_i2c.c b/drivers/i2c/busses/scx200_i2c.c index 42df0eca43d5..7ee0d502ceab 100644 --- a/drivers/i2c/busses/scx200_i2c.c +++ b/drivers/i2c/busses/scx200_i2c.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include <linux/init.h> | 27 | #include <linux/init.h> |
28 | #include <linux/i2c.h> | 28 | #include <linux/i2c.h> |
29 | #include <linux/i2c-algo-bit.h> | 29 | #include <linux/i2c-algo-bit.h> |
30 | #include <asm/io.h> | 30 | #include <linux/io.h> |
31 | 31 | ||
32 | #include <linux/scx200_gpio.h> | 32 | #include <linux/scx200_gpio.h> |
33 | 33 | ||