--- linux-2.6.9/drivers/i2c/chips/gl520sm.c.orig 2005-02-20 15:20:38.000000000 +0100 +++ linux-2.6.9/drivers/i2c/chips/gl520sm.c 2005-02-20 15:41:25.000000000 +0100 @@ -37,6 +37,9 @@ static unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END }; +static unsigned short normal_i2c_range[] = { I2C_CLIENT_END }; +static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END }; + /* Insmod parameters */ SENSORS_INSMOD_1(gl520sm); @@ -500,13 +503,25 @@ static int gl520_attach_adapter(struct i2c_adapter *adapter) { - if (!(adapter->clRD_DATA)) - goto exit; + if (!(adapter->class & I2C_CLASS_HWMON)) + return 0; + return i2c_detect(adapter, &addr_data, gl520_detect); +} +static int gl520_detect(struct i2c_adapter *adapter, int address, int kind) +{ + struct i2c_client *new_client; + struct gl520_data *data; + int err = 0; + + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA | + I2C_FUNC_SMBUS_WORD_DATA)) + goto exit; + /* OK. For now, we presume we have a valid client. We now create the client structure, even though we cannot fill it completely yet. But it allows us to access gl520_{read,write}_value. */ - + if (!(data = kmalloc(sizeof(struct gl520_data), GFP_KERNEL))) { err = -ENOMEM; goto exit;