hwmon: (lm90) Add SMBus alert support
[safe/jmp/linux-2.6] / drivers / hwmon / adm1026.c
index ff7de40..65335b2 100644 (file)
@@ -37,9 +37,6 @@
 /* Addresses to scan */
 static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
 
-/* Insmod parameters */
-I2C_CLIENT_INSMOD_1(adm1026);
-
 static int gpio_input[17] = { -1, -1, -1, -1, -1, -1, -1, -1, -1,
                                -1, -1, -1, -1, -1, -1, -1, -1 };
 static int gpio_output[17] = { -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -293,7 +290,7 @@ struct adm1026_data {
 
 static int adm1026_probe(struct i2c_client *client,
                         const struct i2c_device_id *id);
-static int adm1026_detect(struct i2c_client *client, int kind,
+static int adm1026_detect(struct i2c_client *client,
                          struct i2c_board_info *info);
 static int adm1026_remove(struct i2c_client *client);
 static int adm1026_read_value(struct i2c_client *client, u8 reg);
@@ -305,7 +302,7 @@ static void adm1026_init_client(struct i2c_client *client);
 
 
 static const struct i2c_device_id adm1026_id[] = {
-       { "adm1026", adm1026 },
+       { "adm1026", 0 },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, adm1026_id);
@@ -319,7 +316,7 @@ static struct i2c_driver adm1026_driver = {
        .remove         = adm1026_remove,
        .id_table       = adm1026_id,
        .detect         = adm1026_detect,
-       .address_data   = &addr_data,
+       .address_list   = normal_i2c,
 };
 
 static int adm1026_read_value(struct i2c_client *client, u8 reg)
@@ -1650,7 +1647,7 @@ static const struct attribute_group adm1026_group_in8_9 = {
 };
 
 /* Return 0 if detection is successful, -ENODEV otherwise */
-static int adm1026_detect(struct i2c_client *client, int kind,
+static int adm1026_detect(struct i2c_client *client,
                          struct i2c_board_info *info)
 {
        struct i2c_adapter *adapter = client->adapter;
@@ -1672,35 +1669,26 @@ static int adm1026_detect(struct i2c_client *client, int kind,
                i2c_adapter_id(client->adapter), client->addr,
                company, verstep);
 
-       /* If auto-detecting, Determine the chip type. */
-       if (kind <= 0) {
-               dev_dbg(&adapter->dev, "Autodetecting device at %d,0x%02x "
-                       "...\n", i2c_adapter_id(adapter), address);
-               if (company == ADM1026_COMPANY_ANALOG_DEV
-                   && verstep == ADM1026_VERSTEP_ADM1026) {
-                       kind = adm1026;
-               } else if (company == ADM1026_COMPANY_ANALOG_DEV
-                       && (verstep & 0xf0) == ADM1026_VERSTEP_GENERIC) {
-                       dev_err(&adapter->dev, "Unrecognized stepping "
-                               "0x%02x. Defaulting to ADM1026.\n", verstep);
-                       kind = adm1026;
-               } else if ((verstep & 0xf0) == ADM1026_VERSTEP_GENERIC) {
-                       dev_err(&adapter->dev, "Found version/stepping "
-                               "0x%02x. Assuming generic ADM1026.\n",
-                               verstep);
-                       kind = any_chip;
-               } else {
-                       dev_dbg(&adapter->dev, "Autodetection failed\n");
-                       /* Not an ADM1026 ... */
-                       if (kind == 0) { /* User used force=x,y */
-                               dev_err(&adapter->dev, "Generic ADM1026 not "
-                                       "found at %d,0x%02x.  Try "
-                                       "force_adm1026.\n",
-                                       i2c_adapter_id(adapter), address);
-                       }
-                       return -ENODEV;
-               }
+       /* Determine the chip type. */
+       dev_dbg(&adapter->dev, "Autodetecting device at %d,0x%02x...\n",
+               i2c_adapter_id(adapter), address);
+       if (company == ADM1026_COMPANY_ANALOG_DEV
+           && verstep == ADM1026_VERSTEP_ADM1026) {
+               /* Analog Devices ADM1026 */
+       } else if (company == ADM1026_COMPANY_ANALOG_DEV
+               && (verstep & 0xf0) == ADM1026_VERSTEP_GENERIC) {
+               dev_err(&adapter->dev, "Unrecognized stepping "
+                       "0x%02x. Defaulting to ADM1026.\n", verstep);
+       } else if ((verstep & 0xf0) == ADM1026_VERSTEP_GENERIC) {
+               dev_err(&adapter->dev, "Found version/stepping "
+                       "0x%02x. Assuming generic ADM1026.\n",
+                       verstep);
+       } else {
+               dev_dbg(&adapter->dev, "Autodetection failed\n");
+               /* Not an ADM1026... */
+               return -ENODEV;
        }
+
        strlcpy(info->type, "adm1026", I2C_NAME_SIZE);
 
        return 0;