Changeset 4625
- Timestamp:
- 07/18/07 23:02:42 (1 year ago)
- Files:
-
- lm-sensors/trunk/kernel/busses/i2c-i801.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/trunk/kernel/busses/i2c-i801.c
r4278 r4625 23 23 /* 24 24 SUPPORTED DEVICES PCI ID 25 82801AA 2413 26 82801AB 2423 27 82801BA 2443 28 82801CA/CAM 2483 25 82801AA 2413 26 82801AB 2423 27 82801BA 2443 28 82801CA/CAM 2483 29 29 82801DB 24C3 (HW PEC supported, 32 byte buffer not supported) 30 30 82801EB 24D3 (HW PEC supported, 32 byte buffer not supported) … … 158 158 "EXTREMELY DANGEROUS!"); 159 159 160 static int i801_transaction(void);161 static int i801_block_transaction(union i2c_smbus_data *data, char read_write,162 int command, int hwpec);163 164 160 static unsigned short i801_smba; 165 161 static struct pci_driver i801_driver; … … 176 172 dev->device == PCI_DEVICE_ID_INTEL_82801EB_3 || 177 173 dev->device == PCI_DEVICE_ID_INTEL_ESB_4 || 178 dev->device == PCI_DEVICE_ID_INTEL_ESB2_17 || 174 dev->device == PCI_DEVICE_ID_INTEL_ESB2_17 || 179 175 dev->device == PCI_DEVICE_ID_INTEL_ICH6_16 || 180 176 dev->device == PCI_DEVICE_ID_INTEL_ICH7_17 || … … 336 332 if (len < 1) 337 333 len = 1; 338 if (len > 32)339 len = 32;334 if (len > I2C_SMBUS_BLOCK_MAX) 335 len = I2C_SMBUS_BLOCK_MAX; 340 336 outb_p(len, SMBHSTDAT0); 341 337 outb_p(data->block[1], SMBBLKDAT); … … 344 340 } 345 341 346 if(isich4 && command != I2C_SMBUS_I2C_BLOCK_DATA) {347 /* set 32 byte buffer */348 }349 350 342 for (i = 1; i <= len; i++) { 351 343 if (i == len && read_write == I2C_SMBUS_READ) 352 344 smbcmd = I801_BLOCK_LAST; 353 345 else if (command == I2C_SMBUS_I2C_BLOCK_DATA && 354 read_write == I2C_SMBUS_READ)346 read_write == I2C_SMBUS_READ) 355 347 smbcmd = I801_I2C_BLOCK_DATA; 356 348 else … … 366 358 temp = inb_p(SMBHSTSTS); 367 359 if (i == 1) { 368 /* Errone nous conditions before transaction:360 /* Erroneous conditions before transaction: 369 361 * Byte_Done, Failed, Bus_Err, Dev_Err, Intr, Host_Busy */ 370 errmask =0x9f;362 errmask = 0x9f; 371 363 } else { 372 /* Errone nous conditions during transaction:364 /* Erroneous conditions during transaction: 373 365 * Failed, Bus_Err, Dev_Err, Intr */ 374 errmask =0x1e;366 errmask = 0x1e; 375 367 } 376 368 if (temp & errmask) { … … 382 374 "Reset failed! (%02x)\n", temp); 383 375 result = -1; 384 goto END;376 goto END; 385 377 } 386 378 if (i != 1) { … … 400 392 temp = inb_p(SMBHSTSTS); 401 393 } 402 while ((!(temp & 0x80))403 && (timeout++ < MAX_TIMEOUT));394 while ((!(temp & 0x80)) 395 && (timeout++ < MAX_TIMEOUT)); 404 396 405 397 /* If the SMBus is still busy, we give up */ … … 426 418 if (len < 1) 427 419 len = 1; 428 if (len > 32)429 len = 32;420 if (len > I2C_SMBUS_BLOCK_MAX) 421 len = I2C_SMBUS_BLOCK_MAX; 430 422 data->block[0] = len; 431 423 } else { … … 469 461 dev_dbg(I801_dev, "PEC Timeout!\n"); 470 462 } 471 outb_p(temp, SMBHSTSTS); 463 outb_p(temp, SMBHSTSTS); 472 464 } 473 465 result = 0; … … 597 589 #if 0 598 590 | (isich5 ? I2C_FUNC_SMBUS_READ_I2C_BLOCK 599 : 0)591 : 0) 600 592 #endif 601 593 ;
