diff options
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r-- | drivers/i2c/busses/Kconfig | 7 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-ali1535.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-ali1563.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-ali15x3.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-amd756.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-amd8111.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-hydra.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-i801.c | 7 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-isch.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-nforce2.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-parport-light.c | 48 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-parport.c | 43 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-parport.h | 4 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-pasemi.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-piix4.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-sis5595.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-sis630.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-sis96x.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-tiny-usb.c | 10 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-via.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-viapro.c | 2 |
21 files changed, 118 insertions, 31 deletions
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index 737f05200b1..4cc3807bd31 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig | |||
@@ -77,7 +77,7 @@ config I2C_AMD8111 | |||
77 | will be called i2c-amd8111. | 77 | will be called i2c-amd8111. |
78 | 78 | ||
79 | config I2C_I801 | 79 | config I2C_I801 |
80 | tristate "Intel 82801 (ICH)" | 80 | tristate "Intel 82801 (ICH/PCH)" |
81 | depends on PCI | 81 | depends on PCI |
82 | help | 82 | help |
83 | If you say yes to this option, support will be included for the Intel | 83 | If you say yes to this option, support will be included for the Intel |
@@ -97,7 +97,8 @@ config I2C_I801 | |||
97 | ICH9 | 97 | ICH9 |
98 | Tolapai | 98 | Tolapai |
99 | ICH10 | 99 | ICH10 |
100 | PCH | 100 | 3400/5 Series (PCH) |
101 | Cougar Point (PCH) | ||
101 | 102 | ||
102 | This driver can also be built as a module. If so, the module | 103 | This driver can also be built as a module. If so, the module |
103 | will be called i2c-i801. | 104 | will be called i2c-i801. |
@@ -580,6 +581,7 @@ config I2C_PARPORT | |||
580 | tristate "Parallel port adapter" | 581 | tristate "Parallel port adapter" |
581 | depends on PARPORT | 582 | depends on PARPORT |
582 | select I2C_ALGOBIT | 583 | select I2C_ALGOBIT |
584 | select I2C_SMBUS | ||
583 | help | 585 | help |
584 | This supports parallel port I2C adapters such as the ones made by | 586 | This supports parallel port I2C adapters such as the ones made by |
585 | Philips or Velleman, Analog Devices evaluation boards, and more. | 587 | Philips or Velleman, Analog Devices evaluation boards, and more. |
@@ -603,6 +605,7 @@ config I2C_PARPORT | |||
603 | config I2C_PARPORT_LIGHT | 605 | config I2C_PARPORT_LIGHT |
604 | tristate "Parallel port adapter (light)" | 606 | tristate "Parallel port adapter (light)" |
605 | select I2C_ALGOBIT | 607 | select I2C_ALGOBIT |
608 | select I2C_SMBUS | ||
606 | help | 609 | help |
607 | This supports parallel port I2C adapters such as the ones made by | 610 | This supports parallel port I2C adapters such as the ones made by |
608 | Philips or Velleman, Analog Devices evaluation boards, and more. | 611 | Philips or Velleman, Analog Devices evaluation boards, and more. |
diff --git a/drivers/i2c/busses/i2c-ali1535.c b/drivers/i2c/busses/i2c-ali1535.c index 8de7d7b87bb..bd8f1e4d9e6 100644 --- a/drivers/i2c/busses/i2c-ali1535.c +++ b/drivers/i2c/busses/i2c-ali1535.c | |||
@@ -480,7 +480,7 @@ static struct i2c_adapter ali1535_adapter = { | |||
480 | .algo = &smbus_algorithm, | 480 | .algo = &smbus_algorithm, |
481 | }; | 481 | }; |
482 | 482 | ||
483 | static struct pci_device_id ali1535_ids[] = { | 483 | static const struct pci_device_id ali1535_ids[] = { |
484 | { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101) }, | 484 | { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101) }, |
485 | { }, | 485 | { }, |
486 | }; | 486 | }; |
diff --git a/drivers/i2c/busses/i2c-ali1563.c b/drivers/i2c/busses/i2c-ali1563.c index 4687af40dd5..a409cfcf062 100644 --- a/drivers/i2c/busses/i2c-ali1563.c +++ b/drivers/i2c/busses/i2c-ali1563.c | |||
@@ -417,7 +417,7 @@ static void __devexit ali1563_remove(struct pci_dev * dev) | |||
417 | ali1563_shutdown(dev); | 417 | ali1563_shutdown(dev); |
418 | } | 418 | } |
419 | 419 | ||
420 | static struct pci_device_id __devinitdata ali1563_id_table[] = { | 420 | static const struct pci_device_id ali1563_id_table[] __devinitconst = { |
421 | { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1563) }, | 421 | { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1563) }, |
422 | {}, | 422 | {}, |
423 | }; | 423 | }; |
diff --git a/drivers/i2c/busses/i2c-ali15x3.c b/drivers/i2c/busses/i2c-ali15x3.c index e7e3205f128..659f63f5e4a 100644 --- a/drivers/i2c/busses/i2c-ali15x3.c +++ b/drivers/i2c/busses/i2c-ali15x3.c | |||
@@ -477,7 +477,7 @@ static struct i2c_adapter ali15x3_adapter = { | |||
477 | .algo = &smbus_algorithm, | 477 | .algo = &smbus_algorithm, |
478 | }; | 478 | }; |
479 | 479 | ||
480 | static struct pci_device_id ali15x3_ids[] = { | 480 | static const struct pci_device_id ali15x3_ids[] = { |
481 | { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101) }, | 481 | { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101) }, |
482 | { 0, } | 482 | { 0, } |
483 | }; | 483 | }; |
diff --git a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c index 8f0b90ef8c7..c5a9fa488e7 100644 --- a/drivers/i2c/busses/i2c-amd756.c +++ b/drivers/i2c/busses/i2c-amd756.c | |||
@@ -308,7 +308,7 @@ static const char* chipname[] = { | |||
308 | "nVidia nForce", "AMD8111", | 308 | "nVidia nForce", "AMD8111", |
309 | }; | 309 | }; |
310 | 310 | ||
311 | static struct pci_device_id amd756_ids[] = { | 311 | static const struct pci_device_id amd756_ids[] = { |
312 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_740B), | 312 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_740B), |
313 | .driver_data = AMD756 }, | 313 | .driver_data = AMD756 }, |
314 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7413), | 314 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7413), |
diff --git a/drivers/i2c/busses/i2c-amd8111.c b/drivers/i2c/busses/i2c-amd8111.c index 5b4ad86ca16..d0dc970d737 100644 --- a/drivers/i2c/busses/i2c-amd8111.c +++ b/drivers/i2c/busses/i2c-amd8111.c | |||
@@ -351,7 +351,7 @@ static const struct i2c_algorithm smbus_algorithm = { | |||
351 | }; | 351 | }; |
352 | 352 | ||
353 | 353 | ||
354 | static struct pci_device_id amd8111_ids[] = { | 354 | static const struct pci_device_id amd8111_ids[] = { |
355 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_SMBUS2) }, | 355 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_SMBUS2) }, |
356 | { 0, } | 356 | { 0, } |
357 | }; | 357 | }; |
diff --git a/drivers/i2c/busses/i2c-hydra.c b/drivers/i2c/busses/i2c-hydra.c index bec9b845dd1..c767295ad1f 100644 --- a/drivers/i2c/busses/i2c-hydra.c +++ b/drivers/i2c/busses/i2c-hydra.c | |||
@@ -105,7 +105,7 @@ static struct i2c_adapter hydra_adap = { | |||
105 | .algo_data = &hydra_bit_data, | 105 | .algo_data = &hydra_bit_data, |
106 | }; | 106 | }; |
107 | 107 | ||
108 | static struct pci_device_id hydra_ids[] = { | 108 | static const struct pci_device_id hydra_ids[] = { |
109 | { PCI_DEVICE(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_HYDRA) }, | 109 | { PCI_DEVICE(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_HYDRA) }, |
110 | { 0, } | 110 | { 0, } |
111 | }; | 111 | }; |
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index df6ab553f97..9da5b05cdb5 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c | |||
@@ -41,7 +41,8 @@ | |||
41 | Tolapai 0x5032 32 hard yes yes yes | 41 | Tolapai 0x5032 32 hard yes yes yes |
42 | ICH10 0x3a30 32 hard yes yes yes | 42 | ICH10 0x3a30 32 hard yes yes yes |
43 | ICH10 0x3a60 32 hard yes yes yes | 43 | ICH10 0x3a60 32 hard yes yes yes |
44 | PCH 0x3b30 32 hard yes yes yes | 44 | 3400/5 Series (PCH) 0x3b30 32 hard yes yes yes |
45 | Cougar Point (PCH) 0x1c22 32 hard yes yes yes | ||
45 | 46 | ||
46 | Features supported by this driver: | 47 | Features supported by this driver: |
47 | Software PEC no | 48 | Software PEC no |
@@ -561,7 +562,7 @@ static struct i2c_adapter i801_adapter = { | |||
561 | .algo = &smbus_algorithm, | 562 | .algo = &smbus_algorithm, |
562 | }; | 563 | }; |
563 | 564 | ||
564 | static struct pci_device_id i801_ids[] = { | 565 | static const struct pci_device_id i801_ids[] = { |
565 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_3) }, | 566 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_3) }, |
566 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_3) }, | 567 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_3) }, |
567 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_2) }, | 568 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_2) }, |
@@ -578,6 +579,7 @@ static struct pci_device_id i801_ids[] = { | |||
578 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_4) }, | 579 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_4) }, |
579 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_5) }, | 580 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_5) }, |
580 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PCH_SMBUS) }, | 581 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PCH_SMBUS) }, |
582 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CPT_SMBUS) }, | ||
581 | { 0, } | 583 | { 0, } |
582 | }; | 584 | }; |
583 | 585 | ||
@@ -707,6 +709,7 @@ static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id | |||
707 | case PCI_DEVICE_ID_INTEL_ICH10_4: | 709 | case PCI_DEVICE_ID_INTEL_ICH10_4: |
708 | case PCI_DEVICE_ID_INTEL_ICH10_5: | 710 | case PCI_DEVICE_ID_INTEL_ICH10_5: |
709 | case PCI_DEVICE_ID_INTEL_PCH_SMBUS: | 711 | case PCI_DEVICE_ID_INTEL_PCH_SMBUS: |
712 | case PCI_DEVICE_ID_INTEL_CPT_SMBUS: | ||
710 | i801_features |= FEATURE_I2C_BLOCK_READ; | 713 | i801_features |= FEATURE_I2C_BLOCK_READ; |
711 | /* fall through */ | 714 | /* fall through */ |
712 | case PCI_DEVICE_ID_INTEL_82801DB_3: | 715 | case PCI_DEVICE_ID_INTEL_82801DB_3: |
diff --git a/drivers/i2c/busses/i2c-isch.c b/drivers/i2c/busses/i2c-isch.c index dba6eb053e2..69c22f79f23 100644 --- a/drivers/i2c/busses/i2c-isch.c +++ b/drivers/i2c/busses/i2c-isch.c | |||
@@ -256,7 +256,7 @@ static struct i2c_adapter sch_adapter = { | |||
256 | .algo = &smbus_algorithm, | 256 | .algo = &smbus_algorithm, |
257 | }; | 257 | }; |
258 | 258 | ||
259 | static struct pci_device_id sch_ids[] = { | 259 | static const struct pci_device_id sch_ids[] = { |
260 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SCH_LPC) }, | 260 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SCH_LPC) }, |
261 | { 0, } | 261 | { 0, } |
262 | }; | 262 | }; |
diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c index ec11d1c4e77..4a700587ef1 100644 --- a/drivers/i2c/busses/i2c-nforce2.c +++ b/drivers/i2c/busses/i2c-nforce2.c | |||
@@ -308,7 +308,7 @@ static struct i2c_algorithm smbus_algorithm = { | |||
308 | }; | 308 | }; |
309 | 309 | ||
310 | 310 | ||
311 | static struct pci_device_id nforce2_ids[] = { | 311 | static const struct pci_device_id nforce2_ids[] = { |
312 | { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS) }, | 312 | { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS) }, |
313 | { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SMBUS) }, | 313 | { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SMBUS) }, |
314 | { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS) }, | 314 | { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS) }, |
diff --git a/drivers/i2c/busses/i2c-parport-light.c b/drivers/i2c/busses/i2c-parport-light.c index 322c5691e38..5f41ec0f72d 100644 --- a/drivers/i2c/busses/i2c-parport-light.c +++ b/drivers/i2c/busses/i2c-parport-light.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* ------------------------------------------------------------------------ * | 1 | /* ------------------------------------------------------------------------ * |
2 | * i2c-parport-light.c I2C bus over parallel port * | 2 | * i2c-parport-light.c I2C bus over parallel port * |
3 | * ------------------------------------------------------------------------ * | 3 | * ------------------------------------------------------------------------ * |
4 | Copyright (C) 2003-2007 Jean Delvare <khali@linux-fr.org> | 4 | Copyright (C) 2003-2010 Jean Delvare <khali@linux-fr.org> |
5 | 5 | ||
6 | Based on older i2c-velleman.c driver | 6 | Based on older i2c-velleman.c driver |
7 | Copyright (C) 1995-2000 Simon G. Vogl | 7 | Copyright (C) 1995-2000 Simon G. Vogl |
@@ -27,10 +27,12 @@ | |||
27 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
29 | #include <linux/init.h> | 29 | #include <linux/init.h> |
30 | #include <linux/delay.h> | ||
30 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
31 | #include <linux/ioport.h> | 32 | #include <linux/ioport.h> |
32 | #include <linux/i2c.h> | 33 | #include <linux/i2c.h> |
33 | #include <linux/i2c-algo-bit.h> | 34 | #include <linux/i2c-algo-bit.h> |
35 | #include <linux/i2c-smbus.h> | ||
34 | #include <asm/io.h> | 36 | #include <asm/io.h> |
35 | #include "i2c-parport.h" | 37 | #include "i2c-parport.h" |
36 | 38 | ||
@@ -43,6 +45,10 @@ static u16 base; | |||
43 | module_param(base, ushort, 0); | 45 | module_param(base, ushort, 0); |
44 | MODULE_PARM_DESC(base, "Base I/O address"); | 46 | MODULE_PARM_DESC(base, "Base I/O address"); |
45 | 47 | ||
48 | static int irq; | ||
49 | module_param(irq, int, 0); | ||
50 | MODULE_PARM_DESC(irq, "IRQ (optional)"); | ||
51 | |||
46 | /* ----- Low-level parallel port access ----------------------------------- */ | 52 | /* ----- Low-level parallel port access ----------------------------------- */ |
47 | 53 | ||
48 | static inline void port_write(unsigned char p, unsigned char d) | 54 | static inline void port_write(unsigned char p, unsigned char d) |
@@ -119,6 +125,16 @@ static struct i2c_adapter parport_adapter = { | |||
119 | .name = "Parallel port adapter (light)", | 125 | .name = "Parallel port adapter (light)", |
120 | }; | 126 | }; |
121 | 127 | ||
128 | /* SMBus alert support */ | ||
129 | static struct i2c_smbus_alert_setup alert_data = { | ||
130 | .alert_edge_triggered = 1, | ||
131 | }; | ||
132 | static struct i2c_client *ara; | ||
133 | static struct lineop parport_ctrl_irq = { | ||
134 | .val = (1 << 4), | ||
135 | .port = CTRL, | ||
136 | }; | ||
137 | |||
122 | static int __devinit i2c_parport_probe(struct platform_device *pdev) | 138 | static int __devinit i2c_parport_probe(struct platform_device *pdev) |
123 | { | 139 | { |
124 | int err; | 140 | int err; |
@@ -127,18 +143,39 @@ static int __devinit i2c_parport_probe(struct platform_device *pdev) | |||
127 | parport_setsda(NULL, 1); | 143 | parport_setsda(NULL, 1); |
128 | parport_setscl(NULL, 1); | 144 | parport_setscl(NULL, 1); |
129 | /* Other init if needed (power on...) */ | 145 | /* Other init if needed (power on...) */ |
130 | if (adapter_parm[type].init.val) | 146 | if (adapter_parm[type].init.val) { |
131 | line_set(1, &adapter_parm[type].init); | 147 | line_set(1, &adapter_parm[type].init); |
148 | /* Give powered devices some time to settle */ | ||
149 | msleep(100); | ||
150 | } | ||
132 | 151 | ||
133 | parport_adapter.dev.parent = &pdev->dev; | 152 | parport_adapter.dev.parent = &pdev->dev; |
134 | err = i2c_bit_add_bus(&parport_adapter); | 153 | err = i2c_bit_add_bus(&parport_adapter); |
135 | if (err) | 154 | if (err) { |
136 | dev_err(&pdev->dev, "Unable to register with I2C\n"); | 155 | dev_err(&pdev->dev, "Unable to register with I2C\n"); |
137 | return err; | 156 | return err; |
157 | } | ||
158 | |||
159 | /* Setup SMBus alert if supported */ | ||
160 | if (adapter_parm[type].smbus_alert && irq) { | ||
161 | alert_data.irq = irq; | ||
162 | ara = i2c_setup_smbus_alert(&parport_adapter, &alert_data); | ||
163 | if (ara) | ||
164 | line_set(1, &parport_ctrl_irq); | ||
165 | else | ||
166 | dev_warn(&pdev->dev, "Failed to register ARA client\n"); | ||
167 | } | ||
168 | |||
169 | return 0; | ||
138 | } | 170 | } |
139 | 171 | ||
140 | static int __devexit i2c_parport_remove(struct platform_device *pdev) | 172 | static int __devexit i2c_parport_remove(struct platform_device *pdev) |
141 | { | 173 | { |
174 | if (ara) { | ||
175 | line_set(0, &parport_ctrl_irq); | ||
176 | i2c_unregister_device(ara); | ||
177 | ara = NULL; | ||
178 | } | ||
142 | i2c_del_adapter(&parport_adapter); | 179 | i2c_del_adapter(&parport_adapter); |
143 | 180 | ||
144 | /* Un-init if needed (power off...) */ | 181 | /* Un-init if needed (power off...) */ |
@@ -205,6 +242,9 @@ static int __init i2c_parport_init(void) | |||
205 | if (!request_region(base, 3, DRVNAME)) | 242 | if (!request_region(base, 3, DRVNAME)) |
206 | return -EBUSY; | 243 | return -EBUSY; |
207 | 244 | ||
245 | if (irq != 0) | ||
246 | pr_info(DRVNAME ": using irq %d\n", irq); | ||
247 | |||
208 | if (!adapter_parm[type].getscl.val) | 248 | if (!adapter_parm[type].getscl.val) |
209 | parport_algo_data.getscl = NULL; | 249 | parport_algo_data.getscl = NULL; |
210 | 250 | ||
diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c index 0d8998610c7..220fca7f23a 100644 --- a/drivers/i2c/busses/i2c-parport.c +++ b/drivers/i2c/busses/i2c-parport.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* ------------------------------------------------------------------------ * | 1 | /* ------------------------------------------------------------------------ * |
2 | * i2c-parport.c I2C bus over parallel port * | 2 | * i2c-parport.c I2C bus over parallel port * |
3 | * ------------------------------------------------------------------------ * | 3 | * ------------------------------------------------------------------------ * |
4 | Copyright (C) 2003-2007 Jean Delvare <khali@linux-fr.org> | 4 | Copyright (C) 2003-2010 Jean Delvare <khali@linux-fr.org> |
5 | 5 | ||
6 | Based on older i2c-philips-par.c driver | 6 | Based on older i2c-philips-par.c driver |
7 | Copyright (C) 1995-2000 Simon G. Vogl | 7 | Copyright (C) 1995-2000 Simon G. Vogl |
@@ -27,9 +27,11 @@ | |||
27 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
29 | #include <linux/init.h> | 29 | #include <linux/init.h> |
30 | #include <linux/delay.h> | ||
30 | #include <linux/parport.h> | 31 | #include <linux/parport.h> |
31 | #include <linux/i2c.h> | 32 | #include <linux/i2c.h> |
32 | #include <linux/i2c-algo-bit.h> | 33 | #include <linux/i2c-algo-bit.h> |
34 | #include <linux/i2c-smbus.h> | ||
33 | #include "i2c-parport.h" | 35 | #include "i2c-parport.h" |
34 | 36 | ||
35 | /* ----- Device list ------------------------------------------------------ */ | 37 | /* ----- Device list ------------------------------------------------------ */ |
@@ -38,6 +40,8 @@ struct i2c_par { | |||
38 | struct pardevice *pdev; | 40 | struct pardevice *pdev; |
39 | struct i2c_adapter adapter; | 41 | struct i2c_adapter adapter; |
40 | struct i2c_algo_bit_data algo_data; | 42 | struct i2c_algo_bit_data algo_data; |
43 | struct i2c_smbus_alert_setup alert_data; | ||
44 | struct i2c_client *ara; | ||
41 | struct i2c_par *next; | 45 | struct i2c_par *next; |
42 | }; | 46 | }; |
43 | 47 | ||
@@ -143,6 +147,19 @@ static struct i2c_algo_bit_data parport_algo_data = { | |||
143 | 147 | ||
144 | /* ----- I2c and parallel port call-back functions and structures --------- */ | 148 | /* ----- I2c and parallel port call-back functions and structures --------- */ |
145 | 149 | ||
150 | void i2c_parport_irq(void *data) | ||
151 | { | ||
152 | struct i2c_par *adapter = data; | ||
153 | struct i2c_client *ara = adapter->ara; | ||
154 | |||
155 | if (ara) { | ||
156 | dev_dbg(&ara->dev, "SMBus alert received\n"); | ||
157 | i2c_handle_smbus_alert(ara); | ||
158 | } else | ||
159 | dev_dbg(&adapter->adapter.dev, | ||
160 | "SMBus alert received but no ARA client!\n"); | ||
161 | } | ||
162 | |||
146 | static void i2c_parport_attach (struct parport *port) | 163 | static void i2c_parport_attach (struct parport *port) |
147 | { | 164 | { |
148 | struct i2c_par *adapter; | 165 | struct i2c_par *adapter; |
@@ -154,8 +171,9 @@ static void i2c_parport_attach (struct parport *port) | |||
154 | } | 171 | } |
155 | 172 | ||
156 | pr_debug("i2c-parport: attaching to %s\n", port->name); | 173 | pr_debug("i2c-parport: attaching to %s\n", port->name); |
174 | parport_disable_irq(port); | ||
157 | adapter->pdev = parport_register_device(port, "i2c-parport", | 175 | adapter->pdev = parport_register_device(port, "i2c-parport", |
158 | NULL, NULL, NULL, PARPORT_FLAG_EXCL, NULL); | 176 | NULL, NULL, i2c_parport_irq, PARPORT_FLAG_EXCL, adapter); |
159 | if (!adapter->pdev) { | 177 | if (!adapter->pdev) { |
160 | printk(KERN_ERR "i2c-parport: Unable to register with parport\n"); | 178 | printk(KERN_ERR "i2c-parport: Unable to register with parport\n"); |
161 | goto ERROR0; | 179 | goto ERROR0; |
@@ -185,14 +203,29 @@ static void i2c_parport_attach (struct parport *port) | |||
185 | parport_setsda(port, 1); | 203 | parport_setsda(port, 1); |
186 | parport_setscl(port, 1); | 204 | parport_setscl(port, 1); |
187 | /* Other init if needed (power on...) */ | 205 | /* Other init if needed (power on...) */ |
188 | if (adapter_parm[type].init.val) | 206 | if (adapter_parm[type].init.val) { |
189 | line_set(port, 1, &adapter_parm[type].init); | 207 | line_set(port, 1, &adapter_parm[type].init); |
208 | /* Give powered devices some time to settle */ | ||
209 | msleep(100); | ||
210 | } | ||
190 | 211 | ||
191 | if (i2c_bit_add_bus(&adapter->adapter) < 0) { | 212 | if (i2c_bit_add_bus(&adapter->adapter) < 0) { |
192 | printk(KERN_ERR "i2c-parport: Unable to register with I2C\n"); | 213 | printk(KERN_ERR "i2c-parport: Unable to register with I2C\n"); |
193 | goto ERROR1; | 214 | goto ERROR1; |
194 | } | 215 | } |
195 | 216 | ||
217 | /* Setup SMBus alert if supported */ | ||
218 | if (adapter_parm[type].smbus_alert) { | ||
219 | adapter->alert_data.alert_edge_triggered = 1; | ||
220 | adapter->ara = i2c_setup_smbus_alert(&adapter->adapter, | ||
221 | &adapter->alert_data); | ||
222 | if (adapter->ara) | ||
223 | parport_enable_irq(port); | ||
224 | else | ||
225 | printk(KERN_WARNING "i2c-parport: Failed to register " | ||
226 | "ARA client\n"); | ||
227 | } | ||
228 | |||
196 | /* Add the new adapter to the list */ | 229 | /* Add the new adapter to the list */ |
197 | adapter->next = adapter_list; | 230 | adapter->next = adapter_list; |
198 | adapter_list = adapter; | 231 | adapter_list = adapter; |
@@ -213,6 +246,10 @@ static void i2c_parport_detach (struct parport *port) | |||
213 | for (prev = NULL, adapter = adapter_list; adapter; | 246 | for (prev = NULL, adapter = adapter_list; adapter; |
214 | prev = adapter, adapter = adapter->next) { | 247 | prev = adapter, adapter = adapter->next) { |
215 | if (adapter->pdev->port == port) { | 248 | if (adapter->pdev->port == port) { |
249 | if (adapter->ara) { | ||
250 | parport_disable_irq(port); | ||
251 | i2c_unregister_device(adapter->ara); | ||
252 | } | ||
216 | i2c_del_adapter(&adapter->adapter); | 253 | i2c_del_adapter(&adapter->adapter); |
217 | 254 | ||
218 | /* Un-init if needed (power off...) */ | 255 | /* Un-init if needed (power off...) */ |
diff --git a/drivers/i2c/busses/i2c-parport.h b/drivers/i2c/busses/i2c-parport.h index ed69d846cb9..a9f66816546 100644 --- a/drivers/i2c/busses/i2c-parport.h +++ b/drivers/i2c/busses/i2c-parport.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* ------------------------------------------------------------------------ * | 1 | /* ------------------------------------------------------------------------ * |
2 | * i2c-parport.h I2C bus over parallel port * | 2 | * i2c-parport.h I2C bus over parallel port * |
3 | * ------------------------------------------------------------------------ * | 3 | * ------------------------------------------------------------------------ * |
4 | Copyright (C) 2003-2004 Jean Delvare <khali@linux-fr.org> | 4 | Copyright (C) 2003-2010 Jean Delvare <khali@linux-fr.org> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
@@ -38,6 +38,7 @@ struct adapter_parm { | |||
38 | struct lineop getsda; | 38 | struct lineop getsda; |
39 | struct lineop getscl; | 39 | struct lineop getscl; |
40 | struct lineop init; | 40 | struct lineop init; |
41 | unsigned int smbus_alert:1; | ||
41 | }; | 42 | }; |
42 | 43 | ||
43 | static struct adapter_parm adapter_parm[] = { | 44 | static struct adapter_parm adapter_parm[] = { |
@@ -73,6 +74,7 @@ static struct adapter_parm adapter_parm[] = { | |||
73 | .setscl = { 0x01, DATA, 1 }, | 74 | .setscl = { 0x01, DATA, 1 }, |
74 | .getsda = { 0x10, STAT, 1 }, | 75 | .getsda = { 0x10, STAT, 1 }, |
75 | .init = { 0xf0, DATA, 0 }, | 76 | .init = { 0xf0, DATA, 0 }, |
77 | .smbus_alert = 1, | ||
76 | }, | 78 | }, |
77 | /* type 5: ADM1025, ADM1030 and ADM1031 evaluation boards */ | 79 | /* type 5: ADM1025, ADM1030 and ADM1031 evaluation boards */ |
78 | { | 80 | { |
diff --git a/drivers/i2c/busses/i2c-pasemi.c b/drivers/i2c/busses/i2c-pasemi.c index adf0fbb902f..0d20ff46a51 100644 --- a/drivers/i2c/busses/i2c-pasemi.c +++ b/drivers/i2c/busses/i2c-pasemi.c | |||
@@ -400,7 +400,7 @@ static void __devexit pasemi_smb_remove(struct pci_dev *dev) | |||
400 | kfree(smbus); | 400 | kfree(smbus); |
401 | } | 401 | } |
402 | 402 | ||
403 | static struct pci_device_id pasemi_smb_ids[] = { | 403 | static const struct pci_device_id pasemi_smb_ids[] = { |
404 | { PCI_DEVICE(0x1959, 0xa003) }, | 404 | { PCI_DEVICE(0x1959, 0xa003) }, |
405 | { 0, } | 405 | { 0, } |
406 | }; | 406 | }; |
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index e56e4b6823c..ee9da6fcf69 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c | |||
@@ -472,7 +472,7 @@ static struct i2c_adapter piix4_adapter = { | |||
472 | .algo = &smbus_algorithm, | 472 | .algo = &smbus_algorithm, |
473 | }; | 473 | }; |
474 | 474 | ||
475 | static struct pci_device_id piix4_ids[] = { | 475 | static const struct pci_device_id piix4_ids[] = { |
476 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3) }, | 476 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3) }, |
477 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_3) }, | 477 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_3) }, |
478 | { PCI_DEVICE(PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_3) }, | 478 | { PCI_DEVICE(PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_3) }, |
diff --git a/drivers/i2c/busses/i2c-sis5595.c b/drivers/i2c/busses/i2c-sis5595.c index 844569f7d8b..55a71370c79 100644 --- a/drivers/i2c/busses/i2c-sis5595.c +++ b/drivers/i2c/busses/i2c-sis5595.c | |||
@@ -369,7 +369,7 @@ static struct i2c_adapter sis5595_adapter = { | |||
369 | .algo = &smbus_algorithm, | 369 | .algo = &smbus_algorithm, |
370 | }; | 370 | }; |
371 | 371 | ||
372 | static struct pci_device_id sis5595_ids[] __devinitdata = { | 372 | static const struct pci_device_id sis5595_ids[] __devinitconst = { |
373 | { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503) }, | 373 | { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503) }, |
374 | { 0, } | 374 | { 0, } |
375 | }; | 375 | }; |
diff --git a/drivers/i2c/busses/i2c-sis630.c b/drivers/i2c/busses/i2c-sis630.c index 68cff7af701..2309c7f1bde 100644 --- a/drivers/i2c/busses/i2c-sis630.c +++ b/drivers/i2c/busses/i2c-sis630.c | |||
@@ -468,7 +468,7 @@ static struct i2c_adapter sis630_adapter = { | |||
468 | .algo = &smbus_algorithm, | 468 | .algo = &smbus_algorithm, |
469 | }; | 469 | }; |
470 | 470 | ||
471 | static struct pci_device_id sis630_ids[] __devinitdata = { | 471 | static const struct pci_device_id sis630_ids[] __devinitconst = { |
472 | { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503) }, | 472 | { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503) }, |
473 | { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC) }, | 473 | { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC) }, |
474 | { 0, } | 474 | { 0, } |
diff --git a/drivers/i2c/busses/i2c-sis96x.c b/drivers/i2c/busses/i2c-sis96x.c index 1649963b00d..d43d8f8943d 100644 --- a/drivers/i2c/busses/i2c-sis96x.c +++ b/drivers/i2c/busses/i2c-sis96x.c | |||
@@ -245,7 +245,7 @@ static struct i2c_adapter sis96x_adapter = { | |||
245 | .algo = &smbus_algorithm, | 245 | .algo = &smbus_algorithm, |
246 | }; | 246 | }; |
247 | 247 | ||
248 | static struct pci_device_id sis96x_ids[] = { | 248 | static const struct pci_device_id sis96x_ids[] = { |
249 | { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_SMBUS) }, | 249 | { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_SMBUS) }, |
250 | { 0, } | 250 | { 0, } |
251 | }; | 251 | }; |
diff --git a/drivers/i2c/busses/i2c-tiny-usb.c b/drivers/i2c/busses/i2c-tiny-usb.c index e29b6d5ba8e..b5b1bbf37d3 100644 --- a/drivers/i2c/busses/i2c-tiny-usb.c +++ b/drivers/i2c/busses/i2c-tiny-usb.c | |||
@@ -31,11 +31,13 @@ | |||
31 | #define CMD_I2C_IO_BEGIN (1<<0) | 31 | #define CMD_I2C_IO_BEGIN (1<<0) |
32 | #define CMD_I2C_IO_END (1<<1) | 32 | #define CMD_I2C_IO_END (1<<1) |
33 | 33 | ||
34 | /* i2c bit delay, default is 10us -> 100kHz */ | 34 | /* i2c bit delay, default is 10us -> 100kHz max |
35 | (in practice, due to additional delays in the i2c bitbanging | ||
36 | code this results in a i2c clock of about 50kHz) */ | ||
35 | static unsigned short delay = 10; | 37 | static unsigned short delay = 10; |
36 | module_param(delay, ushort, 0); | 38 | module_param(delay, ushort, 0); |
37 | MODULE_PARM_DESC(delay, "bit delay in microseconds, " | 39 | MODULE_PARM_DESC(delay, "bit delay in microseconds " |
38 | "e.g. 10 for 100kHz (default is 100kHz)"); | 40 | "(default is 10us for 100kHz max)"); |
39 | 41 | ||
40 | static int usb_read(struct i2c_adapter *adapter, int cmd, | 42 | static int usb_read(struct i2c_adapter *adapter, int cmd, |
41 | int value, int index, void *data, int len); | 43 | int value, int index, void *data, int len); |
@@ -137,7 +139,7 @@ static const struct i2c_algorithm usb_algorithm = { | |||
137 | * Future Technology Devices International Ltd., later a pair was | 139 | * Future Technology Devices International Ltd., later a pair was |
138 | * bought from EZPrototypes | 140 | * bought from EZPrototypes |
139 | */ | 141 | */ |
140 | static struct usb_device_id i2c_tiny_usb_table [] = { | 142 | static const struct usb_device_id i2c_tiny_usb_table[] = { |
141 | { USB_DEVICE(0x0403, 0xc631) }, /* FTDI */ | 143 | { USB_DEVICE(0x0403, 0xc631) }, /* FTDI */ |
142 | { USB_DEVICE(0x1c40, 0x0534) }, /* EZPrototypes */ | 144 | { USB_DEVICE(0x1c40, 0x0534) }, /* EZPrototypes */ |
143 | { } /* Terminating entry */ | 145 | { } /* Terminating entry */ |
diff --git a/drivers/i2c/busses/i2c-via.c b/drivers/i2c/busses/i2c-via.c index 8b24f192103..de78283bddb 100644 --- a/drivers/i2c/busses/i2c-via.c +++ b/drivers/i2c/busses/i2c-via.c | |||
@@ -89,7 +89,7 @@ static struct i2c_adapter vt586b_adapter = { | |||
89 | }; | 89 | }; |
90 | 90 | ||
91 | 91 | ||
92 | static struct pci_device_id vt586b_ids[] __devinitdata = { | 92 | static const struct pci_device_id vt586b_ids[] __devinitconst = { |
93 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3) }, | 93 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3) }, |
94 | { 0, } | 94 | { 0, } |
95 | }; | 95 | }; |
diff --git a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c index a84a909e123..d57292e5dae 100644 --- a/drivers/i2c/busses/i2c-viapro.c +++ b/drivers/i2c/busses/i2c-viapro.c | |||
@@ -444,7 +444,7 @@ release_region: | |||
444 | return error; | 444 | return error; |
445 | } | 445 | } |
446 | 446 | ||
447 | static struct pci_device_id vt596_ids[] = { | 447 | static const struct pci_device_id vt596_ids[] = { |
448 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596_3), | 448 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596_3), |
449 | .driver_data = SMBBA1 }, | 449 | .driver_data = SMBBA1 }, |
450 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596B_3), | 450 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596B_3), |