Skip to content

Commit 799dd75

Browse files
committed
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
2 parents 6bee582 + afa0897 commit 799dd75

File tree

6 files changed

+27
-9
lines changed

6 files changed

+27
-9
lines changed

Documentation/i2c/busses/i2c-piix4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Supported adapters:
88
Datasheet: Only available via NDA from ServerWorks
99
* ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges
1010
Datasheet: Not publicly available
11-
* AMD SB900
11+
* AMD Hudson-2
1212
Datasheet: Not publicly available
1313
* Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge
1414
Datasheet: Publicly available at the SMSC website http://www.smsc.com

drivers/i2c/busses/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ config I2C_PIIX4
128128
ATI SB600
129129
ATI SB700
130130
ATI SB800
131-
AMD SB900
131+
AMD Hudson-2
132132
Serverworks OSB4
133133
Serverworks CSB5
134134
Serverworks CSB6

drivers/i2c/busses/i2c-piix4.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
Intel PIIX4, 440MX
2323
Serverworks OSB4, CSB5, CSB6, HT-1000, HT-1100
2424
ATI IXP200, IXP300, IXP400, SB600, SB700, SB800
25-
AMD SB900
25+
AMD Hudson-2
2626
SMSC Victory66
2727
2828
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,
233233
unsigned short smba_idx = 0xcd6;
234234
u8 smba_en_lo, smba_en_hi, i2ccfg, i2ccfg_offset = 0x10, smb_en = 0x2c;
235235

236-
/* SB800 SMBus does not support forcing address */
236+
/* SB800 and later SMBus does not support forcing address */
237237
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 "
239239
"forcing address!\n");
240240
return -EINVAL;
241241
}
@@ -480,7 +480,7 @@ static struct pci_device_id piix4_ids[] = {
480480
{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_SMBUS) },
481481
{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SMBUS) },
482482
{ 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) },
484484
{ PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS,
485485
PCI_DEVICE_ID_SERVERWORKS_OSB4) },
486486
{ PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS,

drivers/net/sfc/sfe4001.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static int sfn4111t_reset(struct efx_nic *efx)
188188
efx_oword_t reg;
189189

190190
/* 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);
192192

193193
/* Pull RST_N (GPIO 2) low then let it up again, setting the
194194
* FLASH_CFG_1 strap (GPIO 3) appropriately. Only change the
@@ -204,7 +204,7 @@ static int sfn4111t_reset(struct efx_nic *efx)
204204
falcon_write(efx, &reg, GPIO_CTL_REG_KER);
205205
msleep(1);
206206

207-
mutex_unlock(&efx->i2c_adap.bus_lock);
207+
i2c_unlock_adapter(&efx->i2c_adap);
208208

209209
ssleep(1);
210210
return 0;

include/linux/i2c.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,24 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data)
361361
dev_set_drvdata(&dev->dev, data);
362362
}
363363

364+
/**
365+
* i2c_lock_adapter - Prevent access to an I2C bus segment
366+
* @adapter: Target I2C bus segment
367+
*/
368+
static 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+
*/
377+
static inline void i2c_unlock_adapter(struct i2c_adapter *adapter)
378+
{
379+
mutex_unlock(&adapter->bus_lock);
380+
}
381+
364382
/*flags for the client struct: */
365383
#define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */
366384
#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */

include/linux/pci_ids.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@
543543
#define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450
544544
#define PCI_DEVICE_ID_AMD_8131_APIC 0x7451
545545
#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
547547
#define PCI_DEVICE_ID_AMD_CS5535_IDE 0x208F
548548
#define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090
549549
#define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091

0 commit comments

Comments
 (0)