diff options
Diffstat (limited to 'drivers/hwmon/max6650.c')
-rw-r--r-- | drivers/hwmon/max6650.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c index 58f66be61b1f..a0160ee5caef 100644 --- a/drivers/hwmon/max6650.c +++ b/drivers/hwmon/max6650.c | |||
@@ -62,8 +62,6 @@ module_param(fan_voltage, int, S_IRUGO); | |||
62 | module_param(prescaler, int, S_IRUGO); | 62 | module_param(prescaler, int, S_IRUGO); |
63 | module_param(clock, int, S_IRUGO); | 63 | module_param(clock, int, S_IRUGO); |
64 | 64 | ||
65 | I2C_CLIENT_INSMOD_1(max6650); | ||
66 | |||
67 | /* | 65 | /* |
68 | * MAX 6650/6651 registers | 66 | * MAX 6650/6651 registers |
69 | */ | 67 | */ |
@@ -116,7 +114,7 @@ I2C_CLIENT_INSMOD_1(max6650); | |||
116 | 114 | ||
117 | static int max6650_probe(struct i2c_client *client, | 115 | static int max6650_probe(struct i2c_client *client, |
118 | const struct i2c_device_id *id); | 116 | const struct i2c_device_id *id); |
119 | static int max6650_detect(struct i2c_client *client, int kind, | 117 | static int max6650_detect(struct i2c_client *client, |
120 | struct i2c_board_info *info); | 118 | struct i2c_board_info *info); |
121 | static int max6650_init_client(struct i2c_client *client); | 119 | static int max6650_init_client(struct i2c_client *client); |
122 | static int max6650_remove(struct i2c_client *client); | 120 | static int max6650_remove(struct i2c_client *client); |
@@ -127,7 +125,7 @@ static struct max6650_data *max6650_update_device(struct device *dev); | |||
127 | */ | 125 | */ |
128 | 126 | ||
129 | static const struct i2c_device_id max6650_id[] = { | 127 | static const struct i2c_device_id max6650_id[] = { |
130 | { "max6650", max6650 }, | 128 | { "max6650", 0 }, |
131 | { } | 129 | { } |
132 | }; | 130 | }; |
133 | MODULE_DEVICE_TABLE(i2c, max6650_id); | 131 | MODULE_DEVICE_TABLE(i2c, max6650_id); |
@@ -141,7 +139,7 @@ static struct i2c_driver max6650_driver = { | |||
141 | .remove = max6650_remove, | 139 | .remove = max6650_remove, |
142 | .id_table = max6650_id, | 140 | .id_table = max6650_id, |
143 | .detect = max6650_detect, | 141 | .detect = max6650_detect, |
144 | .address_data = &addr_data, | 142 | .address_list = normal_i2c, |
145 | }; | 143 | }; |
146 | 144 | ||
147 | /* | 145 | /* |
@@ -528,13 +526,13 @@ static struct attribute_group max6650_attr_grp = { | |||
528 | */ | 526 | */ |
529 | 527 | ||
530 | /* Return 0 if detection is successful, -ENODEV otherwise */ | 528 | /* Return 0 if detection is successful, -ENODEV otherwise */ |
531 | static int max6650_detect(struct i2c_client *client, int kind, | 529 | static int max6650_detect(struct i2c_client *client, |
532 | struct i2c_board_info *info) | 530 | struct i2c_board_info *info) |
533 | { | 531 | { |
534 | struct i2c_adapter *adapter = client->adapter; | 532 | struct i2c_adapter *adapter = client->adapter; |
535 | int address = client->addr; | 533 | int address = client->addr; |
536 | 534 | ||
537 | dev_dbg(&adapter->dev, "max6650_detect called, kind = %d\n", kind); | 535 | dev_dbg(&adapter->dev, "max6650_detect called\n"); |
538 | 536 | ||
539 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { | 537 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { |
540 | dev_dbg(&adapter->dev, "max6650: I2C bus doesn't support " | 538 | dev_dbg(&adapter->dev, "max6650: I2C bus doesn't support " |
@@ -542,23 +540,7 @@ static int max6650_detect(struct i2c_client *client, int kind, | |||
542 | return -ENODEV; | 540 | return -ENODEV; |
543 | } | 541 | } |
544 | 542 | ||
545 | /* | 543 | if (((i2c_smbus_read_byte_data(client, MAX6650_REG_CONFIG) & 0xC0) |
546 | * Now we do the remaining detection. A negative kind means that | ||
547 | * the driver was loaded with no force parameter (default), so we | ||
548 | * must both detect and identify the chip (actually there is only | ||
549 | * one possible kind of chip for now, max6650). A zero kind means that | ||
550 | * the driver was loaded with the force parameter, the detection | ||
551 | * step shall be skipped. A positive kind means that the driver | ||
552 | * was loaded with the force parameter and a given kind of chip is | ||
553 | * requested, so both the detection and the identification steps | ||
554 | * are skipped. | ||
555 | * | ||
556 | * Currently I can find no way to distinguish between a MAX6650 and | ||
557 | * a MAX6651. This driver has only been tried on the former. | ||
558 | */ | ||
559 | |||
560 | if ((kind < 0) && | ||
561 | ( (i2c_smbus_read_byte_data(client, MAX6650_REG_CONFIG) & 0xC0) | ||
562 | ||(i2c_smbus_read_byte_data(client, MAX6650_REG_GPIO_STAT) & 0xE0) | 544 | ||(i2c_smbus_read_byte_data(client, MAX6650_REG_GPIO_STAT) & 0xE0) |
563 | ||(i2c_smbus_read_byte_data(client, MAX6650_REG_ALARM_EN) & 0xE0) | 545 | ||(i2c_smbus_read_byte_data(client, MAX6650_REG_ALARM_EN) & 0xE0) |
564 | ||(i2c_smbus_read_byte_data(client, MAX6650_REG_ALARM) & 0xE0) | 546 | ||(i2c_smbus_read_byte_data(client, MAX6650_REG_ALARM) & 0xE0) |