diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/hwmon/adm1026.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/hwmon/adm1026.c')
-rw-r--r-- | drivers/hwmon/adm1026.c | 58 |
1 files changed, 23 insertions, 35 deletions
diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c index ff7de40b6e35..65335b268fa9 100644 --- a/drivers/hwmon/adm1026.c +++ b/drivers/hwmon/adm1026.c | |||
@@ -37,9 +37,6 @@ | |||
37 | /* Addresses to scan */ | 37 | /* Addresses to scan */ |
38 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; | 38 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; |
39 | 39 | ||
40 | /* Insmod parameters */ | ||
41 | I2C_CLIENT_INSMOD_1(adm1026); | ||
42 | |||
43 | static int gpio_input[17] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, | 40 | static int gpio_input[17] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, |
44 | -1, -1, -1, -1, -1, -1, -1, -1 }; | 41 | -1, -1, -1, -1, -1, -1, -1, -1 }; |
45 | static int gpio_output[17] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, | 42 | static int gpio_output[17] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, |
@@ -293,7 +290,7 @@ struct adm1026_data { | |||
293 | 290 | ||
294 | static int adm1026_probe(struct i2c_client *client, | 291 | static int adm1026_probe(struct i2c_client *client, |
295 | const struct i2c_device_id *id); | 292 | const struct i2c_device_id *id); |
296 | static int adm1026_detect(struct i2c_client *client, int kind, | 293 | static int adm1026_detect(struct i2c_client *client, |
297 | struct i2c_board_info *info); | 294 | struct i2c_board_info *info); |
298 | static int adm1026_remove(struct i2c_client *client); | 295 | static int adm1026_remove(struct i2c_client *client); |
299 | static int adm1026_read_value(struct i2c_client *client, u8 reg); | 296 | static int adm1026_read_value(struct i2c_client *client, u8 reg); |
@@ -305,7 +302,7 @@ static void adm1026_init_client(struct i2c_client *client); | |||
305 | 302 | ||
306 | 303 | ||
307 | static const struct i2c_device_id adm1026_id[] = { | 304 | static const struct i2c_device_id adm1026_id[] = { |
308 | { "adm1026", adm1026 }, | 305 | { "adm1026", 0 }, |
309 | { } | 306 | { } |
310 | }; | 307 | }; |
311 | MODULE_DEVICE_TABLE(i2c, adm1026_id); | 308 | MODULE_DEVICE_TABLE(i2c, adm1026_id); |
@@ -319,7 +316,7 @@ static struct i2c_driver adm1026_driver = { | |||
319 | .remove = adm1026_remove, | 316 | .remove = adm1026_remove, |
320 | .id_table = adm1026_id, | 317 | .id_table = adm1026_id, |
321 | .detect = adm1026_detect, | 318 | .detect = adm1026_detect, |
322 | .address_data = &addr_data, | 319 | .address_list = normal_i2c, |
323 | }; | 320 | }; |
324 | 321 | ||
325 | static int adm1026_read_value(struct i2c_client *client, u8 reg) | 322 | static int adm1026_read_value(struct i2c_client *client, u8 reg) |
@@ -1650,7 +1647,7 @@ static const struct attribute_group adm1026_group_in8_9 = { | |||
1650 | }; | 1647 | }; |
1651 | 1648 | ||
1652 | /* Return 0 if detection is successful, -ENODEV otherwise */ | 1649 | /* Return 0 if detection is successful, -ENODEV otherwise */ |
1653 | static int adm1026_detect(struct i2c_client *client, int kind, | 1650 | static int adm1026_detect(struct i2c_client *client, |
1654 | struct i2c_board_info *info) | 1651 | struct i2c_board_info *info) |
1655 | { | 1652 | { |
1656 | struct i2c_adapter *adapter = client->adapter; | 1653 | struct i2c_adapter *adapter = client->adapter; |
@@ -1672,35 +1669,26 @@ static int adm1026_detect(struct i2c_client *client, int kind, | |||
1672 | i2c_adapter_id(client->adapter), client->addr, | 1669 | i2c_adapter_id(client->adapter), client->addr, |
1673 | company, verstep); | 1670 | company, verstep); |
1674 | 1671 | ||
1675 | /* If auto-detecting, Determine the chip type. */ | 1672 | /* Determine the chip type. */ |
1676 | if (kind <= 0) { | 1673 | dev_dbg(&adapter->dev, "Autodetecting device at %d,0x%02x...\n", |
1677 | dev_dbg(&adapter->dev, "Autodetecting device at %d,0x%02x " | 1674 | i2c_adapter_id(adapter), address); |
1678 | "...\n", i2c_adapter_id(adapter), address); | 1675 | if (company == ADM1026_COMPANY_ANALOG_DEV |
1679 | if (company == ADM1026_COMPANY_ANALOG_DEV | 1676 | && verstep == ADM1026_VERSTEP_ADM1026) { |
1680 | && verstep == ADM1026_VERSTEP_ADM1026) { | 1677 | /* Analog Devices ADM1026 */ |
1681 | kind = adm1026; | 1678 | } else if (company == ADM1026_COMPANY_ANALOG_DEV |
1682 | } else if (company == ADM1026_COMPANY_ANALOG_DEV | 1679 | && (verstep & 0xf0) == ADM1026_VERSTEP_GENERIC) { |
1683 | && (verstep & 0xf0) == ADM1026_VERSTEP_GENERIC) { | 1680 | dev_err(&adapter->dev, "Unrecognized stepping " |
1684 | dev_err(&adapter->dev, "Unrecognized stepping " | 1681 | "0x%02x. Defaulting to ADM1026.\n", verstep); |
1685 | "0x%02x. Defaulting to ADM1026.\n", verstep); | 1682 | } else if ((verstep & 0xf0) == ADM1026_VERSTEP_GENERIC) { |
1686 | kind = adm1026; | 1683 | dev_err(&adapter->dev, "Found version/stepping " |
1687 | } else if ((verstep & 0xf0) == ADM1026_VERSTEP_GENERIC) { | 1684 | "0x%02x. Assuming generic ADM1026.\n", |
1688 | dev_err(&adapter->dev, "Found version/stepping " | 1685 | verstep); |
1689 | "0x%02x. Assuming generic ADM1026.\n", | 1686 | } else { |
1690 | verstep); | 1687 | dev_dbg(&adapter->dev, "Autodetection failed\n"); |
1691 | kind = any_chip; | 1688 | /* Not an ADM1026... */ |
1692 | } else { | 1689 | return -ENODEV; |
1693 | dev_dbg(&adapter->dev, "Autodetection failed\n"); | ||
1694 | /* Not an ADM1026 ... */ | ||
1695 | if (kind == 0) { /* User used force=x,y */ | ||
1696 | dev_err(&adapter->dev, "Generic ADM1026 not " | ||
1697 | "found at %d,0x%02x. Try " | ||
1698 | "force_adm1026.\n", | ||
1699 | i2c_adapter_id(adapter), address); | ||
1700 | } | ||
1701 | return -ENODEV; | ||
1702 | } | ||
1703 | } | 1690 | } |
1691 | |||
1704 | strlcpy(info->type, "adm1026", I2C_NAME_SIZE); | 1692 | strlcpy(info->type, "adm1026", I2C_NAME_SIZE); |
1705 | 1693 | ||
1706 | return 0; | 1694 | return 0; |