mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-06 15:51:34 +00:00
(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. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@346 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
41c531511a
commit
cb505753d1
3 files changed
+10
-15
No files matched your search
@@ -11,6 +11,10 @@ The current version of Simon's code is called mod-19990118.tar.gz.
|
||||
|
||||
Here come the changes:
|
||||
|
||||
! Fixed i2c_probe bug
|
||||
|
||||
* Algo-bit now scans the bus before registering the adapter.
|
||||
|
||||
! Renamed #define HW_B_MB to HW_B_VIA in i2c.h
|
||||
|
||||
! Added '#include <linux/page.h>' to i2c.h, to make it compile with 2.2
|
||||
|
||||
+3
-11
@@ -571,7 +571,6 @@ int i2c_bit_add_bus(struct bit_adapter *adap)
|
||||
i2c_adap->timeout = 100; /* default values, should */
|
||||
i2c_adap->retries = 3; /* be replaced by defines */
|
||||
i2c_adaps[i] = i2c_adap;
|
||||
i2c_add_adapter(i2c_adap);
|
||||
|
||||
/* scan bus */
|
||||
if (bit_scan) {
|
||||
@@ -587,6 +586,9 @@ int i2c_bit_add_bus(struct bit_adapter *adap)
|
||||
}
|
||||
printk("\n");
|
||||
}
|
||||
|
||||
i2c_add_adapter(i2c_adap);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -655,13 +657,3 @@ void cleanup_module(void)
|
||||
i2c_del_algorithm(&bit_algo);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+3
-4
@@ -418,22 +418,21 @@ int i2c_probe(struct i2c_client *client, int low_addr, int hi_addr)
|
||||
{
|
||||
int i;
|
||||
struct i2c_msg msg;
|
||||
struct i2c_msg *pmsg = &msg;
|
||||
msg.flags=client->flags & (I2C_M_TENMASK | I2C_M_TEN );
|
||||
msg.buf = NULL;
|
||||
msg.len = 0;
|
||||
I2C_LOCK(client->adapter);
|
||||
for (i = low_addr; i <= hi_addr; i++) {
|
||||
client->addr=i;
|
||||
msg.addr=i;
|
||||
/* TODO: implement a control statement in the algo layer
|
||||
* that does address lookup only.
|
||||
*/
|
||||
if (1 == client->adapter->
|
||||
algo->master_xfer(client->adapter,pmsg,1))
|
||||
algo->master_xfer(client->adapter,&msg,1))
|
||||
break;
|
||||
}
|
||||
I2C_UNLOCK(client->adapter);
|
||||
return (i <= hi_addr) ? i : -1;
|
||||
return (i <= hi_addr) ? (client->addr=i) : -1;
|
||||
}
|
||||
/* +++ frodo
|
||||
* return id number for a specific adapter
|
||||
|
||||
Reference in new issue
Block a user