aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-11-09 12:58:31 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-11-09 12:58:31 -0500
commit799dd75b1a8380a967c929a4551895788c374b31 (patch)
tree7132aafc4ade16fda136d63f1be6ea867edde79b
parent6bee58259fce0baad7b02c7a48146d50fa7f6c3c (diff)
parentafa08974fe80c198b8650f73ed8ab59135ca10d0 (diff)
Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: i2c: Add an interface to lock/unlock an I2C bus segment i2c-piix4: Modify code name SB900 to Hudson-2
-rw-r--r--Documentation/i2c/busses/i2c-piix42
-rw-r--r--drivers/i2c/busses/Kconfig2
-rw-r--r--drivers/i2c/busses/i2c-piix4.c8
-rw-r--r--drivers/net/sfc/sfe4001.c4
-rw-r--r--include/linux/i2c.h18
-rw-r--r--include/linux/pci_ids.h2
6 files changed, 27 insertions, 9 deletions
diff --git a/Documentation/i2c/busses/i2c-piix4 b/Documentation/i2c/busses/i2c-piix4
index c5b37c570554..ac540c71c7eb 100644
--- a/Documentation/i2c/busses/i2c-piix4
+++ b/Documentation/i2c/busses/i2c-piix4
@@ -8,7 +8,7 @@ Supported adapters:
8 Datasheet: Only available via NDA from ServerWorks 8 Datasheet: Only available via NDA from ServerWorks
9 * ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges 9 * ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges
10 Datasheet: Not publicly available 10 Datasheet: Not publicly available
11 * AMD SB900 11 * AMD Hudson-2
12 Datasheet: Not publicly available 12 Datasheet: Not publicly available
13 * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge 13 * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge
14 Datasheet: Publicly available at the SMSC website http://www.smsc.com 14 Datasheet: Publicly available at the SMSC website http://www.smsc.com
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 737335ff2b21..e8fe7f169e25 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -128,7 +128,7 @@ config I2C_PIIX4
128 ATI SB600 128 ATI SB600
129 ATI SB700 129 ATI SB700
130 ATI SB800 130 ATI SB800
131 AMD SB900 131 AMD Hudson-2
132 Serverworks OSB4 132 Serverworks OSB4
133 Serverworks CSB5 133 Serverworks CSB5
134 Serverworks CSB6 134 Serverworks CSB6
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
index d26a972aacaa..1e245e9cad31 100644
--- a/drivers/i2c/busses/i2c-piix4.c
+++ b/drivers/i2c/busses/i2c-piix4.c
@@ -22,7 +22,7 @@
22 Intel PIIX4, 440MX 22 Intel PIIX4, 440MX
23 Serverworks OSB4, CSB5, CSB6, HT-1000, HT-1100 23 Serverworks OSB4, CSB5, CSB6, HT-1000, HT-1100
24 ATI IXP200, IXP300, IXP400, SB600, SB700, SB800 24 ATI IXP200, IXP300, IXP400, SB600, SB700, SB800
25 AMD SB900 25 AMD Hudson-2
26 SMSC Victory66 26 SMSC Victory66
27 27
28 Note: we assume there can only be one device, with one SMBus interface. 28 Note: we assume there can only be one device, with one SMBus interface.
@@ -233,9 +233,9 @@ static int __devinit piix4_setup_sb800(struct pci_dev *PIIX4_dev,
233 unsigned short smba_idx = 0xcd6; 233 unsigned short smba_idx = 0xcd6;
234 u8 smba_en_lo, smba_en_hi, i2ccfg, i2ccfg_offset = 0x10, smb_en = 0x2c; 234 u8 smba_en_lo, smba_en_hi, i2ccfg, i2ccfg_offset = 0x10, smb_en = 0x2c;
235 235
236 /* SB800 SMBus does not support forcing address */ 236 /* SB800 and later SMBus does not support forcing address */
237 if (force || force_addr) { 237 if (force || force_addr) {
238 dev_err(&PIIX4_dev->dev, "SB800 SMBus does not support " 238 dev_err(&PIIX4_dev->dev, "SMBus does not support "
239 "forcing address!\n"); 239 "forcing address!\n");
240 return -EINVAL; 240 return -EINVAL;
241 } 241 }
@@ -480,7 +480,7 @@ static struct pci_device_id piix4_ids[] = {
480 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_SMBUS) }, 480 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_SMBUS) },
481 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SMBUS) }, 481 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SMBUS) },
482 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS) }, 482 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS) },
483 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_SB900_SMBUS) }, 483 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SMBUS) },
484 { PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, 484 { PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS,
485 PCI_DEVICE_ID_SERVERWORKS_OSB4) }, 485 PCI_DEVICE_ID_SERVERWORKS_OSB4) },
486 { PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, 486 { PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS,
diff --git a/drivers/net/sfc/sfe4001.c b/drivers/net/sfc/sfe4001.c
index cee00ad49b57..49eb91b5f50c 100644
--- a/drivers/net/sfc/sfe4001.c
+++ b/drivers/net/sfc/sfe4001.c
@@ -188,7 +188,7 @@ static int sfn4111t_reset(struct efx_nic *efx)
188 efx_oword_t reg; 188 efx_oword_t reg;
189 189
190 /* GPIO 3 and the GPIO register are shared with I2C, so block that */ 190 /* GPIO 3 and the GPIO register are shared with I2C, so block that */
191 mutex_lock(&efx->i2c_adap.bus_lock); 191 i2c_lock_adapter(&efx->i2c_adap);
192 192
193 /* Pull RST_N (GPIO 2) low then let it up again, setting the 193 /* Pull RST_N (GPIO 2) low then let it up again, setting the
194 * FLASH_CFG_1 strap (GPIO 3) appropriately. Only change the 194 * FLASH_CFG_1 strap (GPIO 3) appropriately. Only change the
@@ -204,7 +204,7 @@ static int sfn4111t_reset(struct efx_nic *efx)
204 falcon_write(efx, &reg, GPIO_CTL_REG_KER); 204 falcon_write(efx, &reg, GPIO_CTL_REG_KER);
205 msleep(1); 205 msleep(1);
206 206
207 mutex_unlock(&efx->i2c_adap.bus_lock); 207 i2c_unlock_adapter(&efx->i2c_adap);
208 208
209 ssleep(1); 209 ssleep(1);
210 return 0; 210 return 0;
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 57d41b0abce2..7b40cda57a70 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -361,6 +361,24 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data)
361 dev_set_drvdata(&dev->dev, data); 361 dev_set_drvdata(&dev->dev, data);
362} 362}
363 363
364/**
365 * i2c_lock_adapter - Prevent access to an I2C bus segment
366 * @adapter: Target I2C bus segment
367 */
368static inline void i2c_lock_adapter(struct i2c_adapter *adapter)
369{
370 mutex_lock(&adapter->bus_lock);
371}
372
373/**
374 * i2c_unlock_adapter - Reauthorize access to an I2C bus segment
375 * @adapter: Target I2C bus segment
376 */
377static inline void i2c_unlock_adapter(struct i2c_adapter *adapter)
378{
379 mutex_unlock(&adapter->bus_lock);
380}
381
364/*flags for the client struct: */ 382/*flags for the client struct: */
365#define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ 383#define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */
366#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ 384#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index b0f0f3851cd4..9ceb392cb984 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -543,7 +543,7 @@
543#define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 543#define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450
544#define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 544#define PCI_DEVICE_ID_AMD_8131_APIC 0x7451
545#define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458 545#define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458
546#define PCI_DEVICE_ID_AMD_SB900_SMBUS 0x780b 546#define PCI_DEVICE_ID_AMD_HUDSON2_SMBUS 0x780b
547#define PCI_DEVICE_ID_AMD_CS5535_IDE 0x208F 547#define PCI_DEVICE_ID_AMD_CS5535_IDE 0x208F
548#define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 548#define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090
549#define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 549#define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091