From c429a247f56d277f12eaffd6525922353e9539a5 Mon Sep 17 00:00:00 2001 From: Seth Heasley Date: Wed, 22 Oct 2008 20:21:29 +0200 Subject: i2c-i801: Add support for Intel Ibex Peak Adds the Intel Ibex Peak (PCH) SMBus Controller Device IDs. Signed-off-by: Seth Heasley Signed-off-by: Jean Delvare --- drivers/i2c/busses/Kconfig | 1 + drivers/i2c/busses/i2c-i801.c | 3 +++ 2 files changed, 4 insertions(+) (limited to 'drivers/i2c') 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-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: -- cgit v1.2.3 From 08e5338d119daeb3c7746fa80fa916b8d3d48e89 Mon Sep 17 00:00:00 2001 From: David Miller Date: Wed, 22 Oct 2008 20:21:29 +0200 Subject: i2c-algo-pcf: Pass adapter data into ->waitforpin() method Pass adapter data into ->waitforpin() method. Signed-off-by: David S. Miller Signed-off-by: Jean Delvare --- drivers/i2c/algos/i2c-algo-pcf.c | 2 +- drivers/i2c/busses/i2c-elektor.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/i2c') diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-pcf.c index 1e328d19cd6d..a8a5b6d1dd88 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) { 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; -- cgit v1.2.3 From 30091404af5a7cd515e7b565df76932e295d8f6f Mon Sep 17 00:00:00 2001 From: David Miller Date: Wed, 22 Oct 2008 20:21:30 +0200 Subject: i2c-algo-pcf: Add adapter hooks around xfer begin and end Some I2C bus implementations need to synchronize with external entities, such as system firmware, which might also be programming the same I2C bus. In order to facilitate this add ->xfer_begin() and ->xfer_end() hooks which are invoked around pcf_xfer(). [JD: Make these hooks optional.] Signed-off-by: David S. Miller Signed-off-by: Jean Delvare --- drivers/i2c/algos/i2c-algo-pcf.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'drivers/i2c') diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-pcf.c index a8a5b6d1dd88..b8a6f3bcbae3 100644 --- a/drivers/i2c/algos/i2c-algo-pcf.c +++ b/drivers/i2c/algos/i2c-algo-pcf.c @@ -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); } -- cgit v1.2.3 From a672b4c1b27c88062427b32e6392ea9a2a438b15 Mon Sep 17 00:00:00 2001 From: David Miller Date: Wed, 22 Oct 2008 20:21:30 +0200 Subject: i2c-algo-pcf: Fix typo in debugging log message Fix typo in debugging log message. deteted --> detected Signed-off-by: David S. Miller Signed-off-by: Jean Delvare --- drivers/i2c/algos/i2c-algo-pcf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/i2c') diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-pcf.c index b8a6f3bcbae3..3e01992230b8 100644 --- a/drivers/i2c/algos/i2c-algo-pcf.c +++ b/drivers/i2c/algos/i2c-algo-pcf.c @@ -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; } -- cgit v1.2.3 From c7a5f22d1f15a03d0bfed5b1795e3172b6309d86 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Wed, 22 Oct 2008 20:21:32 +0200 Subject: i2c: Use pci_ioremap_bar() Use the newly introduced pci_ioremap_bar() function in drivers/i2c. pci_ioremap_bar() just takes a pci device and a bar number, with the goal of making it really hard to get wrong, while also having a central place to stick sanity checks. Signed-off-by: Arjan van de Ven Signed-off-by: Jean Delvare --- drivers/i2c/busses/i2c-hydra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/i2c') 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; -- cgit v1.2.3 From 02cf617282c6917484410f86ded3f2d99a05f098 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Wed, 22 Oct 2008 20:21:33 +0200 Subject: i2c: Inform about deprecated chips directory The chips directory under drivers/i2c is deprecated. Spread the word! Signed-off-by: Wolfram Sang Signed-off-by: Jean Delvare --- drivers/i2c/chips/Kconfig | 2 ++ drivers/i2c/chips/Makefile | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/i2c') 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 -- cgit v1.2.3 From 11f1f2afd6b07729b12aaba479344d7f12d88ff9 Mon Sep 17 00:00:00 2001 From: Anton Vorontsov Date: Wed, 22 Oct 2008 20:21:33 +0200 Subject: i2c: Add info->archdata field If present the info->archdata is copied into the dev->archdata. Some (OpenFirmware) platforms need it. Signed-off-by: Anton Vorontsov Signed-off-by: Jean Delvare --- drivers/i2c/i2c-core.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/i2c') 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; -- cgit v1.2.3