From e9ac105d87fad3e3559b39147f322edfe61698d9 Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Mon, 27 Sep 1999 13:49:29 +0000 Subject: [PATCH] `functionality' support for all bus drivers git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@583 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/busses/i2c-ali15x3.c | 9 +++++++++ kernel/busses/i2c-i801.c | 9 +++++++++ kernel/busses/i2c-isa.c | 9 +++++++++ kernel/busses/i2c-piix4.c | 9 +++++++++ kernel/busses/i2c-viapro.c | 9 +++++++++ kernel/busses/i2c-voodoo3.c | 8 ++++++++ 6 files changed, 53 insertions(+) diff --git a/kernel/busses/i2c-ali15x3.c b/kernel/busses/i2c-ali15x3.c index 1772c5a7..48610637 100644 --- a/kernel/busses/i2c-ali15x3.c +++ b/kernel/busses/i2c-ali15x3.c @@ -164,6 +164,7 @@ static void ali15x3_do_pause( unsigned int amount ); static int ali15x3_transaction(void); static void ali15x3_inc(struct i2c_adapter *adapter); static void ali15x3_dec(struct i2c_adapter *adapter); +static u32 ali15x3_func(struct i2c_adapter *adapter); #ifdef MODULE extern int init_module(void); @@ -178,6 +179,7 @@ static struct i2c_algorithm smbus_algorithm = { /* slave_send */ NULL, /* slave_rcv */ NULL, /* algo_control */ NULL, + /* functionality */ ali15x3_func, }; static struct i2c_adapter ali15x3_adapter = { @@ -610,6 +612,13 @@ void ali15x3_dec(struct i2c_adapter *adapter) MOD_DEC_USE_COUNT; } +u32 ali15x3_func(struct i2c_adapter *adapter) +{ + return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | + I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | + I2C_FUNC_SMBUS_BLOCK_DATA; +} + int __init i2c_ali15x3_init(void) { int res; diff --git a/kernel/busses/i2c-i801.c b/kernel/busses/i2c-i801.c index af568825..6edd5603 100644 --- a/kernel/busses/i2c-i801.c +++ b/kernel/busses/i2c-i801.c @@ -94,6 +94,7 @@ static int i801_transaction(void); static int i801_block_transaction(union i2c_smbus_data *data, char read_write); static void i801_inc(struct i2c_adapter *adapter); static void i801_dec(struct i2c_adapter *adapter); +static u32 i801_func(struct i2c_adapter *adapter); #ifdef MODULE extern int init_module(void); @@ -108,6 +109,7 @@ static struct i2c_algorithm smbus_algorithm = { /* slave_send */ NULL, /* slave_rcv */ NULL, /* algo_control */ NULL, + /* functionality */ i801_func, }; static struct i2c_adapter i801_adapter = { @@ -559,6 +561,13 @@ void i801_dec(struct i2c_adapter *adapter) MOD_DEC_USE_COUNT; } +u32 i801_func(struct i2c_adapter *adapter) +{ + return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | + I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | + I2C_FUNC_SMBUS_BLOCK_DATA; +} + int __init i2c_i801_init(void) { int res; diff --git a/kernel/busses/i2c-isa.c b/kernel/busses/i2c-isa.c index 615d140e..77f11b71 100644 --- a/kernel/busses/i2c-isa.c +++ b/kernel/busses/i2c-isa.c @@ -43,6 +43,7 @@ static void isa_inc_use (struct i2c_adapter *adapter); static void isa_dec_use (struct i2c_adapter *adapter); +static u32 isa_func(struct i2c_adapter *adapter); #ifdef MODULE static @@ -62,9 +63,11 @@ static struct i2c_algorithm isa_algorithm = { /* name */ "ISA bus algorithm", /* id */ I2C_ALGO_ISA, /* master_xfer */ NULL, + /* smbus_access */ NULL, /* slave_send */ NULL, /* slave_rcv */ NULL, /* algo_control */ NULL, + /* functionality */ &isa_func, }; /* There can only be one... */ @@ -96,6 +99,12 @@ void isa_dec_use (struct i2c_adapter *adapter) #endif } +/* We can't do a thing... */ +static u32 isa_func(struct i2c_adapter *adapter) +{ + return 0; +} + int __init i2c_isa_init(void) { int res; diff --git a/kernel/busses/i2c-piix4.c b/kernel/busses/i2c-piix4.c index 58dfb6d8..ce719026 100644 --- a/kernel/busses/i2c-piix4.c +++ b/kernel/busses/i2c-piix4.c @@ -105,6 +105,7 @@ static void piix4_do_pause( unsigned int amount ); static int piix4_transaction(void); static void piix4_inc(struct i2c_adapter *adapter); static void piix4_dec(struct i2c_adapter *adapter); +static u32 piix4_func(struct i2c_adapter *adapter); #ifdef MODULE extern int init_module(void); @@ -119,6 +120,7 @@ static struct i2c_algorithm smbus_algorithm = { /* slave_send */ NULL, /* slave_rcv */ NULL, /* algo_control */ NULL, + /* functionality */ piix4_func, }; static struct i2c_adapter piix4_adapter = { @@ -446,6 +448,13 @@ void piix4_dec(struct i2c_adapter *adapter) MOD_DEC_USE_COUNT; } +u32 piix4_func(struct i2c_adapter *adapter) +{ + return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | + I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | + I2C_FUNC_SMBUS_BLOCK_DATA | I2C_FUNC_SMBUS_PROC_CALL; +} + int __init i2c_piix4_init(void) { int res; diff --git a/kernel/busses/i2c-viapro.c b/kernel/busses/i2c-viapro.c index c2fe81e1..79b5a011 100644 --- a/kernel/busses/i2c-viapro.c +++ b/kernel/busses/i2c-viapro.c @@ -122,6 +122,7 @@ static void vt596_do_pause( unsigned int amount ); static int vt596_transaction(void); static void vt596_inc(struct i2c_adapter *adapter); static void vt596_dec(struct i2c_adapter *adapter); +static u32 vt596_func(struct i2c_adapter *adapter); #ifdef MODULE extern int init_module(void); @@ -136,6 +137,7 @@ static struct i2c_algorithm smbus_algorithm = { /* slave_send */ NULL, /* slave_rcv */ NULL, /* algo_control */ NULL, + /* functionality */ vt596_func, }; static struct i2c_adapter vt596_adapter = { @@ -483,6 +485,13 @@ void vt596_dec(struct i2c_adapter *adapter) MOD_DEC_USE_COUNT; } +u32 vt596_func(struct i2c_adapter *adapter) +{ + return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | + I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | + I2C_FUNC_SMBUS_BLOCK_DATA; +} + int __init i2c_vt596_init(void) { int res; diff --git a/kernel/busses/i2c-voodoo3.c b/kernel/busses/i2c-voodoo3.c index c99798df..af7b4948 100644 --- a/kernel/busses/i2c-voodoo3.c +++ b/kernel/busses/i2c-voodoo3.c @@ -84,6 +84,7 @@ static int Voodoo3_I2CWrite_word(int addr,int command,long data); static void config_v3(struct pci_dev *dev, int num); static void voodoo3_inc(struct i2c_adapter *adapter); static void voodoo3_dec(struct i2c_adapter *adapter); +static u32 voodoo3_func(struct i2c_adapter *adapter); #ifdef MODULE extern int init_module(void); @@ -98,6 +99,7 @@ static struct i2c_algorithm smbus_algorithm = { /* slave_send */ NULL, /* slave_rcv */ NULL, /* algo_control */ NULL, + /* functionality */ voodoo3_func, }; static struct i2c_adapter voodoo3_adapter = { @@ -527,6 +529,12 @@ void voodoo3_dec(struct i2c_adapter *adapter) MOD_DEC_USE_COUNT; } +u32 voodoo3_func(struct i2c_adapter *adapter) +{ + return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | + I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA; +} + int __init i2c_voodoo3_init(void) { int res;