Changeset 346

Show
Ignore:
Timestamp:
03/28/99 16:06:38 (10 years ago)
Author:
kmalkki
Message:

(Kyösti)

* Fixed i2c_probe to actually try some addresses, and

change the client->addr _only_ when we get a match.

* Algo-bit now scans the bus before registering it.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/i2c/MODIFICATIONS

    r246 r346  
    1111 
    1212Here come the changes: 
     13 
     14! Fixed i2c_probe bug 
     15 
     16* Algo-bit now scans the bus before registering the adapter. 
    1317 
    1418! Renamed #define HW_B_MB to HW_B_VIA in i2c.h 
  • lm-sensors/trunk/i2c/algo-bit.c

    r185 r346  
    572572        i2c_adap->retries = 3;          /* be replaced by defines       */ 
    573573        i2c_adaps[i] = i2c_adap; 
    574         i2c_add_adapter(i2c_adap); 
    575574 
    576575        /* scan bus */ 
     
    588587                printk("\n"); 
    589588        } 
     589         
     590        i2c_add_adapter(i2c_adap); 
     591         
    590592        return 0; 
    591593} 
     
    656658} 
    657659#endif 
    658  
    659  
    660  
    661  
    662  
    663  
    664  
    665  
    666  
    667  
  • lm-sensors/trunk/i2c/i2c-core.c

    r246 r346  
    419419        int i; 
    420420        struct i2c_msg msg; 
    421         struct i2c_msg *pmsg = &msg; 
    422421        msg.flags=client->flags & (I2C_M_TENMASK | I2C_M_TEN ); 
    423422        msg.buf = NULL; 
     
    425424        I2C_LOCK(client->adapter); 
    426425        for (i = low_addr; i <= hi_addr; i++) { 
    427                 client->addr=i; 
     426                msg.addr=i; 
    428427                /* TODO: implement a control statement in the algo layer  
    429428                 * that does address lookup only. 
    430429                 */ 
    431430                if (1 == client->adapter-> 
    432                     algo->master_xfer(client->adapter,pmsg,1)) 
     431                    algo->master_xfer(client->adapter,&msg,1)) 
    433432                        break; 
    434433        } 
    435434        I2C_UNLOCK(client->adapter); 
    436         return (i <= hi_addr) ? i : -1; 
     435        return (i <= hi_addr) ? (client->addr=i) : -1; 
    437436} 
    438437/* +++ frodo