diff options
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/algos/i2c-algo-pcf.c | 21 | ||||
-rw-r--r-- | drivers/i2c/busses/Kconfig | 1 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-elektor.c | 3 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-hydra.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-i801.c | 3 | ||||
-rw-r--r-- | drivers/i2c/chips/Kconfig | 2 | ||||
-rw-r--r-- | drivers/i2c/chips/Makefile | 3 | ||||
-rw-r--r-- | drivers/i2c/i2c-core.c | 3 |
8 files changed, 29 insertions, 9 deletions
diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-pcf.c index 1e328d19cd6d..3e01992230b8 100644 --- a/drivers/i2c/algos/i2c-algo-pcf.c +++ b/drivers/i2c/algos/i2c-algo-pcf.c | |||
@@ -135,7 +135,7 @@ static int wait_for_pin(struct i2c_algo_pcf_data *adap, int *status) { | |||
135 | *status = get_pcf(adap, 1); | 135 | *status = get_pcf(adap, 1); |
136 | #ifndef STUB_I2C | 136 | #ifndef STUB_I2C |
137 | while (timeout-- && (*status & I2C_PCF_PIN)) { | 137 | while (timeout-- && (*status & I2C_PCF_PIN)) { |
138 | adap->waitforpin(); | 138 | adap->waitforpin(adap->data); |
139 | *status = get_pcf(adap, 1); | 139 | *status = get_pcf(adap, 1); |
140 | } | 140 | } |
141 | if (*status & I2C_PCF_LAB) { | 141 | if (*status & I2C_PCF_LAB) { |
@@ -208,7 +208,7 @@ static int pcf_init_8584 (struct i2c_algo_pcf_data *adap) | |||
208 | return -ENXIO; | 208 | return -ENXIO; |
209 | } | 209 | } |
210 | 210 | ||
211 | printk(KERN_DEBUG "i2c-algo-pcf.o: deteted and initialized PCF8584.\n"); | 211 | printk(KERN_DEBUG "i2c-algo-pcf.o: detected and initialized PCF8584.\n"); |
212 | 212 | ||
213 | return 0; | 213 | return 0; |
214 | } | 214 | } |
@@ -331,13 +331,16 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, | |||
331 | int i; | 331 | int i; |
332 | int ret=0, timeout, status; | 332 | int ret=0, timeout, status; |
333 | 333 | ||
334 | if (adap->xfer_begin) | ||
335 | adap->xfer_begin(adap->data); | ||
334 | 336 | ||
335 | /* Check for bus busy */ | 337 | /* Check for bus busy */ |
336 | timeout = wait_for_bb(adap); | 338 | timeout = wait_for_bb(adap); |
337 | if (timeout) { | 339 | if (timeout) { |
338 | DEB2(printk(KERN_ERR "i2c-algo-pcf.o: " | 340 | DEB2(printk(KERN_ERR "i2c-algo-pcf.o: " |
339 | "Timeout waiting for BB in pcf_xfer\n");) | 341 | "Timeout waiting for BB in pcf_xfer\n");) |
340 | return -EIO; | 342 | i = -EIO; |
343 | goto out; | ||
341 | } | 344 | } |
342 | 345 | ||
343 | for (i = 0;ret >= 0 && i < num; i++) { | 346 | for (i = 0;ret >= 0 && i < num; i++) { |
@@ -359,12 +362,14 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, | |||
359 | if (timeout) { | 362 | if (timeout) { |
360 | if (timeout == -EINTR) { | 363 | if (timeout == -EINTR) { |
361 | /* arbitration lost */ | 364 | /* arbitration lost */ |
362 | return (-EINTR); | 365 | i = -EINTR; |
366 | goto out; | ||
363 | } | 367 | } |
364 | i2c_stop(adap); | 368 | i2c_stop(adap); |
365 | DEB2(printk(KERN_ERR "i2c-algo-pcf.o: Timeout waiting " | 369 | DEB2(printk(KERN_ERR "i2c-algo-pcf.o: Timeout waiting " |
366 | "for PIN(1) in pcf_xfer\n");) | 370 | "for PIN(1) in pcf_xfer\n");) |
367 | return (-EREMOTEIO); | 371 | i = -EREMOTEIO; |
372 | goto out; | ||
368 | } | 373 | } |
369 | 374 | ||
370 | #ifndef STUB_I2C | 375 | #ifndef STUB_I2C |
@@ -372,7 +377,8 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, | |||
372 | if (status & I2C_PCF_LRB) { | 377 | if (status & I2C_PCF_LRB) { |
373 | i2c_stop(adap); | 378 | i2c_stop(adap); |
374 | DEB2(printk(KERN_ERR "i2c-algo-pcf.o: No LRB(1) in pcf_xfer\n");) | 379 | DEB2(printk(KERN_ERR "i2c-algo-pcf.o: No LRB(1) in pcf_xfer\n");) |
375 | return (-EREMOTEIO); | 380 | i = -EREMOTEIO; |
381 | goto out; | ||
376 | } | 382 | } |
377 | #endif | 383 | #endif |
378 | 384 | ||
@@ -404,6 +410,9 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, | |||
404 | } | 410 | } |
405 | } | 411 | } |
406 | 412 | ||
413 | out: | ||
414 | if (adap->xfer_end) | ||
415 | adap->xfer_end(adap->data); | ||
407 | return (i); | 416 | return (i); |
408 | } | 417 | } |
409 | 418 | ||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index acadbc51fc0f..7f95905bbb9d 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig | |||
@@ -97,6 +97,7 @@ config I2C_I801 | |||
97 | ICH9 | 97 | ICH9 |
98 | Tolapai | 98 | Tolapai |
99 | ICH10 | 99 | ICH10 |
100 | PCH | ||
100 | 101 | ||
101 | This driver can also be built as a module. If so, the module | 102 | This driver can also be built as a module. If so, the module |
102 | will be called i2c-i801. | 103 | will be called i2c-i801. |
diff --git a/drivers/i2c/busses/i2c-elektor.c b/drivers/i2c/busses/i2c-elektor.c index 7f38c01fb3a0..0ed3ccb81b63 100644 --- a/drivers/i2c/busses/i2c-elektor.c +++ b/drivers/i2c/busses/i2c-elektor.c | |||
@@ -104,7 +104,8 @@ static int pcf_isa_getclock(void *data) | |||
104 | return (clock); | 104 | return (clock); |
105 | } | 105 | } |
106 | 106 | ||
107 | static void pcf_isa_waitforpin(void) { | 107 | static void pcf_isa_waitforpin(void *data) |
108 | { | ||
108 | DEFINE_WAIT(wait); | 109 | DEFINE_WAIT(wait); |
109 | int timeout = 2; | 110 | int timeout = 2; |
110 | unsigned long flags; | 111 | unsigned long flags; |
diff --git a/drivers/i2c/busses/i2c-hydra.c b/drivers/i2c/busses/i2c-hydra.c index 1098f21ace13..648aa7baff83 100644 --- a/drivers/i2c/busses/i2c-hydra.c +++ b/drivers/i2c/busses/i2c-hydra.c | |||
@@ -123,7 +123,7 @@ static int __devinit hydra_probe(struct pci_dev *dev, | |||
123 | hydra_adap.name)) | 123 | hydra_adap.name)) |
124 | return -EBUSY; | 124 | return -EBUSY; |
125 | 125 | ||
126 | hydra_bit_data.data = ioremap(base, pci_resource_len(dev, 0)); | 126 | hydra_bit_data.data = pci_ioremap_bar(dev, 0); |
127 | if (hydra_bit_data.data == NULL) { | 127 | if (hydra_bit_data.data == NULL) { |
128 | release_mem_region(base+offsetof(struct Hydra, CachePD), 4); | 128 | release_mem_region(base+offsetof(struct Hydra, CachePD), 4); |
129 | return -ENODEV; | 129 | return -ENODEV; |
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index dc7ea32b69a8..5123eb69a971 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c | |||
@@ -41,6 +41,7 @@ | |||
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 | 45 | ||
45 | Features supported by this driver: | 46 | Features supported by this driver: |
46 | Software PEC no | 47 | Software PEC no |
@@ -576,6 +577,7 @@ static struct pci_device_id i801_ids[] = { | |||
576 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TOLAPAI_1) }, | 577 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TOLAPAI_1) }, |
577 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_4) }, | 578 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_4) }, |
578 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_5) }, | 579 | { 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) }, | ||
579 | { 0, } | 581 | { 0, } |
580 | }; | 582 | }; |
581 | 583 | ||
@@ -599,6 +601,7 @@ static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id | |||
599 | case PCI_DEVICE_ID_INTEL_TOLAPAI_1: | 601 | case PCI_DEVICE_ID_INTEL_TOLAPAI_1: |
600 | case PCI_DEVICE_ID_INTEL_ICH10_4: | 602 | case PCI_DEVICE_ID_INTEL_ICH10_4: |
601 | case PCI_DEVICE_ID_INTEL_ICH10_5: | 603 | case PCI_DEVICE_ID_INTEL_ICH10_5: |
604 | case PCI_DEVICE_ID_INTEL_PCH_SMBUS: | ||
602 | i801_features |= FEATURE_I2C_BLOCK_READ; | 605 | i801_features |= FEATURE_I2C_BLOCK_READ; |
603 | /* fall through */ | 606 | /* fall through */ |
604 | case PCI_DEVICE_ID_INTEL_82801DB_3: | 607 | case PCI_DEVICE_ID_INTEL_82801DB_3: |
diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig index 17356827b93d..4c35702830ce 100644 --- a/drivers/i2c/chips/Kconfig +++ b/drivers/i2c/chips/Kconfig | |||
@@ -1,6 +1,8 @@ | |||
1 | # | 1 | # |
2 | # Miscellaneous I2C chip drivers configuration | 2 | # Miscellaneous I2C chip drivers configuration |
3 | # | 3 | # |
4 | # *** DEPRECATED! Do not add new entries! See Makefile *** | ||
5 | # | ||
4 | 6 | ||
5 | menu "Miscellaneous I2C Chip support" | 7 | menu "Miscellaneous I2C Chip support" |
6 | 8 | ||
diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile index ca520fa143d6..23d2a31b0a64 100644 --- a/drivers/i2c/chips/Makefile +++ b/drivers/i2c/chips/Makefile | |||
@@ -1,7 +1,8 @@ | |||
1 | # | 1 | # |
2 | # Makefile for miscellaneous I2C chip drivers. | 2 | # Makefile for miscellaneous I2C chip drivers. |
3 | # | 3 | # |
4 | # Think twice before you add a new driver to this directory. | 4 | # Do not add new drivers to this directory! It is DEPRECATED. |
5 | # | ||
5 | # Device drivers are better grouped according to the functionality they | 6 | # Device drivers are better grouped according to the functionality they |
6 | # implement rather than to the bus they are connected to. In particular: | 7 | # implement rather than to the bus they are connected to. In particular: |
7 | # * Hardware monitoring chip drivers go to drivers/hwmon | 8 | # * Hardware monitoring chip drivers go to drivers/hwmon |
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 42e852d79ffa..5a485c22660a 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -266,6 +266,9 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info) | |||
266 | 266 | ||
267 | client->dev.platform_data = info->platform_data; | 267 | client->dev.platform_data = info->platform_data; |
268 | 268 | ||
269 | if (info->archdata) | ||
270 | client->dev.archdata = *info->archdata; | ||
271 | |||
269 | client->flags = info->flags; | 272 | client->flags = info->flags; |
270 | client->addr = info->addr; | 273 | client->addr = info->addr; |
271 | client->irq = info->irq; | 274 | client->irq = info->irq; |