Changeset 5148 for lm-sensors/trunk/kernel/busses/i2c-i801.c
- Timestamp:
- 03/16/08 19:04:20 (4 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/kernel/busses/i2c-i801.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/kernel/busses/i2c-i801.c
r4946 r5148 40 40 of Intel's '810' and other chipsets. 41 41 See the doc/busses/i2c-i801 file for details. 42 I2C Block Read supported for ICH5 and higher.42 I2C Block Read not supported. 43 43 Block Process Call are not supported. 44 44 */ … … 146 146 #define I801_PROC_CALL 0x10 /* later chips only, unimplemented */ 147 147 #define I801_BLOCK_DATA 0x14 148 #define I801_I2C_BLOCK_DATA 0x18 /* ich4 and later*/148 #define I801_I2C_BLOCK_DATA 0x18 /* unimplemented */ 149 149 #define I801_BLOCK_LAST 0x34 150 150 #define I801_I2C_BLOCK_LAST 0x38 /* unimplemented */ … … 166 166 static struct pci_dev *I801_dev; 167 167 static int isich4; /* is PEC supported? */ 168 static int isich5; /* is i2c block read supported? */169 168 170 169 static int __devinit i801_setup(struct pci_dev *dev) … … 185 184 else 186 185 isich4 = 0; 187 isich5 = isich4 && dev->device != PCI_DEVICE_ID_INTEL_82801DB_3;188 186 189 187 /* Determine the address of the SMBus area */ … … 326 324 pci_write_config_byte(I801_dev, SMBHSTCFG, 327 325 hostc | SMBHSTCFG_I2C_EN); 328 } else if (!isich5){326 } else { 329 327 dev_err(I801_dev, 330 328 "I2C_SMBUS_I2C_BLOCK_READ unsupported!\n"); … … 348 346 if (i == len && read_write == I2C_SMBUS_READ) 349 347 smbcmd = I801_BLOCK_LAST; 350 else if (command == I2C_SMBUS_I2C_BLOCK_DATA &&351 read_write == I2C_SMBUS_READ)352 smbcmd = I801_I2C_BLOCK_DATA;353 348 else 354 349 smbcmd = I801_BLOCK_DATA; … … 419 414 420 415 if (i == 1 && read_write == I2C_SMBUS_READ) { 421 if (command != I2C_SMBUS_I2C_BLOCK_DATA) { 422 len = inb_p(SMBHSTDAT0); 423 if (len < 1) 424 len = 1; 425 if (len > I2C_SMBUS_BLOCK_MAX) 426 len = I2C_SMBUS_BLOCK_MAX; 427 data->block[0] = len; 428 } else { 429 /* if slave returns < 32 bytes transaction will fail */ 430 data->block[0] = 32; 431 } 416 len = inb_p(SMBHSTDAT0); 417 if (len < 1) 418 len = 1; 419 if (len > I2C_SMBUS_BLOCK_MAX) 420 len = I2C_SMBUS_BLOCK_MAX; 421 data->block[0] = len; 432 422 } 433 423 … … 592 582 | (isich4 ? I2C_FUNC_SMBUS_HWPEC_CALC : 0) 593 583 #endif 594 #if 0595 | (isich5 ? I2C_FUNC_SMBUS_READ_I2C_BLOCK596 : 0)597 #endif598 584 ; 599 585 }
