Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296943
b: refs/heads/master
c: 84c1af4
h: refs/heads/master
i:
  296941: 4d0ca82
  296939: 74f6198
  296935: fb778e4
  296927: de85766
v: v3
  • Loading branch information
Jean Delvare authored and Jean Delvare committed Mar 26, 2012
1 parent 9981235 commit 949bc37
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 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: 062737fb6d90c632439b1f77ad6a4965cfc84a20
refs/heads/master: 84c1af4c21d645a02a4780cdf61c7551d8e7bb56
24 changes: 12 additions & 12 deletions trunk/drivers/i2c/busses/i2c-i801.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Copyright (c) 1998 - 2002 Frodo Looijaard <frodol@dds.nl>,
Philip Edelbrock <phil@netroedge.com>, and Mark D. Studebaker
<mdsxyz123@yahoo.com>
Copyright (C) 2007, 2008 Jean Delvare <khali@linux-fr.org>
Copyright (C) 2007 - 2012 Jean Delvare <khali@linux-fr.org>
Copyright (C) 2010 Intel Corporation,
David Woodhouse <dwmw2@infradead.org>
Expand Down Expand Up @@ -106,7 +106,7 @@
#define SMBHSTCNT_KILL 2

/* Other settings */
#define MAX_TIMEOUT 100
#define MAX_RETRIES 400
#define ENABLE_INT9 0 /* set to 0x01 to enable - untested */

/* I801 command constants */
Expand Down Expand Up @@ -217,7 +217,7 @@ static int i801_check_post(struct i801_priv *priv, int status, int timeout)
dev_dbg(&priv->pci_dev->dev, "Terminating the current operation\n");
outb_p(inb_p(SMBHSTCNT(priv)) | SMBHSTCNT_KILL,
SMBHSTCNT(priv));
msleep(1);
usleep_range(1000, 2000);
outb_p(inb_p(SMBHSTCNT(priv)) & (~SMBHSTCNT_KILL),
SMBHSTCNT(priv));

Expand Down Expand Up @@ -274,11 +274,11 @@ static int i801_transaction(struct i801_priv *priv, int xact)

/* We will always wait for a fraction of a second! */
do {
msleep(1);
usleep_range(250, 500);
status = inb_p(SMBHSTSTS(priv));
} while ((status & SMBHSTSTS_HOST_BUSY) && (timeout++ < MAX_TIMEOUT));
} while ((status & SMBHSTSTS_HOST_BUSY) && (timeout++ < MAX_RETRIES));

result = i801_check_post(priv, status, timeout > MAX_TIMEOUT);
result = i801_check_post(priv, status, timeout > MAX_RETRIES);
if (result < 0)
return result;

Expand All @@ -293,12 +293,12 @@ static void i801_wait_hwpec(struct i801_priv *priv)
int status;

do {
msleep(1);
usleep_range(250, 500);
status = inb_p(SMBHSTSTS(priv));
} while ((!(status & SMBHSTSTS_INTR))
&& (timeout++ < MAX_TIMEOUT));
&& (timeout++ < MAX_RETRIES));

if (timeout > MAX_TIMEOUT)
if (timeout > MAX_RETRIES)
dev_dbg(&priv->pci_dev->dev, "PEC Timeout!\n");

outb_p(status, SMBHSTSTS(priv));
Expand Down Expand Up @@ -382,12 +382,12 @@ static int i801_block_transaction_byte_by_byte(struct i801_priv *priv,
/* We will always wait for a fraction of a second! */
timeout = 0;
do {
msleep(1);
usleep_range(250, 500);
status = inb_p(SMBHSTSTS(priv));
} while ((!(status & SMBHSTSTS_BYTE_DONE))
&& (timeout++ < MAX_TIMEOUT));
&& (timeout++ < MAX_RETRIES));

result = i801_check_post(priv, status, timeout > MAX_TIMEOUT);
result = i801_check_post(priv, status, timeout > MAX_RETRIES);
if (result < 0)
return result;

Expand Down

0 comments on commit 949bc37

Please sign in to comment.