diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-23 10:10:25 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-23 10:10:25 -0700 |
commit | feeedc6c820e1026453ad865076cee435f24d30a (patch) | |
tree | 3eae5251bef80944048df1915e180394e5b7818c /drivers/i2c | |
parent | a27028349ccbcec9dde9d6dbba9d4017ad9ad5ab (diff) | |
parent | 11f1f2afd6b07729b12aaba479344d7f12d88ff9 (diff) | |
download | linux-stable-feeedc6c820e1026453ad865076cee435f24d30a.tar.gz linux-stable-feeedc6c820e1026453ad865076cee435f24d30a.tar.bz2 linux-stable-feeedc6c820e1026453ad865076cee435f24d30a.zip |
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
i2c: Add info->archdata field
i2c: Inform about deprecated chips directory
i2c: Use pci_ioremap_bar()
Schedule removal of the legacy i2c device driver binding model
i2c: Clean up <linux/i2c.h>
i2c: Update and clean up writing-clients document
i2c: Drop 2-byte address block transfer defines
i2c: Delete legacy model documentation
i2c: Constify i2c_get_clientdata's parameter
i2c: Delete outdated client porting guide
i2c: Make clear what the class field of i2c_adapter is good for
i2c-algo-pcf: Fix typo in debugging log message
i2c-algo-pcf: Add adapter hooks around xfer begin and end
i2c-algo-pcf: Pass adapter data into ->waitforpin() method
i2c-i801: Add support for Intel Ibex Peak
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) { *status = get_pcf(adap, 1); #ifndef STUB_I2C while (timeout-- && (*status & I2C_PCF_PIN)) { - adap->waitforpin(); + adap->waitforpin(adap->data); *status = get_pcf(adap, 1); } if (*status & I2C_PCF_LAB) { @@ -208,7 +208,7 @@ static int pcf_init_8584 (struct i2c_algo_pcf_data *adap) return -ENXIO; } - printk(KERN_DEBUG "i2c-algo-pcf.o: deteted and initialized PCF8584.\n"); + printk(KERN_DEBUG "i2c-algo-pcf.o: detected and initialized PCF8584.\n"); return 0; } @@ -331,13 +331,16 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, int i; int ret=0, timeout, status; + if (adap->xfer_begin) + adap->xfer_begin(adap->data); /* Check for bus busy */ timeout = wait_for_bb(adap); if (timeout) { DEB2(printk(KERN_ERR "i2c-algo-pcf.o: " "Timeout waiting for BB in pcf_xfer\n");) - return -EIO; + i = -EIO; + goto out; } for (i = 0;ret >= 0 && i < num; i++) { @@ -359,12 +362,14 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, if (timeout) { if (timeout == -EINTR) { /* arbitration lost */ - return (-EINTR); + i = -EINTR; + goto out; } i2c_stop(adap); DEB2(printk(KERN_ERR "i2c-algo-pcf.o: Timeout waiting " "for PIN(1) in pcf_xfer\n");) - return (-EREMOTEIO); + i = -EREMOTEIO; + goto out; } #ifndef STUB_I2C @@ -372,7 +377,8 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, if (status & I2C_PCF_LRB) { i2c_stop(adap); DEB2(printk(KERN_ERR "i2c-algo-pcf.o: No LRB(1) in pcf_xfer\n");) - return (-EREMOTEIO); + i = -EREMOTEIO; + goto out; } #endif @@ -404,6 +410,9 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, } } +out: + if (adap->xfer_end) + adap->xfer_end(adap->data); return (i); } 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 ICH9 Tolapai ICH10 + PCH This driver can also be built as a module. If so, the module 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) return (clock); } -static void pcf_isa_waitforpin(void) { +static void pcf_isa_waitforpin(void *data) +{ DEFINE_WAIT(wait); int timeout = 2; 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, hydra_adap.name)) return -EBUSY; - hydra_bit_data.data = ioremap(base, pci_resource_len(dev, 0)); + hydra_bit_data.data = pci_ioremap_bar(dev, 0); if (hydra_bit_data.data == NULL) { release_mem_region(base+offsetof(struct Hydra, CachePD), 4); 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 @@ Tolapai 0x5032 32 hard yes yes yes ICH10 0x3a30 32 hard yes yes yes ICH10 0x3a60 32 hard yes yes yes + PCH 0x3b30 32 hard yes yes yes Features supported by this driver: Software PEC no @@ -576,6 +577,7 @@ static struct pci_device_id i801_ids[] = { { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TOLAPAI_1) }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_4) }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_5) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PCH_SMBUS) }, { 0, } }; @@ -599,6 +601,7 @@ static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id case PCI_DEVICE_ID_INTEL_TOLAPAI_1: case PCI_DEVICE_ID_INTEL_ICH10_4: case PCI_DEVICE_ID_INTEL_ICH10_5: + case PCI_DEVICE_ID_INTEL_PCH_SMBUS: i801_features |= FEATURE_I2C_BLOCK_READ; /* fall through */ 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 @@ # # Miscellaneous I2C chip drivers configuration # +# *** DEPRECATED! Do not add new entries! See Makefile *** +# menu "Miscellaneous I2C Chip support" 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 @@ # # Makefile for miscellaneous I2C chip drivers. # -# Think twice before you add a new driver to this directory. +# Do not add new drivers to this directory! It is DEPRECATED. +# # Device drivers are better grouped according to the functionality they # implement rather than to the bus they are connected to. In particular: # * 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) client->dev.platform_data = info->platform_data; + if (info->archdata) + client->dev.archdata = *info->archdata; + client->flags = info->flags; client->addr = info->addr; client->irq = info->irq; |