mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-19 19:40:49 +00:00
(Kyösti)
* Fixed adapter drivers to compile with the new i2c structs. They might, or they might not work.. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@497 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
24e547b88e
commit
7ac5a6005f
6 files changed
+188
-90
No files matched your search
+18
-12
@@ -86,32 +86,38 @@ static int bit_via_getsda(void *data)
|
||||
return (0 != (inb(I2C_IN) & I2C_SDA) );
|
||||
}
|
||||
|
||||
static int bit_via_reg(struct i2c_client *client)
|
||||
static void bit_via_inc(struct i2c_adapter *adapter)
|
||||
{
|
||||
return 0;
|
||||
MOD_INC_USE_COUNT;
|
||||
}
|
||||
|
||||
static int bit_via_unreg(struct i2c_client *client)
|
||||
static void bit_via_dec(struct i2c_adapter *adapter)
|
||||
{
|
||||
return 0;
|
||||
MOD_DEC_USE_COUNT;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
static struct bit_adapter bit_via_ops = {
|
||||
"VIA i2c",
|
||||
HW_B_VIA,
|
||||
static struct i2c_algo_bit_data bit_data = {
|
||||
NULL,
|
||||
bit_via_setsda,
|
||||
bit_via_setscl,
|
||||
bit_via_getsda,
|
||||
bit_via_getscl,
|
||||
bit_via_reg,
|
||||
bit_via_unreg,
|
||||
5, 5, 100, /*waits, timeout */
|
||||
};
|
||||
|
||||
static struct i2c_adapter bit_via_ops = {
|
||||
"VIA i2c",
|
||||
I2C_HW_B_VIA,
|
||||
NULL,
|
||||
&bit_data,
|
||||
bit_via_inc,
|
||||
bit_via_dec,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
||||
/* When exactly was the new pci interface introduced? */
|
||||
#if LINUX_VERSION_CODE >= 0x020136 /* 2.1.54 */
|
||||
@@ -216,12 +222,12 @@ static int init_i2c_via(void)
|
||||
}
|
||||
|
||||
if (i2c_bit_add_bus(&bit_via_ops) == 0) {
|
||||
printk("Via i2c: Module succesfully loaded\n");
|
||||
printk("i2c-via.o: Module succesfully loaded\n");
|
||||
return 0;
|
||||
} else {
|
||||
outb(inb(I2C_DIR)&~(I2C_SDA|I2C_SCL), I2C_DIR);
|
||||
release_region(I2C_DIR, IOSPACE);
|
||||
printk("Via i2c: Algo-bit error, couldn't register bus\n");
|
||||
printk("i2c-via.o: Algo-bit error, couldn't register bus\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user