Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316350
b: refs/heads/master
c: edbeea6
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Kurtz authored and Jean Delvare committed Jul 24, 2012
1 parent 4c8c2c1 commit 334f5e2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 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: 70a1cc1952355404a5746c88757f5a444df52b04
refs/heads/master: edbeea63839cf0ea169c3e0737d49a96b2ca8388
21 changes: 11 additions & 10 deletions trunk/drivers/i2c/busses/i2c-i801.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@
#define SMBAUXCTL_CRC 1
#define SMBAUXCTL_E32B 2

/* kill bit for SMBHSTCNT */
#define SMBHSTCNT_KILL 2

/* Other settings */
#define MAX_RETRIES 400
#define ENABLE_INT9 0 /* set to 0x01 to enable - untested */
Expand All @@ -117,9 +114,13 @@
#define I801_PROC_CALL 0x10 /* unimplemented */
#define I801_BLOCK_DATA 0x14
#define I801_I2C_BLOCK_DATA 0x18 /* ICH5 and later */
#define I801_LAST_BYTE 0x20
#define I801_START 0x40
#define I801_PEC_EN 0x80 /* ICH3 and later */

/* I801 Host Control register bits */
#define SMBHSTCNT_INTREN 0x01
#define SMBHSTCNT_KILL 0x02
#define SMBHSTCNT_LAST_BYTE 0x20
#define SMBHSTCNT_START 0x40
#define SMBHSTCNT_PEC_EN 0x80 /* ICH3 and later */

/* I801 Hosts Status register bits */
#define SMBHSTSTS_BYTE_DONE 0x80
Expand Down Expand Up @@ -271,7 +272,7 @@ static int i801_transaction(struct i801_priv *priv, int xact)

/* the current contents of SMBHSTCNT can be overwritten, since PEC,
* INTREN, SMBSCMD are passed in xact */
outb_p(xact | I801_START, SMBHSTCNT(priv));
outb_p(xact | SMBHSTCNT_START, SMBHSTCNT(priv));

/* We will always wait for a fraction of a second! */
do {
Expand Down Expand Up @@ -323,7 +324,7 @@ static int i801_block_transaction_by_block(struct i801_priv *priv,
}

status = i801_transaction(priv, I801_BLOCK_DATA | ENABLE_INT9 |
I801_PEC_EN * hwpec);
(hwpec ? SMBHSTCNT_PEC_EN : 0));
if (status)
return status;

Expand Down Expand Up @@ -374,11 +375,11 @@ static int i801_block_transaction_byte_by_byte(struct i801_priv *priv,

for (i = 1; i <= len; i++) {
if (i == len && read_write == I2C_SMBUS_READ)
smbcmd |= I801_LAST_BYTE;
smbcmd |= SMBHSTCNT_LAST_BYTE;
outb_p(smbcmd | ENABLE_INT9, SMBHSTCNT(priv));

if (i == 1)
outb_p(inb(SMBHSTCNT(priv)) | I801_START,
outb_p(inb(SMBHSTCNT(priv)) | SMBHSTCNT_START,
SMBHSTCNT(priv));

/* We will always wait for a fraction of a second! */
Expand Down

0 comments on commit 334f5e2

Please sign in to comment.