Changeset 711
- Timestamp:
- 01/28/00 02:05:40 (13 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/kernel/busses/i2c-voodoo3.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/kernel/busses/i2c-voodoo3.c
r707 r711 410 410 if (!ddc_rdat()) { 411 411 printk 412 ("i2c-voodoo3: I2C bus in use or hung! Try again later.\n");412 ("i2c-voodoo3: DDC bus in use or hung! Try again later.\n"); 413 413 return 1; 414 414 } … … 443 443 int Voodoo3_I2CRead_byte_data(int addr, int command) 444 444 { 445 int this_dat = 0;446 447 445 Voodoo3_I2CStart(); 448 if (Voodoo3_I2CSendByte(addr )) {446 if (Voodoo3_I2CSendByte(addr & 0xfe)) { 449 447 #ifdef DEBUG 450 448 printk … … 452 450 addr); 453 451 #endif 454 this_dat = -1;455 452 goto ENDREAD2; 456 453 } 457 if ( !Voodoo3_I2CSendByte(command)) {454 if (Voodoo3_I2CSendByte(command)) { 458 455 #ifdef DEBUG 459 456 printk … … 461 458 addr); 462 459 #endif 463 this_dat = -1;464 460 goto ENDREAD2; 465 461 } 466 this_dat = Voodoo3_I2CReadByte(0);462 return(Voodoo3_I2CRead_byte(addr)); 467 463 ENDREAD2:Voodoo3_I2CStop(); 468 464 #ifdef DEBUG 469 465 printk 470 ("i2c-voodoo3: Byte read at addr:0x%X (command:0x%X) result:0x%X\n",471 addr, command , this_dat);472 #endif 473 return this_dat;466 ("i2c-voodoo3: Byte read at addr:0x%X (command:0x%X) failed\n", 467 addr, command); 468 #endif 469 return(-1); 474 470 } 475 471 … … 637 633 int Voodoo3_DDCRead_byte_data(int addr, int command) 638 634 { 639 int this_dat = 0;640 641 635 Voodoo3_DDCStart(); 642 if (Voodoo3_DDCSendByte(addr)) { 643 this_dat = -1; 636 if (Voodoo3_DDCSendByte(addr & 0xfe)) 644 637 goto ENDREAD2; 645 } 646 if (!Voodoo3_DDCSendByte(command)) { 647 this_dat = -1; 638 if (Voodoo3_DDCSendByte(command)) 648 639 goto ENDREAD2; 649 } 650 this_dat = Voodoo3_DDCReadByte(0); 651 ENDREAD2:Voodoo3_DDCStop(); 652 return this_dat; 640 return(Voodoo3_DDCRead_byte(addr)); 641 ENDREAD2: Voodoo3_DDCStop(); 642 return (-1); 653 643 } 654 644
