Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10652
b: refs/heads/master
c: e8aac4a
h: refs/heads/master
v: v3
  • Loading branch information
Jean Delvare authored and Greg Kroah-Hartman committed Oct 28, 2005
1 parent 173f721 commit 94b174e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 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: 585b3160f8212e58325bc1c0292c2ec01ac5db84
refs/heads/master: e8aac4a9b417643dd9739b48473790a09b8b6cbe
24 changes: 10 additions & 14 deletions trunk/drivers/i2c/busses/i2c-i801.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ static int i801_block_transaction(union i2c_smbus_data *data, char read_write,
goto END;
}

if (hwpec && command == I2C_SMBUS_BLOCK_DATA) {
if (hwpec) {
/* wait for INTR bit as advised by Intel */
timeout = 0;
do {
Expand Down Expand Up @@ -416,12 +416,13 @@ static s32 i801_access(struct i2c_adapter * adap, u16 addr,
unsigned short flags, char read_write, u8 command,
int size, union i2c_smbus_data * data)
{
int hwpec = 0;
int hwpec;
int block = 0;
int ret, xact = 0;

if(isich4)
hwpec = (flags & I2C_CLIENT_PEC) != 0;
hwpec = isich4 && (flags & I2C_CLIENT_PEC)
&& size != I2C_SMBUS_QUICK
&& size != I2C_SMBUS_I2C_BLOCK_DATA;

switch (size) {
case I2C_SMBUS_QUICK:
Expand Down Expand Up @@ -467,23 +468,18 @@ static s32 i801_access(struct i2c_adapter * adap, u16 addr,
return -1;
}

if(isich4 && hwpec) {
if(size != I2C_SMBUS_QUICK &&
size != I2C_SMBUS_I2C_BLOCK_DATA)
outb_p(1, SMBAUXCTL); /* enable HW PEC */
}
if (hwpec)
outb_p(1, SMBAUXCTL); /* enable hardware PEC */

if(block)
ret = i801_block_transaction(data, read_write, size, hwpec);
else {
outb_p(xact | ENABLE_INT9, SMBHSTCNT);
ret = i801_transaction();
}

if(isich4 && hwpec) {
if(size != I2C_SMBUS_QUICK &&
size != I2C_SMBUS_I2C_BLOCK_DATA)
outb_p(0, SMBAUXCTL);
}
if (hwpec)
outb_p(0, SMBAUXCTL); /* disable hardware PEC */

if(block)
return ret;
Expand Down

0 comments on commit 94b174e

Please sign in to comment.