aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/i2c/busses/i2c-i801.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 27e7894a9d1c..4f63195069da 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -388,7 +388,7 @@ static int i801_block_transaction(union i2c_smbus_data *data, char read_write,
388 goto END; 388 goto END;
389 } 389 }
390 390
391 if (hwpec && command == I2C_SMBUS_BLOCK_DATA) { 391 if (hwpec) {
392 /* wait for INTR bit as advised by Intel */ 392 /* wait for INTR bit as advised by Intel */
393 timeout = 0; 393 timeout = 0;
394 do { 394 do {
@@ -416,12 +416,13 @@ static s32 i801_access(struct i2c_adapter * adap, u16 addr,
416 unsigned short flags, char read_write, u8 command, 416 unsigned short flags, char read_write, u8 command,
417 int size, union i2c_smbus_data * data) 417 int size, union i2c_smbus_data * data)
418{ 418{
419 int hwpec = 0; 419 int hwpec;
420 int block = 0; 420 int block = 0;
421 int ret, xact = 0; 421 int ret, xact = 0;
422 422
423 if(isich4) 423 hwpec = isich4 && (flags & I2C_CLIENT_PEC)
424 hwpec = (flags & I2C_CLIENT_PEC) != 0; 424 && size != I2C_SMBUS_QUICK
425 && size != I2C_SMBUS_I2C_BLOCK_DATA;
425 426
426 switch (size) { 427 switch (size) {
427 case I2C_SMBUS_QUICK: 428 case I2C_SMBUS_QUICK:
@@ -467,11 +468,9 @@ static s32 i801_access(struct i2c_adapter * adap, u16 addr,
467 return -1; 468 return -1;
468 } 469 }
469 470
470 if(isich4 && hwpec) { 471 if (hwpec)
471 if(size != I2C_SMBUS_QUICK && 472 outb_p(1, SMBAUXCTL); /* enable hardware PEC */
472 size != I2C_SMBUS_I2C_BLOCK_DATA) 473
473 outb_p(1, SMBAUXCTL); /* enable HW PEC */
474 }
475 if(block) 474 if(block)
476 ret = i801_block_transaction(data, read_write, size, hwpec); 475 ret = i801_block_transaction(data, read_write, size, hwpec);
477 else { 476 else {
@@ -479,11 +478,8 @@ static s32 i801_access(struct i2c_adapter * adap, u16 addr,
479 ret = i801_transaction(); 478 ret = i801_transaction();
480 } 479 }
481 480
482 if(isich4 && hwpec) { 481 if (hwpec)
483 if(size != I2C_SMBUS_QUICK && 482 outb_p(0, SMBAUXCTL); /* disable hardware PEC */
484 size != I2C_SMBUS_I2C_BLOCK_DATA)
485 outb_p(0, SMBAUXCTL);
486 }
487 483
488 if(block) 484 if(block)
489 return ret; 485 return ret;