Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96385
b: refs/heads/master
c: b1c1759
h: refs/heads/master
i:
  96383: 1fe4752
v: v3
  • Loading branch information
David Milburn authored and Jean Delvare committed May 11, 2008
1 parent 9a90613 commit 943f0ac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f5fff3602a67ff8c98fccdbf15959780be542802
refs/heads/master: b1c1759cd192fe1d27989f986c7f6b2939905e0c
15 changes: 12 additions & 3 deletions trunk/drivers/i2c/busses/i2c-piix4.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ MODULE_PARM_DESC(force_addr,
static int piix4_transaction(void);

static unsigned short piix4_smba;
static int srvrworks_csb5_delay;
static struct pci_driver piix4_driver;
static struct i2c_adapter piix4_adapter;

Expand All @@ -122,6 +123,10 @@ static int __devinit piix4_setup(struct pci_dev *PIIX4_dev,

dev_info(&PIIX4_dev->dev, "Found %s device\n", pci_name(PIIX4_dev));

if ((PIIX4_dev->vendor == PCI_VENDOR_ID_SERVERWORKS) &&
(PIIX4_dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5))
srvrworks_csb5_delay = 1;

/* Don't access SMBus on IBM systems which get corrupted eeproms */
if (dmi_check_system(piix4_dmi_table) &&
PIIX4_dev->vendor == PCI_VENDOR_ID_INTEL) {
Expand Down Expand Up @@ -230,10 +235,14 @@ static int piix4_transaction(void)
outb_p(inb(SMBHSTCNT) | 0x040, SMBHSTCNT);

/* We will always wait for a fraction of a second! (See PIIX4 docs errata) */
do {
if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */
msleep(2);
else
msleep(1);

while ((timeout++ < MAX_TIMEOUT) &&
((temp = inb_p(SMBHSTSTS)) & 0x01))
msleep(1);
temp = inb_p(SMBHSTSTS);
} while ((temp & 0x01) && (timeout++ < MAX_TIMEOUT));

/* If the SMBus is still busy, we give up */
if (timeout >= MAX_TIMEOUT) {
Expand Down

0 comments on commit 943f0ac

Please sign in to comment.