aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/i2c/writing-clients2
-rw-r--r--drivers/hwmon/adm1021.c11
-rw-r--r--drivers/hwmon/adm1025.c12
-rw-r--r--drivers/hwmon/adm1026.c11
-rw-r--r--drivers/hwmon/adm1029.c14
-rw-r--r--drivers/hwmon/adm1031.c9
-rw-r--r--drivers/hwmon/adm9240.c9
-rw-r--r--drivers/hwmon/ads7828.c13
-rw-r--r--drivers/hwmon/adt7462.c11
-rw-r--r--drivers/hwmon/adt7470.c11
-rw-r--r--drivers/hwmon/adt7473.c11
-rw-r--r--drivers/hwmon/adt7475.c6
-rw-r--r--drivers/hwmon/asb100.c11
-rw-r--r--drivers/hwmon/atxp1.c11
-rw-r--r--drivers/hwmon/dme1737.c10
-rw-r--r--drivers/hwmon/ds1621.c9
-rw-r--r--drivers/hwmon/f75375s.c9
-rw-r--r--drivers/hwmon/fschmd.c9
-rw-r--r--drivers/hwmon/gl518sm.c11
-rw-r--r--drivers/hwmon/gl520sm.c13
-rw-r--r--drivers/hwmon/lm63.c15
-rw-r--r--drivers/hwmon/lm73.c9
-rw-r--r--drivers/hwmon/lm75.c14
-rw-r--r--drivers/hwmon/lm77.c12
-rw-r--r--drivers/hwmon/lm78.c9
-rw-r--r--drivers/hwmon/lm80.c13
-rw-r--r--drivers/hwmon/lm83.c12
-rw-r--r--drivers/hwmon/lm85.c16
-rw-r--r--drivers/hwmon/lm87.c12
-rw-r--r--drivers/hwmon/lm90.c14
-rw-r--r--drivers/hwmon/lm92.c9
-rw-r--r--drivers/hwmon/lm93.c8
-rw-r--r--drivers/hwmon/lm95241.c9
-rw-r--r--drivers/hwmon/max1619.c14
-rw-r--r--drivers/hwmon/max6650.c10
-rw-r--r--drivers/hwmon/pcf8591.c5
-rw-r--r--drivers/hwmon/smsc47m192.c11
-rw-r--r--drivers/hwmon/thmc50.c8
-rw-r--r--drivers/hwmon/tmp401.c9
-rw-r--r--drivers/hwmon/tmp421.c7
-rw-r--r--drivers/hwmon/w83781d.c10
-rw-r--r--drivers/hwmon/w83791d.c9
-rw-r--r--drivers/hwmon/w83792d.c9
-rw-r--r--drivers/hwmon/w83793.c9
-rw-r--r--drivers/hwmon/w83l785ts.c14
-rw-r--r--drivers/hwmon/w83l786ng.c10
-rw-r--r--drivers/i2c/i2c-core.c52
-rw-r--r--drivers/misc/eeprom/eeprom.c8
-rw-r--r--drivers/misc/ics932s401.c11
-rw-r--r--include/linux/i2c.h92
50 files changed, 232 insertions, 411 deletions
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients
index 7860aafb483..0a74603eb67 100644
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -44,7 +44,7 @@ static struct i2c_driver foo_driver = {
44 /* if device autodetection is needed: */ 44 /* if device autodetection is needed: */
45 .class = I2C_CLASS_SOMETHING, 45 .class = I2C_CLASS_SOMETHING,
46 .detect = foo_detect, 46 .detect = foo_detect,
47 .address_data = &addr_data, 47 .address_list = normal_i2c,
48 48
49 .shutdown = foo_shutdown, /* optional */ 49 .shutdown = foo_shutdown, /* optional */
50 .suspend = foo_suspend, /* optional */ 50 .suspend = foo_suspend, /* optional */
diff --git a/drivers/hwmon/adm1021.c b/drivers/hwmon/adm1021.c
index 33acf29531a..1ad0a885c5a 100644
--- a/drivers/hwmon/adm1021.c
+++ b/drivers/hwmon/adm1021.c
@@ -34,9 +34,8 @@
34static const unsigned short normal_i2c[] = { 34static const unsigned short normal_i2c[] = {
35 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, 0x4d, 0x4e, I2C_CLIENT_END }; 35 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, 0x4d, 0x4e, I2C_CLIENT_END };
36 36
37/* Insmod parameters */ 37enum chips {
38I2C_CLIENT_INSMOD_8(adm1021, adm1023, max1617, max1617a, thmc10, lm84, gl523sm, 38 adm1021, adm1023, max1617, max1617a, thmc10, lm84, gl523sm, mc1066 };
39 mc1066);
40 39
41/* adm1021 constants specified below */ 40/* adm1021 constants specified below */
42 41
@@ -97,7 +96,7 @@ struct adm1021_data {
97 96
98static int adm1021_probe(struct i2c_client *client, 97static int adm1021_probe(struct i2c_client *client,
99 const struct i2c_device_id *id); 98 const struct i2c_device_id *id);
100static int adm1021_detect(struct i2c_client *client, int kind, 99static int adm1021_detect(struct i2c_client *client,
101 struct i2c_board_info *info); 100 struct i2c_board_info *info);
102static void adm1021_init_client(struct i2c_client *client); 101static void adm1021_init_client(struct i2c_client *client);
103static int adm1021_remove(struct i2c_client *client); 102static int adm1021_remove(struct i2c_client *client);
@@ -130,7 +129,7 @@ static struct i2c_driver adm1021_driver = {
130 .remove = adm1021_remove, 129 .remove = adm1021_remove,
131 .id_table = adm1021_id, 130 .id_table = adm1021_id,
132 .detect = adm1021_detect, 131 .detect = adm1021_detect,
133 .address_data = &addr_data, 132 .address_list = normal_i2c,
134}; 133};
135 134
136static ssize_t show_temp(struct device *dev, 135static ssize_t show_temp(struct device *dev,
@@ -284,7 +283,7 @@ static const struct attribute_group adm1021_group = {
284}; 283};
285 284
286/* Return 0 if detection is successful, -ENODEV otherwise */ 285/* Return 0 if detection is successful, -ENODEV otherwise */
287static int adm1021_detect(struct i2c_client *client, int kind, 286static int adm1021_detect(struct i2c_client *client,
288 struct i2c_board_info *info) 287 struct i2c_board_info *info)
289{ 288{
290 struct i2c_adapter *adapter = client->adapter; 289 struct i2c_adapter *adapter = client->adapter;
diff --git a/drivers/hwmon/adm1025.c b/drivers/hwmon/adm1025.c
index db6ac2b04f6..251b63165e2 100644
--- a/drivers/hwmon/adm1025.c
+++ b/drivers/hwmon/adm1025.c
@@ -64,11 +64,7 @@
64 64
65static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; 65static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
66 66
67/* 67enum chips { adm1025, ne1619 };
68 * Insmod parameters
69 */
70
71I2C_CLIENT_INSMOD_2(adm1025, ne1619);
72 68
73/* 69/*
74 * The ADM1025 registers 70 * The ADM1025 registers
@@ -111,7 +107,7 @@ static const int in_scale[6] = { 2500, 2250, 3300, 5000, 12000, 3300 };
111 107
112static int adm1025_probe(struct i2c_client *client, 108static int adm1025_probe(struct i2c_client *client,
113 const struct i2c_device_id *id); 109 const struct i2c_device_id *id);
114static int adm1025_detect(struct i2c_client *client, int kind, 110static int adm1025_detect(struct i2c_client *client,
115 struct i2c_board_info *info); 111 struct i2c_board_info *info);
116static void adm1025_init_client(struct i2c_client *client); 112static void adm1025_init_client(struct i2c_client *client);
117static int adm1025_remove(struct i2c_client *client); 113static int adm1025_remove(struct i2c_client *client);
@@ -137,7 +133,7 @@ static struct i2c_driver adm1025_driver = {
137 .remove = adm1025_remove, 133 .remove = adm1025_remove,
138 .id_table = adm1025_id, 134 .id_table = adm1025_id,
139 .detect = adm1025_detect, 135 .detect = adm1025_detect,
140 .address_data = &addr_data, 136 .address_list = normal_i2c,
141}; 137};
142 138
143/* 139/*
@@ -409,7 +405,7 @@ static const struct attribute_group adm1025_group_in4 = {
409}; 405};
410 406
411/* Return 0 if detection is successful, -ENODEV otherwise */ 407/* Return 0 if detection is successful, -ENODEV otherwise */
412static int adm1025_detect(struct i2c_client *client, int kind, 408static int adm1025_detect(struct i2c_client *client,
413 struct i2c_board_info *info) 409 struct i2c_board_info *info)
414{ 410{
415 struct i2c_adapter *adapter = client->adapter; 411 struct i2c_adapter *adapter = client->adapter;
diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c
index fb5363985e2..65335b268fa 100644
--- a/drivers/hwmon/adm1026.c
+++ b/drivers/hwmon/adm1026.c
@@ -37,9 +37,6 @@
37/* Addresses to scan */ 37/* Addresses to scan */
38static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; 38static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
39 39
40/* Insmod parameters */
41I2C_CLIENT_INSMOD_1(adm1026);
42
43static int gpio_input[17] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, 40static 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 };
45static int gpio_output[17] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, 42static int gpio_output[17] = { -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -293,7 +290,7 @@ struct adm1026_data {
293 290
294static int adm1026_probe(struct i2c_client *client, 291static int adm1026_probe(struct i2c_client *client,
295 const struct i2c_device_id *id); 292 const struct i2c_device_id *id);
296static int adm1026_detect(struct i2c_client *client, int kind, 293static int adm1026_detect(struct i2c_client *client,
297 struct i2c_board_info *info); 294 struct i2c_board_info *info);
298static int adm1026_remove(struct i2c_client *client); 295static int adm1026_remove(struct i2c_client *client);
299static int adm1026_read_value(struct i2c_client *client, u8 reg); 296static 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
307static const struct i2c_device_id adm1026_id[] = { 304static const struct i2c_device_id adm1026_id[] = {
308 { "adm1026", adm1026 }, 305 { "adm1026", 0 },
309 { } 306 { }
310}; 307};
311MODULE_DEVICE_TABLE(i2c, adm1026_id); 308MODULE_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
325static int adm1026_read_value(struct i2c_client *client, u8 reg) 322static 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 */
1653static int adm1026_detect(struct i2c_client *client, int kind, 1650static 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;
diff --git a/drivers/hwmon/adm1029.c b/drivers/hwmon/adm1029.c
index ef91e2a4a56..0b8a3b145bd 100644
--- a/drivers/hwmon/adm1029.c
+++ b/drivers/hwmon/adm1029.c
@@ -44,12 +44,6 @@ static const unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
44}; 44};
45 45
46/* 46/*
47 * Insmod parameters
48 */
49
50I2C_CLIENT_INSMOD_1(adm1029);
51
52/*
53 * The ADM1029 registers 47 * The ADM1029 registers
54 * Manufacturer ID is 0x41 for Analog Devices 48 * Manufacturer ID is 0x41 for Analog Devices
55 */ 49 */
@@ -117,7 +111,7 @@ static const u8 ADM1029_REG_FAN_DIV[] = {
117 111
118static int adm1029_probe(struct i2c_client *client, 112static int adm1029_probe(struct i2c_client *client,
119 const struct i2c_device_id *id); 113 const struct i2c_device_id *id);
120static int adm1029_detect(struct i2c_client *client, int kind, 114static int adm1029_detect(struct i2c_client *client,
121 struct i2c_board_info *info); 115 struct i2c_board_info *info);
122static int adm1029_remove(struct i2c_client *client); 116static int adm1029_remove(struct i2c_client *client);
123static struct adm1029_data *adm1029_update_device(struct device *dev); 117static struct adm1029_data *adm1029_update_device(struct device *dev);
@@ -128,7 +122,7 @@ static int adm1029_init_client(struct i2c_client *client);
128 */ 122 */
129 123
130static const struct i2c_device_id adm1029_id[] = { 124static const struct i2c_device_id adm1029_id[] = {
131 { "adm1029", adm1029 }, 125 { "adm1029", 0 },
132 { } 126 { }
133}; 127};
134MODULE_DEVICE_TABLE(i2c, adm1029_id); 128MODULE_DEVICE_TABLE(i2c, adm1029_id);
@@ -142,7 +136,7 @@ static struct i2c_driver adm1029_driver = {
142 .remove = adm1029_remove, 136 .remove = adm1029_remove,
143 .id_table = adm1029_id, 137 .id_table = adm1029_id,
144 .detect = adm1029_detect, 138 .detect = adm1029_detect,
145 .address_data = &addr_data, 139 .address_list = normal_i2c,
146}; 140};
147 141
148/* 142/*
@@ -297,7 +291,7 @@ static const struct attribute_group adm1029_group = {
297 */ 291 */
298 292
299/* Return 0 if detection is successful, -ENODEV otherwise */ 293/* Return 0 if detection is successful, -ENODEV otherwise */
300static int adm1029_detect(struct i2c_client *client, int kind, 294static int adm1029_detect(struct i2c_client *client,
301 struct i2c_board_info *info) 295 struct i2c_board_info *info)
302{ 296{
303 struct i2c_adapter *adapter = client->adapter; 297 struct i2c_adapter *adapter = client->adapter;
diff --git a/drivers/hwmon/adm1031.c b/drivers/hwmon/adm1031.c
index 0e722175aae..1644b92e7cc 100644
--- a/drivers/hwmon/adm1031.c
+++ b/drivers/hwmon/adm1031.c
@@ -64,8 +64,7 @@
64/* Addresses to scan */ 64/* Addresses to scan */
65static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; 65static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
66 66
67/* Insmod parameters */ 67enum chips { adm1030, adm1031 };
68I2C_CLIENT_INSMOD_2(adm1030, adm1031);
69 68
70typedef u8 auto_chan_table_t[8][2]; 69typedef u8 auto_chan_table_t[8][2];
71 70
@@ -102,7 +101,7 @@ struct adm1031_data {
102 101
103static int adm1031_probe(struct i2c_client *client, 102static int adm1031_probe(struct i2c_client *client,
104 const struct i2c_device_id *id); 103 const struct i2c_device_id *id);
105static int adm1031_detect(struct i2c_client *client, int kind, 104static int adm1031_detect(struct i2c_client *client,
106 struct i2c_board_info *info); 105 struct i2c_board_info *info);
107static void adm1031_init_client(struct i2c_client *client); 106static void adm1031_init_client(struct i2c_client *client);
108static int adm1031_remove(struct i2c_client *client); 107static int adm1031_remove(struct i2c_client *client);
@@ -125,7 +124,7 @@ static struct i2c_driver adm1031_driver = {
125 .remove = adm1031_remove, 124 .remove = adm1031_remove,
126 .id_table = adm1031_id, 125 .id_table = adm1031_id,
127 .detect = adm1031_detect, 126 .detect = adm1031_detect,
128 .address_data = &addr_data, 127 .address_list = normal_i2c,
129}; 128};
130 129
131static inline u8 adm1031_read_value(struct i2c_client *client, u8 reg) 130static inline u8 adm1031_read_value(struct i2c_client *client, u8 reg)
@@ -813,7 +812,7 @@ static const struct attribute_group adm1031_group_opt = {
813}; 812};
814 813
815/* Return 0 if detection is successful, -ENODEV otherwise */ 814/* Return 0 if detection is successful, -ENODEV otherwise */
816static int adm1031_detect(struct i2c_client *client, int kind, 815static int adm1031_detect(struct i2c_client *client,
817 struct i2c_board_info *info) 816 struct i2c_board_info *info)
818{ 817{
819 struct i2c_adapter *adapter = client->adapter; 818 struct i2c_adapter *adapter = client->adapter;
diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c
index 20e0481cc20..0727ad25079 100644
--- a/drivers/hwmon/adm9240.c
+++ b/drivers/hwmon/adm9240.c
@@ -55,8 +55,7 @@
55static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f, 55static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f,
56 I2C_CLIENT_END }; 56 I2C_CLIENT_END };
57 57
58/* Insmod parameters */ 58enum chips { adm9240, ds1780, lm81 };
59I2C_CLIENT_INSMOD_3(adm9240, ds1780, lm81);
60 59
61/* ADM9240 registers */ 60/* ADM9240 registers */
62#define ADM9240_REG_MAN_ID 0x3e 61#define ADM9240_REG_MAN_ID 0x3e
@@ -132,7 +131,7 @@ static inline unsigned int AOUT_FROM_REG(u8 reg)
132 131
133static int adm9240_probe(struct i2c_client *client, 132static int adm9240_probe(struct i2c_client *client,
134 const struct i2c_device_id *id); 133 const struct i2c_device_id *id);
135static int adm9240_detect(struct i2c_client *client, int kind, 134static int adm9240_detect(struct i2c_client *client,
136 struct i2c_board_info *info); 135 struct i2c_board_info *info);
137static void adm9240_init_client(struct i2c_client *client); 136static void adm9240_init_client(struct i2c_client *client);
138static int adm9240_remove(struct i2c_client *client); 137static int adm9240_remove(struct i2c_client *client);
@@ -156,7 +155,7 @@ static struct i2c_driver adm9240_driver = {
156 .remove = adm9240_remove, 155 .remove = adm9240_remove,
157 .id_table = adm9240_id, 156 .id_table = adm9240_id,
158 .detect = adm9240_detect, 157 .detect = adm9240_detect,
159 .address_data = &addr_data, 158 .address_list = normal_i2c,
160}; 159};
161 160
162/* per client data */ 161/* per client data */
@@ -545,7 +544,7 @@ static const struct attribute_group adm9240_group = {
545/*** sensor chip detect and driver install ***/ 544/*** sensor chip detect and driver install ***/
546 545
547/* Return 0 if detection is successful, -ENODEV otherwise */ 546/* Return 0 if detection is successful, -ENODEV otherwise */
548static int adm9240_detect(struct i2c_client *new_client, int kind, 547static int adm9240_detect(struct i2c_client *new_client,
549 struct i2c_board_info *info) 548 struct i2c_board_info *info)
550{ 549{
551 struct i2c_adapter *adapter = new_client->adapter; 550 struct i2c_adapter *adapter = new_client->adapter;
diff --git a/drivers/hwmon/ads7828.c b/drivers/hwmon/ads7828.c
index 451977bca7d..aac85f3aed5 100644
--- a/drivers/hwmon/ads7828.c
+++ b/drivers/hwmon/ads7828.c
@@ -47,10 +47,7 @@
47static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 47static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b,
48 I2C_CLIENT_END }; 48 I2C_CLIENT_END };
49 49
50/* Insmod parameters */ 50/* Module parameters */
51I2C_CLIENT_INSMOD_1(ads7828);
52
53/* Other module parameters */
54static int se_input = 1; /* Default is SE, 0 == diff */ 51static int se_input = 1; /* Default is SE, 0 == diff */
55static int int_vref = 1; /* Default is internal ref ON */ 52static int int_vref = 1; /* Default is internal ref ON */
56static int vref_mv = ADS7828_INT_VREF_MV; /* set if vref != 2.5V */ 53static int vref_mv = ADS7828_INT_VREF_MV; /* set if vref != 2.5V */
@@ -72,7 +69,7 @@ struct ads7828_data {
72}; 69};
73 70
74/* Function declaration - necessary due to function dependencies */ 71/* Function declaration - necessary due to function dependencies */
75static int ads7828_detect(struct i2c_client *client, int kind, 72static int ads7828_detect(struct i2c_client *client,
76 struct i2c_board_info *info); 73 struct i2c_board_info *info);
77static int ads7828_probe(struct i2c_client *client, 74static int ads7828_probe(struct i2c_client *client,
78 const struct i2c_device_id *id); 75 const struct i2c_device_id *id);
@@ -168,7 +165,7 @@ static int ads7828_remove(struct i2c_client *client)
168} 165}
169 166
170static const struct i2c_device_id ads7828_id[] = { 167static const struct i2c_device_id ads7828_id[] = {
171 { "ads7828", ads7828 }, 168 { "ads7828", 0 },
172 { } 169 { }
173}; 170};
174MODULE_DEVICE_TABLE(i2c, ads7828_id); 171MODULE_DEVICE_TABLE(i2c, ads7828_id);
@@ -183,11 +180,11 @@ static struct i2c_driver ads7828_driver = {
183 .remove = ads7828_remove, 180 .remove = ads7828_remove,
184 .id_table = ads7828_id, 181 .id_table = ads7828_id,
185 .detect = ads7828_detect, 182 .detect = ads7828_detect,
186 .address_data = &addr_data, 183 .address_list = normal_i2c,
187}; 184};
188 185
189/* Return 0 if detection is successful, -ENODEV otherwise */ 186/* Return 0 if detection is successful, -ENODEV otherwise */
190static int ads7828_detect(struct i2c_client *client, int kind, 187static int ads7828_detect(struct i2c_client *client,
191 struct i2c_board_info *info) 188 struct i2c_board_info *info)
192{ 189{
193 struct i2c_adapter *adapter = client->adapter; 190 struct i2c_adapter *adapter = client->adapter;
diff --git a/drivers/hwmon/adt7462.c b/drivers/hwmon/adt7462.c
index f9c9562b6a9..a1a7ef14b51 100644
--- a/drivers/hwmon/adt7462.c
+++ b/drivers/hwmon/adt7462.c
@@ -32,9 +32,6 @@
32/* Addresses to scan */ 32/* Addresses to scan */
33static const unsigned short normal_i2c[] = { 0x58, 0x5C, I2C_CLIENT_END }; 33static const unsigned short normal_i2c[] = { 0x58, 0x5C, I2C_CLIENT_END };
34 34
35/* Insmod parameters */
36I2C_CLIENT_INSMOD_1(adt7462);
37
38/* ADT7462 registers */ 35/* ADT7462 registers */
39#define ADT7462_REG_DEVICE 0x3D 36#define ADT7462_REG_DEVICE 0x3D
40#define ADT7462_REG_VENDOR 0x3E 37#define ADT7462_REG_VENDOR 0x3E
@@ -237,12 +234,12 @@ struct adt7462_data {
237 234
238static int adt7462_probe(struct i2c_client *client, 235static int adt7462_probe(struct i2c_client *client,
239 const struct i2c_device_id *id); 236 const struct i2c_device_id *id);
240static int adt7462_detect(struct i2c_client *client, int kind, 237static int adt7462_detect(struct i2c_client *client,
241 struct i2c_board_info *info); 238 struct i2c_board_info *info);
242static int adt7462_remove(struct i2c_client *client); 239static int adt7462_remove(struct i2c_client *client);
243 240
244static const struct i2c_device_id adt7462_id[] = { 241static const struct i2c_device_id adt7462_id[] = {
245 { "adt7462", adt7462 }, 242 { "adt7462", 0 },
246 { } 243 { }
247}; 244};
248MODULE_DEVICE_TABLE(i2c, adt7462_id); 245MODULE_DEVICE_TABLE(i2c, adt7462_id);
@@ -256,7 +253,7 @@ static struct i2c_driver adt7462_driver = {
256 .remove = adt7462_remove, 253 .remove = adt7462_remove,
257 .id_table = adt7462_id, 254 .id_table = adt7462_id,
258 .detect = adt7462_detect, 255 .detect = adt7462_detect,
259 .address_data = &addr_data, 256 .address_list = normal_i2c,
260}; 257};
261 258
262/* 259/*
@@ -1902,7 +1899,7 @@ static struct attribute *adt7462_attr[] =
1902}; 1899};
1903 1900
1904/* Return 0 if detection is successful, -ENODEV otherwise */ 1901/* Return 0 if detection is successful, -ENODEV otherwise */
1905static int adt7462_detect(struct i2c_client *client, int kind, 1902static int adt7462_detect(struct i2c_client *client,
1906 struct i2c_board_info *info) 1903 struct i2c_board_info *info)
1907{ 1904{
1908 struct i2c_adapter *adapter = client->adapter; 1905 struct i2c_adapter *adapter = client->adapter;
diff --git a/drivers/hwmon/adt7470.c b/drivers/hwmon/adt7470.c
index 32b1750a689..3445ce1cba8 100644
--- a/drivers/hwmon/adt7470.c
+++ b/drivers/hwmon/adt7470.c
@@ -33,9 +33,6 @@
33/* Addresses to scan */ 33/* Addresses to scan */
34static const unsigned short normal_i2c[] = { 0x2C, 0x2E, 0x2F, I2C_CLIENT_END }; 34static const unsigned short normal_i2c[] = { 0x2C, 0x2E, 0x2F, I2C_CLIENT_END };
35 35
36/* Insmod parameters */
37I2C_CLIENT_INSMOD_1(adt7470);
38
39/* ADT7470 registers */ 36/* ADT7470 registers */
40#define ADT7470_REG_BASE_ADDR 0x20 37#define ADT7470_REG_BASE_ADDR 0x20
41#define ADT7470_REG_TEMP_BASE_ADDR 0x20 38#define ADT7470_REG_TEMP_BASE_ADDR 0x20
@@ -177,12 +174,12 @@ struct adt7470_data {
177 174
178static int adt7470_probe(struct i2c_client *client, 175static int adt7470_probe(struct i2c_client *client,
179 const struct i2c_device_id *id); 176 const struct i2c_device_id *id);
180static int adt7470_detect(struct i2c_client *client, int kind, 177static int adt7470_detect(struct i2c_client *client,
181 struct i2c_board_info *info); 178 struct i2c_board_info *info);
182static int adt7470_remove(struct i2c_client *client); 179static int adt7470_remove(struct i2c_client *client);
183 180
184static const struct i2c_device_id adt7470_id[] = { 181static const struct i2c_device_id adt7470_id[] = {
185 { "adt7470", adt7470 }, 182 { "adt7470", 0 },
186 { } 183 { }
187}; 184};
188MODULE_DEVICE_TABLE(i2c, adt7470_id); 185MODULE_DEVICE_TABLE(i2c, adt7470_id);
@@ -196,7 +193,7 @@ static struct i2c_driver adt7470_driver = {
196 .remove = adt7470_remove, 193 .remove = adt7470_remove,
197 .id_table = adt7470_id, 194 .id_table = adt7470_id,
198 .detect = adt7470_detect, 195 .detect = adt7470_detect,
199 .address_data = &addr_data, 196 .address_list = normal_i2c,
200}; 197};
201 198
202/* 199/*
@@ -1225,7 +1222,7 @@ static struct attribute *adt7470_attr[] =
1225}; 1222};
1226 1223
1227/* Return 0 if detection is successful, -ENODEV otherwise */ 1224/* Return 0 if detection is successful, -ENODEV otherwise */
1228static int adt7470_detect(struct i2c_client *client, int kind, 1225static int adt7470_detect(struct i2c_client *client,
1229 struct i2c_board_info *info) 1226 struct i2c_board_info *info)
1230{ 1227{
1231 struct i2c_adapter *adapter = client->adapter; 1228 struct i2c_adapter *adapter = client->adapter;
diff --git a/drivers/hwmon/adt7473.c b/drivers/hwmon/adt7473.c
index aea244db974..434576f61c8 100644
--- a/drivers/hwmon/adt7473.c
+++ b/drivers/hwmon/adt7473.c
@@ -32,9 +32,6 @@
32/* Addresses to scan */ 32/* Addresses to scan */
33static const unsigned short normal_i2c[] = { 0x2C, 0x2D, 0x2E, I2C_CLIENT_END }; 33static const unsigned short normal_i2c[] = { 0x2C, 0x2D, 0x2E, I2C_CLIENT_END };
34 34
35/* Insmod parameters */
36I2C_CLIENT_INSMOD_1(adt7473);
37
38/* ADT7473 registers */ 35/* ADT7473 registers */
39#define ADT7473_REG_BASE_ADDR 0x20 36#define ADT7473_REG_BASE_ADDR 0x20
40 37
@@ -166,12 +163,12 @@ struct adt7473_data {
166 163
167static int adt7473_probe(struct i2c_client *client, 164static int adt7473_probe(struct i2c_client *client,
168 const struct i2c_device_id *id); 165 const struct i2c_device_id *id);
169static int adt7473_detect(struct i2c_client *client, int kind, 166static int adt7473_detect(struct i2c_client *client,
170 struct i2c_board_info *info); 167 struct i2c_board_info *info);
171static int adt7473_remove(struct i2c_client *client); 168static int adt7473_remove(struct i2c_client *client);
172 169
173static const struct i2c_device_id adt7473_id[] = { 170static const struct i2c_device_id adt7473_id[] = {
174 { "adt7473", adt7473 }, 171 { "adt7473", 0 },
175 { } 172 { }
176}; 173};
177 174
@@ -184,7 +181,7 @@ static struct i2c_driver adt7473_driver = {
184 .remove = adt7473_remove, 181 .remove = adt7473_remove,
185 .id_table = adt7473_id, 182 .id_table = adt7473_id,
186 .detect = adt7473_detect, 183 .detect = adt7473_detect,
187 .address_data = &addr_data, 184 .address_list = normal_i2c,
188}; 185};
189 186
190/* 187/*
@@ -1085,7 +1082,7 @@ static struct attribute *adt7473_attr[] =
1085}; 1082};
1086 1083
1087/* Return 0 if detection is successful, -ENODEV otherwise */ 1084/* Return 0 if detection is successful, -ENODEV otherwise */
1088static int adt7473_detect(struct i2c_client *client, int kind, 1085static int adt7473_detect(struct i2c_client *client,
1089 struct i2c_board_info *info) 1086 struct i2c_board_info *info)
1090{ 1087{
1091 struct i2c_adapter *adapter = client->adapter; 1088 struct i2c_adapter *adapter = client->adapter;
diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c
index 99abfddedbc..a0c38514568 100644
--- a/drivers/hwmon/adt7475.c
+++ b/drivers/hwmon/adt7475.c
@@ -148,7 +148,7 @@
148 148
149static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; 149static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
150 150
151I2C_CLIENT_INSMOD_4(adt7473, adt7475, adt7476, adt7490); 151enum chips { adt7473, adt7475, adt7476, adt7490 };
152 152
153static const struct i2c_device_id adt7475_id[] = { 153static const struct i2c_device_id adt7475_id[] = {
154 { "adt7473", adt7473 }, 154 { "adt7473", adt7473 },
@@ -1172,7 +1172,7 @@ static struct attribute_group in4_attr_group = { .attrs = in4_attrs };
1172static struct attribute_group in5_attr_group = { .attrs = in5_attrs }; 1172static struct attribute_group in5_attr_group = { .attrs = in5_attrs };
1173static struct attribute_group vid_attr_group = { .attrs = vid_attrs }; 1173static struct attribute_group vid_attr_group = { .attrs = vid_attrs };
1174 1174
1175static int adt7475_detect(struct i2c_client *client, int kind, 1175static int adt7475_detect(struct i2c_client *client,
1176 struct i2c_board_info *info) 1176 struct i2c_board_info *info)
1177{ 1177{
1178 struct i2c_adapter *adapter = client->adapter; 1178 struct i2c_adapter *adapter = client->adapter;
@@ -1412,7 +1412,7 @@ static struct i2c_driver adt7475_driver = {
1412 .remove = adt7475_remove, 1412 .remove = adt7475_remove,
1413 .id_table = adt7475_id, 1413 .id_table = adt7475_id,
1414 .detect = adt7475_detect, 1414 .detect = adt7475_detect,
1415 .address_data = &addr_data, 1415 .address_list = normal_i2c,
1416}; 1416};
1417 1417
1418static void adt7475_read_hystersis(struct i2c_client *client) 1418static void adt7475_read_hystersis(struct i2c_client *client)
diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c
index 480f80ea1fa..7dada559b3a 100644
--- a/drivers/hwmon/asb100.c
+++ b/drivers/hwmon/asb100.c
@@ -51,9 +51,6 @@
51/* I2C addresses to scan */ 51/* I2C addresses to scan */
52static const unsigned short normal_i2c[] = { 0x2d, I2C_CLIENT_END }; 52static const unsigned short normal_i2c[] = { 0x2d, I2C_CLIENT_END };
53 53
54/* Insmod parameters */
55I2C_CLIENT_INSMOD_1(asb100);
56
57static unsigned short force_subclients[4]; 54static unsigned short force_subclients[4];
58module_param_array(force_subclients, short, NULL, 0); 55module_param_array(force_subclients, short, NULL, 0);
59MODULE_PARM_DESC(force_subclients, "List of subclient addresses: " 56MODULE_PARM_DESC(force_subclients, "List of subclient addresses: "
@@ -209,14 +206,14 @@ static void asb100_write_value(struct i2c_client *client, u16 reg, u16 val);
209 206
210static int asb100_probe(struct i2c_client *client, 207static int asb100_probe(struct i2c_client *client,
211 const struct i2c_device_id *id); 208 const struct i2c_device_id *id);
212static int asb100_detect(struct i2c_client *client, int kind, 209static int asb100_detect(struct i2c_client *client,
213 struct i2c_board_info *info); 210 struct i2c_board_info *info);
214static int asb100_remove(struct i2c_client *client); 211static int asb100_remove(struct i2c_client *client);
215static struct asb100_data *asb100_update_device(struct device *dev); 212static struct asb100_data *asb100_update_device(struct device *dev);
216static void asb100_init_client(struct i2c_client *client); 213static void asb100_init_client(struct i2c_client *client);
217 214
218static const struct i2c_device_id asb100_id[] = { 215static const struct i2c_device_id asb100_id[] = {
219 { "asb100", asb100 }, 216 { "asb100", 0 },
220 { } 217 { }
221}; 218};
222MODULE_DEVICE_TABLE(i2c, asb100_id); 219MODULE_DEVICE_TABLE(i2c, asb100_id);
@@ -230,7 +227,7 @@ static struct i2c_driver asb100_driver = {
230 .remove = asb100_remove, 227 .remove = asb100_remove,
231 .id_table = asb100_id, 228 .id_table = asb100_id,
232 .detect = asb100_detect, 229 .detect = asb100_detect,
233 .address_data = &addr_data, 230 .address_list = normal_i2c,
234}; 231};
235 232
236/* 7 Voltages */ 233/* 7 Voltages */
@@ -697,7 +694,7 @@ ERROR_SC_2:
697} 694}
698 695
699/* Return 0 if detection is successful, -ENODEV otherwise */ 696/* Return 0 if detection is successful, -ENODEV otherwise */
700static int asb100_detect(struct i2c_client *client, int kind, 697static int asb100_detect(struct i2c_client *client,
701 struct i2c_board_info *info) 698 struct i2c_board_info *info)
702{ 699{
703 struct i2c_adapter *adapter = client->adapter; 700 struct i2c_adapter *adapter = client->adapter;
diff --git a/drivers/hwmon/atxp1.c b/drivers/hwmon/atxp1.c
index d6b490d3e36..94cadc19f0c 100644
--- a/drivers/hwmon/atxp1.c
+++ b/drivers/hwmon/atxp1.c
@@ -44,17 +44,14 @@ MODULE_AUTHOR("Sebastian Witt <se.witt@gmx.net>");
44 44
45static const unsigned short normal_i2c[] = { 0x37, 0x4e, I2C_CLIENT_END }; 45static const unsigned short normal_i2c[] = { 0x37, 0x4e, I2C_CLIENT_END };
46 46
47I2C_CLIENT_INSMOD_1(atxp1);
48
49static int atxp1_probe(struct i2c_client *client, 47static int atxp1_probe(struct i2c_client *client,
50 const struct i2c_device_id *id); 48 const struct i2c_device_id *id);
51static int atxp1_remove(struct i2c_client *client); 49static int atxp1_remove(struct i2c_client *client);
52static struct atxp1_data * atxp1_update_device(struct device *dev); 50static struct atxp1_data * atxp1_update_device(struct device *dev);
53static int atxp1_detect(struct i2c_client *client, int kind, 51static int atxp1_detect(struct i2c_client *client, struct i2c_board_info *info);
54 struct i2c_board_info *info);
55 52
56static const struct i2c_device_id atxp1_id[] = { 53static const struct i2c_device_id atxp1_id[] = {
57 { "atxp1", atxp1 }, 54 { "atxp1", 0 },
58 { } 55 { }
59}; 56};
60MODULE_DEVICE_TABLE(i2c, atxp1_id); 57MODULE_DEVICE_TABLE(i2c, atxp1_id);
@@ -68,7 +65,7 @@ static struct i2c_driver atxp1_driver = {
68 .remove = atxp1_remove, 65 .remove = atxp1_remove,
69 .id_table = atxp1_id, 66 .id_table = atxp1_id,
70 .detect = atxp1_detect, 67 .detect = atxp1_detect,
71 .address_data = &addr_data, 68 .address_list = normal_i2c,
72}; 69};
73 70
74struct atxp1_data { 71struct atxp1_data {
@@ -275,7 +272,7 @@ static const struct attribute_group atxp1_group = {
275 272
276 273
277/* Return 0 if detection is successful, -ENODEV otherwise */ 274/* Return 0 if detection is successful, -ENODEV otherwise */
278static int atxp1_detect(struct i2c_client *new_client, int kind, 275static int atxp1_detect(struct i2c_client *new_client,
279 struct i2c_board_info *info) 276 struct i2c_board_info *info)
280{ 277{
281 struct i2c_adapter *adapter = new_client->adapter; 278 struct i2c_adapter *adapter = new_client->adapter;
diff --git a/drivers/hwmon/dme1737.c b/drivers/hwmon/dme1737.c
index 4377bb0cc52..823dd28a902 100644
--- a/drivers/hwmon/dme1737.c
+++ b/drivers/hwmon/dme1737.c
@@ -57,11 +57,7 @@ MODULE_PARM_DESC(probe_all_addr, "Include probing of non-standard LPC "
57/* Addresses to scan */ 57/* Addresses to scan */
58static const unsigned short normal_i2c[] = {0x2c, 0x2d, 0x2e, I2C_CLIENT_END}; 58static const unsigned short normal_i2c[] = {0x2c, 0x2d, 0x2e, I2C_CLIENT_END};
59 59
60/* Insmod parameters */ 60enum chips { dme1737, sch5027, sch311x };
61I2C_CLIENT_INSMOD_2(dme1737, sch5027);
62
63/* ISA chip types */
64enum isa_chips { sch311x = sch5027 + 1 };
65 61
66/* --------------------------------------------------------------------- 62/* ---------------------------------------------------------------------
67 * Registers 63 * Registers
@@ -2208,7 +2204,7 @@ exit:
2208} 2204}
2209 2205
2210/* Return 0 if detection is successful, -ENODEV otherwise */ 2206/* Return 0 if detection is successful, -ENODEV otherwise */
2211static int dme1737_i2c_detect(struct i2c_client *client, int kind, 2207static int dme1737_i2c_detect(struct i2c_client *client,
2212 struct i2c_board_info *info) 2208 struct i2c_board_info *info)
2213{ 2209{
2214 struct i2c_adapter *adapter = client->adapter; 2210 struct i2c_adapter *adapter = client->adapter;
@@ -2318,7 +2314,7 @@ static struct i2c_driver dme1737_i2c_driver = {
2318 .remove = dme1737_i2c_remove, 2314 .remove = dme1737_i2c_remove,
2319 .id_table = dme1737_id, 2315 .id_table = dme1737_id,
2320 .detect = dme1737_i2c_detect, 2316 .detect = dme1737_i2c_detect,
2321 .address_data = &addr_data, 2317 .address_list = normal_i2c,
2322}; 2318};
2323 2319
2324/* --------------------------------------------------------------------- 2320/* ---------------------------------------------------------------------
diff --git a/drivers/hwmon/ds1621.c b/drivers/hwmon/ds1621.c
index 2a4c6a05b14..e11363467a8 100644
--- a/drivers/hwmon/ds1621.c
+++ b/drivers/hwmon/ds1621.c
@@ -38,7 +38,6 @@ static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c,
38 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; 38 0x4d, 0x4e, 0x4f, I2C_CLIENT_END };
39 39
40/* Insmod parameters */ 40/* Insmod parameters */
41I2C_CLIENT_INSMOD_1(ds1621);
42static int polarity = -1; 41static int polarity = -1;
43module_param(polarity, int, 0); 42module_param(polarity, int, 0);
44MODULE_PARM_DESC(polarity, "Output's polarity: 0 = active high, 1 = active low"); 43MODULE_PARM_DESC(polarity, "Output's polarity: 0 = active high, 1 = active low");
@@ -224,7 +223,7 @@ static const struct attribute_group ds1621_group = {
224 223
225 224
226/* Return 0 if detection is successful, -ENODEV otherwise */ 225/* Return 0 if detection is successful, -ENODEV otherwise */
227static int ds1621_detect(struct i2c_client *client, int kind, 226static int ds1621_detect(struct i2c_client *client,
228 struct i2c_board_info *info) 227 struct i2c_board_info *info)
229{ 228{
230 struct i2c_adapter *adapter = client->adapter; 229 struct i2c_adapter *adapter = client->adapter;
@@ -305,8 +304,8 @@ static int ds1621_remove(struct i2c_client *client)
305} 304}
306 305
307static const struct i2c_device_id ds1621_id[] = { 306static const struct i2c_device_id ds1621_id[] = {
308 { "ds1621", ds1621 }, 307 { "ds1621", 0 },
309 { "ds1625", ds1621 }, 308 { "ds1625", 0 },
310 { } 309 { }
311}; 310};
312MODULE_DEVICE_TABLE(i2c, ds1621_id); 311MODULE_DEVICE_TABLE(i2c, ds1621_id);
@@ -321,7 +320,7 @@ static struct i2c_driver ds1621_driver = {
321 .remove = ds1621_remove, 320 .remove = ds1621_remove,
322 .id_table = ds1621_id, 321 .id_table = ds1621_id,
323 .detect = ds1621_detect, 322 .detect = ds1621_detect,
324 .address_data = &addr_data, 323 .address_list = normal_i2c,
325}; 324};
326 325
327static int __init ds1621_init(void) 326static int __init ds1621_init(void)
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
index 40dfbcd3f3f..277398f9c93 100644
--- a/drivers/hwmon/f75375s.c
+++ b/drivers/hwmon/f75375s.c
@@ -39,8 +39,7 @@
39/* Addresses to scan */ 39/* Addresses to scan */
40static const unsigned short normal_i2c[] = { 0x2d, 0x2e, I2C_CLIENT_END }; 40static const unsigned short normal_i2c[] = { 0x2d, 0x2e, I2C_CLIENT_END };
41 41
42/* Insmod parameters */ 42enum chips { f75373, f75375 };
43I2C_CLIENT_INSMOD_2(f75373, f75375);
44 43
45/* Fintek F75375 registers */ 44/* Fintek F75375 registers */
46#define F75375_REG_CONFIG0 0x0 45#define F75375_REG_CONFIG0 0x0
@@ -113,7 +112,7 @@ struct f75375_data {
113 s8 temp_max_hyst[2]; 112 s8 temp_max_hyst[2];
114}; 113};
115 114
116static int f75375_detect(struct i2c_client *client, int kind, 115static int f75375_detect(struct i2c_client *client,
117 struct i2c_board_info *info); 116 struct i2c_board_info *info);
118static int f75375_probe(struct i2c_client *client, 117static int f75375_probe(struct i2c_client *client,
119 const struct i2c_device_id *id); 118 const struct i2c_device_id *id);
@@ -135,7 +134,7 @@ static struct i2c_driver f75375_driver = {
135 .remove = f75375_remove, 134 .remove = f75375_remove,
136 .id_table = f75375_id, 135 .id_table = f75375_id,
137 .detect = f75375_detect, 136 .detect = f75375_detect,
138 .address_data = &addr_data, 137 .address_list = normal_i2c,
139}; 138};
140 139
141static inline int f75375_read8(struct i2c_client *client, u8 reg) 140static inline int f75375_read8(struct i2c_client *client, u8 reg)
@@ -677,7 +676,7 @@ static int f75375_remove(struct i2c_client *client)
677} 676}
678 677
679/* Return 0 if detection is successful, -ENODEV otherwise */ 678/* Return 0 if detection is successful, -ENODEV otherwise */
680static int f75375_detect(struct i2c_client *client, int kind, 679static int f75375_detect(struct i2c_client *client,
681 struct i2c_board_info *info) 680 struct i2c_board_info *info)
682{ 681{
683 struct i2c_adapter *adapter = client->adapter; 682 struct i2c_adapter *adapter = client->adapter;
diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c
index 281829cd153..bd0fc67e804 100644
--- a/drivers/hwmon/fschmd.c
+++ b/drivers/hwmon/fschmd.c
@@ -56,7 +56,8 @@ static int nowayout = WATCHDOG_NOWAYOUT;
56module_param(nowayout, int, 0); 56module_param(nowayout, int, 0);
57MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" 57MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
58 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 58 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
59I2C_CLIENT_INSMOD_7(fscpos, fscher, fscscy, fschrc, fschmd, fschds, fscsyl); 59
60enum chips { fscpos, fscher, fscscy, fschrc, fschmd, fschds, fscsyl };
60 61
61/* 62/*
62 * The FSCHMD registers and other defines 63 * The FSCHMD registers and other defines
@@ -221,7 +222,7 @@ static const int FSCHMD_NO_TEMP_SENSORS[7] = { 3, 3, 4, 3, 5, 5, 11 };
221 222
222static int fschmd_probe(struct i2c_client *client, 223static int fschmd_probe(struct i2c_client *client,
223 const struct i2c_device_id *id); 224 const struct i2c_device_id *id);
224static int fschmd_detect(struct i2c_client *client, int kind, 225static int fschmd_detect(struct i2c_client *client,
225 struct i2c_board_info *info); 226 struct i2c_board_info *info);
226static int fschmd_remove(struct i2c_client *client); 227static int fschmd_remove(struct i2c_client *client);
227static struct fschmd_data *fschmd_update_device(struct device *dev); 228static struct fschmd_data *fschmd_update_device(struct device *dev);
@@ -251,7 +252,7 @@ static struct i2c_driver fschmd_driver = {
251 .remove = fschmd_remove, 252 .remove = fschmd_remove,
252 .id_table = fschmd_id, 253 .id_table = fschmd_id,
253 .detect = fschmd_detect, 254 .detect = fschmd_detect,
254 .address_data = &addr_data, 255 .address_list = normal_i2c,
255}; 256};
256 257
257/* 258/*
@@ -1000,7 +1001,7 @@ static void fschmd_dmi_decode(const struct dmi_header *header, void *dummy)
1000 } 1001 }
1001} 1002}
1002 1003
1003static int fschmd_detect(struct i2c_client *client, int _kind, 1004static int fschmd_detect(struct i2c_client *client,
1004 struct i2c_board_info *info) 1005 struct i2c_board_info *info)
1005{ 1006{
1006 enum chips kind; 1007 enum chips kind;
diff --git a/drivers/hwmon/gl518sm.c b/drivers/hwmon/gl518sm.c
index 1d69458aa0b..e7ae5743e18 100644
--- a/drivers/hwmon/gl518sm.c
+++ b/drivers/hwmon/gl518sm.c
@@ -46,8 +46,7 @@
46/* Addresses to scan */ 46/* Addresses to scan */
47static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; 47static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END };
48 48
49/* Insmod parameters */ 49enum chips { gl518sm_r00, gl518sm_r80 };
50I2C_CLIENT_INSMOD_2(gl518sm_r00, gl518sm_r80);
51 50
52/* Many GL518 constants specified below */ 51/* Many GL518 constants specified below */
53 52
@@ -139,8 +138,7 @@ struct gl518_data {
139 138
140static int gl518_probe(struct i2c_client *client, 139static int gl518_probe(struct i2c_client *client,
141 const struct i2c_device_id *id); 140 const struct i2c_device_id *id);
142static int gl518_detect(struct i2c_client *client, int kind, 141static int gl518_detect(struct i2c_client *client, struct i2c_board_info *info);
143 struct i2c_board_info *info);
144static void gl518_init_client(struct i2c_client *client); 142static void gl518_init_client(struct i2c_client *client);
145static int gl518_remove(struct i2c_client *client); 143static int gl518_remove(struct i2c_client *client);
146static int gl518_read_value(struct i2c_client *client, u8 reg); 144static int gl518_read_value(struct i2c_client *client, u8 reg);
@@ -163,7 +161,7 @@ static struct i2c_driver gl518_driver = {
163 .remove = gl518_remove, 161 .remove = gl518_remove,
164 .id_table = gl518_id, 162 .id_table = gl518_id,
165 .detect = gl518_detect, 163 .detect = gl518_detect,
166 .address_data = &addr_data, 164 .address_list = normal_i2c,
167}; 165};
168 166
169/* 167/*
@@ -484,8 +482,7 @@ static const struct attribute_group gl518_group_r80 = {
484 */ 482 */
485 483
486/* Return 0 if detection is successful, -ENODEV otherwise */ 484/* Return 0 if detection is successful, -ENODEV otherwise */
487static int gl518_detect(struct i2c_client *client, int kind, 485static int gl518_detect(struct i2c_client *client, struct i2c_board_info *info)
488 struct i2c_board_info *info)
489{ 486{
490 struct i2c_adapter *adapter = client->adapter; 487 struct i2c_adapter *adapter = client->adapter;
491 int rev; 488 int rev;
diff --git a/drivers/hwmon/gl520sm.c b/drivers/hwmon/gl520sm.c
index 92b5720ceaf..ec588026f0a 100644
--- a/drivers/hwmon/gl520sm.c
+++ b/drivers/hwmon/gl520sm.c
@@ -41,9 +41,6 @@ MODULE_PARM_DESC(extra_sensor_type, "Type of extra sensor (0=autodetect, 1=tempe
41/* Addresses to scan */ 41/* Addresses to scan */
42static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; 42static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END };
43 43
44/* Insmod parameters */
45I2C_CLIENT_INSMOD_1(gl520sm);
46
47/* Many GL520 constants specified below 44/* Many GL520 constants specified below
48One of the inputs can be configured as either temp or voltage. 45One of the inputs can be configured as either temp or voltage.
49That's why _TEMP2 and _IN4 access the same register 46That's why _TEMP2 and _IN4 access the same register
@@ -81,8 +78,7 @@ static const u8 GL520_REG_TEMP_MAX_HYST[] = { 0x06, 0x18 };
81 78
82static int gl520_probe(struct i2c_client *client, 79static int gl520_probe(struct i2c_client *client,
83 const struct i2c_device_id *id); 80 const struct i2c_device_id *id);
84static int gl520_detect(struct i2c_client *client, int kind, 81static int gl520_detect(struct i2c_client *client, struct i2c_board_info *info);
85 struct i2c_board_info *info);
86static void gl520_init_client(struct i2c_client *client); 82static void gl520_init_client(struct i2c_client *client);
87static int gl520_remove(struct i2c_client *client); 83static int gl520_remove(struct i2c_client *client);
88static int gl520_read_value(struct i2c_client *client, u8 reg); 84static int gl520_read_value(struct i2c_client *client, u8 reg);
@@ -91,7 +87,7 @@ static struct gl520_data *gl520_update_device(struct device *dev);
91 87
92/* Driver data */ 88/* Driver data */
93static const struct i2c_device_id gl520_id[] = { 89static const struct i2c_device_id gl520_id[] = {
94 { "gl520sm", gl520sm }, 90 { "gl520sm", 0 },
95 { } 91 { }
96}; 92};
97MODULE_DEVICE_TABLE(i2c, gl520_id); 93MODULE_DEVICE_TABLE(i2c, gl520_id);
@@ -105,7 +101,7 @@ static struct i2c_driver gl520_driver = {
105 .remove = gl520_remove, 101 .remove = gl520_remove,
106 .id_table = gl520_id, 102 .id_table = gl520_id,
107 .detect = gl520_detect, 103 .detect = gl520_detect,
108 .address_data = &addr_data, 104 .address_list = normal_i2c,
109}; 105};
110 106
111/* Client data */ 107/* Client data */
@@ -681,8 +677,7 @@ static const struct attribute_group gl520_group_opt = {
681 */ 677 */
682 678
683/* Return 0 if detection is successful, -ENODEV otherwise */ 679/* Return 0 if detection is successful, -ENODEV otherwise */
684static int gl520_detect(struct i2c_client *client, int kind, 680static int gl520_detect(struct i2c_client *client, struct i2c_board_info *info)
685 struct i2c_board_info *info)
686{ 681{
687 struct i2c_adapter *adapter = client->adapter; 682 struct i2c_adapter *adapter = client->adapter;
688 683
diff --git a/drivers/hwmon/lm63.c b/drivers/hwmon/lm63.c
index 5da66ab04f7..bf81aff7051 100644
--- a/drivers/hwmon/lm63.c
+++ b/drivers/hwmon/lm63.c
@@ -56,12 +56,6 @@
56static const unsigned short normal_i2c[] = { 0x4c, I2C_CLIENT_END }; 56static const unsigned short normal_i2c[] = { 0x4c, I2C_CLIENT_END };
57 57
58/* 58/*
59 * Insmod parameters
60 */
61
62I2C_CLIENT_INSMOD_1(lm63);
63
64/*
65 * The LM63 registers 59 * The LM63 registers
66 */ 60 */
67 61
@@ -134,8 +128,7 @@ static int lm63_remove(struct i2c_client *client);
134 128
135static struct lm63_data *lm63_update_device(struct device *dev); 129static struct lm63_data *lm63_update_device(struct device *dev);
136 130
137static int lm63_detect(struct i2c_client *client, int kind, 131static int lm63_detect(struct i2c_client *client, struct i2c_board_info *info);
138 struct i2c_board_info *info);
139static void lm63_init_client(struct i2c_client *client); 132static void lm63_init_client(struct i2c_client *client);
140 133
141/* 134/*
@@ -143,7 +136,7 @@ static void lm63_init_client(struct i2c_client *client);
143 */ 136 */
144 137
145static const struct i2c_device_id lm63_id[] = { 138static const struct i2c_device_id lm63_id[] = {
146 { "lm63", lm63 }, 139 { "lm63", 0 },
147 { } 140 { }
148}; 141};
149MODULE_DEVICE_TABLE(i2c, lm63_id); 142MODULE_DEVICE_TABLE(i2c, lm63_id);
@@ -157,7 +150,7 @@ static struct i2c_driver lm63_driver = {
157 .remove = lm63_remove, 150 .remove = lm63_remove,
158 .id_table = lm63_id, 151 .id_table = lm63_id,
159 .detect = lm63_detect, 152 .detect = lm63_detect,
160 .address_data = &addr_data, 153 .address_list = normal_i2c,
161}; 154};
162 155
163/* 156/*
@@ -423,7 +416,7 @@ static const struct attribute_group lm63_group_fan1 = {
423 */ 416 */
424 417
425/* Return 0 if detection is successful, -ENODEV otherwise */ 418/* Return 0 if detection is successful, -ENODEV otherwise */
426static int lm63_detect(struct i2c_client *new_client, int kind, 419static int lm63_detect(struct i2c_client *new_client,
427 struct i2c_board_info *info) 420 struct i2c_board_info *info)
428{ 421{
429 struct i2c_adapter *adapter = new_client->adapter; 422 struct i2c_adapter *adapter = new_client->adapter;
diff --git a/drivers/hwmon/lm73.c b/drivers/hwmon/lm73.c
index 0bf8b2a8e9f..c5f39ba103c 100644
--- a/drivers/hwmon/lm73.c
+++ b/drivers/hwmon/lm73.c
@@ -27,9 +27,6 @@
27static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4c, 27static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4c,
28 0x4d, 0x4e, I2C_CLIENT_END }; 28 0x4d, 0x4e, I2C_CLIENT_END };
29 29
30/* Insmod parameters */
31I2C_CLIENT_INSMOD_1(lm73);
32
33/* LM73 registers */ 30/* LM73 registers */
34#define LM73_REG_INPUT 0x00 31#define LM73_REG_INPUT 0x00
35#define LM73_REG_CONF 0x01 32#define LM73_REG_CONF 0x01
@@ -145,13 +142,13 @@ static int lm73_remove(struct i2c_client *client)
145} 142}
146 143
147static const struct i2c_device_id lm73_ids[] = { 144static const struct i2c_device_id lm73_ids[] = {
148 { "lm73", lm73 }, 145 { "lm73", 0 },
149 { /* LIST END */ } 146 { /* LIST END */ }
150}; 147};
151MODULE_DEVICE_TABLE(i2c, lm73_ids); 148MODULE_DEVICE_TABLE(i2c, lm73_ids);
152 149
153/* Return 0 if detection is successful, -ENODEV otherwise */ 150/* Return 0 if detection is successful, -ENODEV otherwise */
154static int lm73_detect(struct i2c_client *new_client, int kind, 151static int lm73_detect(struct i2c_client *new_client,
155 struct i2c_board_info *info) 152 struct i2c_board_info *info)
156{ 153{
157 struct i2c_adapter *adapter = new_client->adapter; 154 struct i2c_adapter *adapter = new_client->adapter;
@@ -182,7 +179,7 @@ static struct i2c_driver lm73_driver = {
182 .remove = lm73_remove, 179 .remove = lm73_remove,
183 .id_table = lm73_ids, 180 .id_table = lm73_ids,
184 .detect = lm73_detect, 181 .detect = lm73_detect,
185 .address_data = &addr_data, 182 .address_list = normal_i2c,
186}; 183};
187 184
188/* module glue */ 185/* module glue */
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index e392548cccb..8ae2cfe2d82 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -32,15 +32,12 @@
32 32
33/* 33/*
34 * This driver handles the LM75 and compatible digital temperature sensors. 34 * This driver handles the LM75 and compatible digital temperature sensors.
35 * Only types which are _not_ listed in I2C_CLIENT_INSMOD_*() need to be
36 * listed here. We start at 9 since I2C_CLIENT_INSMOD_*() currently allow
37 * definition of up to 8 chip types (plus zero).
38 */ 35 */
39 36
40enum lm75_type { /* keep sorted in alphabetical order */ 37enum lm75_type { /* keep sorted in alphabetical order */
41 ds1775 = 9, 38 ds1775,
42 ds75, 39 ds75,
43 /* lm75 -- in I2C_CLIENT_INSMOD_1() */ 40 lm75,
44 lm75a, 41 lm75a,
45 max6625, 42 max6625,
46 max6626, 43 max6626,
@@ -58,9 +55,6 @@ enum lm75_type { /* keep sorted in alphabetical order */
58static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c, 55static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c,
59 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; 56 0x4d, 0x4e, 0x4f, I2C_CLIENT_END };
60 57
61/* Insmod parameters */
62I2C_CLIENT_INSMOD_1(lm75);
63
64 58
65/* The LM75 registers */ 59/* The LM75 registers */
66#define LM75_REG_CONF 0x01 60#define LM75_REG_CONF 0x01
@@ -234,7 +228,7 @@ static const struct i2c_device_id lm75_ids[] = {
234MODULE_DEVICE_TABLE(i2c, lm75_ids); 228MODULE_DEVICE_TABLE(i2c, lm75_ids);
235 229
236/* Return 0 if detection is successful, -ENODEV otherwise */ 230/* Return 0 if detection is successful, -ENODEV otherwise */
237static int lm75_detect(struct i2c_client *new_client, int kind, 231static int lm75_detect(struct i2c_client *new_client,
238 struct i2c_board_info *info) 232 struct i2c_board_info *info)
239{ 233{
240 struct i2c_adapter *adapter = new_client->adapter; 234 struct i2c_adapter *adapter = new_client->adapter;
@@ -295,7 +289,7 @@ static struct i2c_driver lm75_driver = {
295 .remove = lm75_remove, 289 .remove = lm75_remove,
296 .id_table = lm75_ids, 290 .id_table = lm75_ids,
297 .detect = lm75_detect, 291 .detect = lm75_detect,
298 .address_data = &addr_data, 292 .address_list = normal_i2c,
299}; 293};
300 294
301/*-----------------------------------------------------------------------*/ 295/*-----------------------------------------------------------------------*/
diff --git a/drivers/hwmon/lm77.c b/drivers/hwmon/lm77.c
index ac067fd1948..b28a297be50 100644
--- a/drivers/hwmon/lm77.c
+++ b/drivers/hwmon/lm77.c
@@ -39,9 +39,6 @@
39static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 39static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b,
40 I2C_CLIENT_END }; 40 I2C_CLIENT_END };
41 41
42/* Insmod parameters */
43I2C_CLIENT_INSMOD_1(lm77);
44
45/* The LM77 registers */ 42/* The LM77 registers */
46#define LM77_REG_TEMP 0x00 43#define LM77_REG_TEMP 0x00
47#define LM77_REG_CONF 0x01 44#define LM77_REG_CONF 0x01
@@ -66,8 +63,7 @@ struct lm77_data {
66 63
67static int lm77_probe(struct i2c_client *client, 64static int lm77_probe(struct i2c_client *client,
68 const struct i2c_device_id *id); 65 const struct i2c_device_id *id);
69static int lm77_detect(struct i2c_client *client, int kind, 66static int lm77_detect(struct i2c_client *client, struct i2c_board_info *info);
70 struct i2c_board_info *info);
71static void lm77_init_client(struct i2c_client *client); 67static void lm77_init_client(struct i2c_client *client);
72static int lm77_remove(struct i2c_client *client); 68static int lm77_remove(struct i2c_client *client);
73static u16 lm77_read_value(struct i2c_client *client, u8 reg); 69static u16 lm77_read_value(struct i2c_client *client, u8 reg);
@@ -77,7 +73,7 @@ static struct lm77_data *lm77_update_device(struct device *dev);
77 73
78 74
79static const struct i2c_device_id lm77_id[] = { 75static const struct i2c_device_id lm77_id[] = {
80 { "lm77", lm77 }, 76 { "lm77", 0 },
81 { } 77 { }
82}; 78};
83MODULE_DEVICE_TABLE(i2c, lm77_id); 79MODULE_DEVICE_TABLE(i2c, lm77_id);
@@ -92,7 +88,7 @@ static struct i2c_driver lm77_driver = {
92 .remove = lm77_remove, 88 .remove = lm77_remove,
93 .id_table = lm77_id, 89 .id_table = lm77_id,
94 .detect = lm77_detect, 90 .detect = lm77_detect,
95 .address_data = &addr_data, 91 .address_list = normal_i2c,
96}; 92};
97 93
98/* straight from the datasheet */ 94/* straight from the datasheet */
@@ -245,7 +241,7 @@ static const struct attribute_group lm77_group = {
245}; 241};
246 242
247/* Return 0 if detection is successful, -ENODEV otherwise */ 243/* Return 0 if detection is successful, -ENODEV otherwise */
248static int lm77_detect(struct i2c_client *new_client, int kind, 244static int lm77_detect(struct i2c_client *new_client,
249 struct i2c_board_info *info) 245 struct i2c_board_info *info)
250{ 246{
251 struct i2c_adapter *adapter = new_client->adapter; 247 struct i2c_adapter *adapter = new_client->adapter;
diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c
index 5978291cebb..cadcbd90ff3 100644
--- a/drivers/hwmon/lm78.c
+++ b/drivers/hwmon/lm78.c
@@ -41,8 +41,7 @@ static const unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
41 0x2e, 0x2f, I2C_CLIENT_END }; 41 0x2e, 0x2f, I2C_CLIENT_END };
42static unsigned short isa_address = 0x290; 42static unsigned short isa_address = 0x290;
43 43
44/* Insmod parameters */ 44enum chips { lm78, lm79 };
45I2C_CLIENT_INSMOD_2(lm78, lm79);
46 45
47/* Many LM78 constants specified below */ 46/* Many LM78 constants specified below */
48 47
@@ -142,7 +141,7 @@ struct lm78_data {
142}; 141};
143 142
144 143
145static int lm78_i2c_detect(struct i2c_client *client, int kind, 144static int lm78_i2c_detect(struct i2c_client *client,
146 struct i2c_board_info *info); 145 struct i2c_board_info *info);
147static int lm78_i2c_probe(struct i2c_client *client, 146static int lm78_i2c_probe(struct i2c_client *client,
148 const struct i2c_device_id *id); 147 const struct i2c_device_id *id);
@@ -173,7 +172,7 @@ static struct i2c_driver lm78_driver = {
173 .remove = lm78_i2c_remove, 172 .remove = lm78_i2c_remove,
174 .id_table = lm78_i2c_id, 173 .id_table = lm78_i2c_id,
175 .detect = lm78_i2c_detect, 174 .detect = lm78_i2c_detect,
176 .address_data = &addr_data, 175 .address_list = normal_i2c,
177}; 176};
178 177
179static struct platform_driver lm78_isa_driver = { 178static struct platform_driver lm78_isa_driver = {
@@ -558,7 +557,7 @@ static int lm78_alias_detect(struct i2c_client *client, u8 chipid)
558 return 1; 557 return 1;
559} 558}
560 559
561static int lm78_i2c_detect(struct i2c_client *client, int kind, 560static int lm78_i2c_detect(struct i2c_client *client,
562 struct i2c_board_info *info) 561 struct i2c_board_info *info)
563{ 562{
564 int i; 563 int i;
diff --git a/drivers/hwmon/lm80.c b/drivers/hwmon/lm80.c
index bcffc189940..18a0e6c5fe8 100644
--- a/drivers/hwmon/lm80.c
+++ b/drivers/hwmon/lm80.c
@@ -35,9 +35,6 @@
35static const unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 35static const unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
36 0x2e, 0x2f, I2C_CLIENT_END }; 36 0x2e, 0x2f, I2C_CLIENT_END };
37 37
38/* Insmod parameters */
39I2C_CLIENT_INSMOD_1(lm80);
40
41/* Many LM80 constants specified below */ 38/* Many LM80 constants specified below */
42 39
43/* The LM80 registers */ 40/* The LM80 registers */
@@ -133,8 +130,7 @@ struct lm80_data {
133 130
134static int lm80_probe(struct i2c_client *client, 131static int lm80_probe(struct i2c_client *client,
135 const struct i2c_device_id *id); 132 const struct i2c_device_id *id);
136static int lm80_detect(struct i2c_client *client, int kind, 133static int lm80_detect(struct i2c_client *client, struct i2c_board_info *info);
137 struct i2c_board_info *info);
138static void lm80_init_client(struct i2c_client *client); 134static void lm80_init_client(struct i2c_client *client);
139static int lm80_remove(struct i2c_client *client); 135static int lm80_remove(struct i2c_client *client);
140static struct lm80_data *lm80_update_device(struct device *dev); 136static struct lm80_data *lm80_update_device(struct device *dev);
@@ -146,7 +142,7 @@ static int lm80_write_value(struct i2c_client *client, u8 reg, u8 value);
146 */ 142 */
147 143
148static const struct i2c_device_id lm80_id[] = { 144static const struct i2c_device_id lm80_id[] = {
149 { "lm80", lm80 }, 145 { "lm80", 0 },
150 { } 146 { }
151}; 147};
152MODULE_DEVICE_TABLE(i2c, lm80_id); 148MODULE_DEVICE_TABLE(i2c, lm80_id);
@@ -160,7 +156,7 @@ static struct i2c_driver lm80_driver = {
160 .remove = lm80_remove, 156 .remove = lm80_remove,
161 .id_table = lm80_id, 157 .id_table = lm80_id,
162 .detect = lm80_detect, 158 .detect = lm80_detect,
163 .address_data = &addr_data, 159 .address_list = normal_i2c,
164}; 160};
165 161
166/* 162/*
@@ -447,8 +443,7 @@ static const struct attribute_group lm80_group = {
447}; 443};
448 444
449/* Return 0 if detection is successful, -ENODEV otherwise */ 445/* Return 0 if detection is successful, -ENODEV otherwise */
450static int lm80_detect(struct i2c_client *client, int kind, 446static int lm80_detect(struct i2c_client *client, struct i2c_board_info *info)
451 struct i2c_board_info *info)
452{ 447{
453 struct i2c_adapter *adapter = client->adapter; 448 struct i2c_adapter *adapter = client->adapter;
454 int i, cur; 449 int i, cur;
diff --git a/drivers/hwmon/lm83.c b/drivers/hwmon/lm83.c
index 08b03e6ed0b..8290476aee4 100644
--- a/drivers/hwmon/lm83.c
+++ b/drivers/hwmon/lm83.c
@@ -51,11 +51,7 @@
51static const unsigned short normal_i2c[] = { 51static const unsigned short normal_i2c[] = {
52 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, 0x4d, 0x4e, I2C_CLIENT_END }; 52 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, 0x4d, 0x4e, I2C_CLIENT_END };
53 53
54/* 54enum chips { lm83, lm82 };
55 * Insmod parameters
56 */
57
58I2C_CLIENT_INSMOD_2(lm83, lm82);
59 55
60/* 56/*
61 * The LM83 registers 57 * The LM83 registers
@@ -118,7 +114,7 @@ static const u8 LM83_REG_W_HIGH[] = {
118 * Functions declaration 114 * Functions declaration
119 */ 115 */
120 116
121static int lm83_detect(struct i2c_client *new_client, int kind, 117static int lm83_detect(struct i2c_client *new_client,
122 struct i2c_board_info *info); 118 struct i2c_board_info *info);
123static int lm83_probe(struct i2c_client *client, 119static int lm83_probe(struct i2c_client *client,
124 const struct i2c_device_id *id); 120 const struct i2c_device_id *id);
@@ -145,7 +141,7 @@ static struct i2c_driver lm83_driver = {
145 .remove = lm83_remove, 141 .remove = lm83_remove,
146 .id_table = lm83_id, 142 .id_table = lm83_id,
147 .detect = lm83_detect, 143 .detect = lm83_detect,
148 .address_data = &addr_data, 144 .address_list = normal_i2c,
149}; 145};
150 146
151/* 147/*
@@ -291,7 +287,7 @@ static const struct attribute_group lm83_group_opt = {
291 */ 287 */
292 288
293/* Return 0 if detection is successful, -ENODEV otherwise */ 289/* Return 0 if detection is successful, -ENODEV otherwise */
294static int lm83_detect(struct i2c_client *new_client, int kind, 290static int lm83_detect(struct i2c_client *new_client,
295 struct i2c_board_info *info) 291 struct i2c_board_info *info)
296{ 292{
297 struct i2c_adapter *adapter = new_client->adapter; 293 struct i2c_adapter *adapter = new_client->adapter;
diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c
index d56da2e7470..b3841a61559 100644
--- a/drivers/hwmon/lm85.c
+++ b/drivers/hwmon/lm85.c
@@ -38,9 +38,11 @@
38/* Addresses to scan */ 38/* Addresses to scan */
39static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; 39static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
40 40
41/* Insmod parameters */ 41enum chips {
42I2C_CLIENT_INSMOD_7(lm85b, lm85c, adm1027, adt7463, adt7468, emc6d100, 42 any_chip, lm85b, lm85c,
43 emc6d102); 43 adm1027, adt7463, adt7468,
44 emc6d100, emc6d102
45};
44 46
45/* The LM85 registers */ 47/* The LM85 registers */
46 48
@@ -323,8 +325,7 @@ struct lm85_data {
323 struct lm85_zone zone[3]; 325 struct lm85_zone zone[3];
324}; 326};
325 327
326static int lm85_detect(struct i2c_client *client, int kind, 328static int lm85_detect(struct i2c_client *client, struct i2c_board_info *info);
327 struct i2c_board_info *info);
328static int lm85_probe(struct i2c_client *client, 329static int lm85_probe(struct i2c_client *client,
329 const struct i2c_device_id *id); 330 const struct i2c_device_id *id);
330static int lm85_remove(struct i2c_client *client); 331static int lm85_remove(struct i2c_client *client);
@@ -357,7 +358,7 @@ static struct i2c_driver lm85_driver = {
357 .remove = lm85_remove, 358 .remove = lm85_remove,
358 .id_table = lm85_id, 359 .id_table = lm85_id,
359 .detect = lm85_detect, 360 .detect = lm85_detect,
360 .address_data = &addr_data, 361 .address_list = normal_i2c,
361}; 362};
362 363
363 364
@@ -1156,8 +1157,7 @@ static int lm85_is_fake(struct i2c_client *client)
1156} 1157}
1157 1158
1158/* Return 0 if detection is successful, -ENODEV otherwise */ 1159/* Return 0 if detection is successful, -ENODEV otherwise */
1159static int lm85_detect(struct i2c_client *client, int kind, 1160static int lm85_detect(struct i2c_client *client, struct i2c_board_info *info)
1160 struct i2c_board_info *info)
1161{ 1161{
1162 struct i2c_adapter *adapter = client->adapter; 1162 struct i2c_adapter *adapter = client->adapter;
1163 int address = client->addr; 1163 int address = client->addr;
diff --git a/drivers/hwmon/lm87.c b/drivers/hwmon/lm87.c
index 4929b1815ee..f1e6e7512ff 100644
--- a/drivers/hwmon/lm87.c
+++ b/drivers/hwmon/lm87.c
@@ -74,11 +74,7 @@
74 74
75static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; 75static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
76 76
77/* 77enum chips { lm87, adm1024 };
78 * Insmod parameters
79 */
80
81I2C_CLIENT_INSMOD_2(lm87, adm1024);
82 78
83/* 79/*
84 * The LM87 registers 80 * The LM87 registers
@@ -158,7 +154,7 @@ static u8 LM87_REG_TEMP_LOW[3] = { 0x3A, 0x38, 0x2C };
158 154
159static int lm87_probe(struct i2c_client *client, 155static int lm87_probe(struct i2c_client *client,
160 const struct i2c_device_id *id); 156 const struct i2c_device_id *id);
161static int lm87_detect(struct i2c_client *new_client, int kind, 157static int lm87_detect(struct i2c_client *new_client,
162 struct i2c_board_info *info); 158 struct i2c_board_info *info);
163static void lm87_init_client(struct i2c_client *client); 159static void lm87_init_client(struct i2c_client *client);
164static int lm87_remove(struct i2c_client *client); 160static int lm87_remove(struct i2c_client *client);
@@ -184,7 +180,7 @@ static struct i2c_driver lm87_driver = {
184 .remove = lm87_remove, 180 .remove = lm87_remove,
185 .id_table = lm87_id, 181 .id_table = lm87_id,
186 .detect = lm87_detect, 182 .detect = lm87_detect,
187 .address_data = &addr_data, 183 .address_list = normal_i2c,
188}; 184};
189 185
190/* 186/*
@@ -662,7 +658,7 @@ static const struct attribute_group lm87_group_opt = {
662}; 658};
663 659
664/* Return 0 if detection is successful, -ENODEV otherwise */ 660/* Return 0 if detection is successful, -ENODEV otherwise */
665static int lm87_detect(struct i2c_client *new_client, int kind, 661static int lm87_detect(struct i2c_client *new_client,
666 struct i2c_board_info *info) 662 struct i2c_board_info *info)
667{ 663{
668 struct i2c_adapter *adapter = new_client->adapter; 664 struct i2c_adapter *adapter = new_client->adapter;
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index b7c905f50ed..7c9bdc16742 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -93,12 +93,7 @@
93static const unsigned short normal_i2c[] = { 93static const unsigned short normal_i2c[] = {
94 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, 0x4d, 0x4e, I2C_CLIENT_END }; 94 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, 0x4d, 0x4e, I2C_CLIENT_END };
95 95
96/* 96enum chips { lm90, adm1032, lm99, lm86, max6657, adt7461, max6680, max6646 };
97 * Insmod parameters
98 */
99
100I2C_CLIENT_INSMOD_8(lm90, adm1032, lm99, lm86, max6657, adt7461, max6680,
101 max6646);
102 97
103/* 98/*
104 * The LM90 registers 99 * The LM90 registers
@@ -152,8 +147,7 @@ I2C_CLIENT_INSMOD_8(lm90, adm1032, lm99, lm86, max6657, adt7461, max6680,
152 * Functions declaration 147 * Functions declaration
153 */ 148 */
154 149
155static int lm90_detect(struct i2c_client *client, int kind, 150static int lm90_detect(struct i2c_client *client, struct i2c_board_info *info);
156 struct i2c_board_info *info);
157static int lm90_probe(struct i2c_client *client, 151static int lm90_probe(struct i2c_client *client,
158 const struct i2c_device_id *id); 152 const struct i2c_device_id *id);
159static void lm90_init_client(struct i2c_client *client); 153static void lm90_init_client(struct i2c_client *client);
@@ -192,7 +186,7 @@ static struct i2c_driver lm90_driver = {
192 .remove = lm90_remove, 186 .remove = lm90_remove,
193 .id_table = lm90_id, 187 .id_table = lm90_id,
194 .detect = lm90_detect, 188 .detect = lm90_detect,
195 .address_data = &addr_data, 189 .address_list = normal_i2c,
196}; 190};
197 191
198/* 192/*
@@ -656,7 +650,7 @@ static int lm90_read_reg(struct i2c_client* client, u8 reg, u8 *value)
656} 650}
657 651
658/* Return 0 if detection is successful, -ENODEV otherwise */ 652/* Return 0 if detection is successful, -ENODEV otherwise */
659static int lm90_detect(struct i2c_client *new_client, int kind, 653static int lm90_detect(struct i2c_client *new_client,
660 struct i2c_board_info *info) 654 struct i2c_board_info *info)
661{ 655{
662 struct i2c_adapter *adapter = new_client->adapter; 656 struct i2c_adapter *adapter = new_client->adapter;
diff --git a/drivers/hwmon/lm92.c b/drivers/hwmon/lm92.c
index 47ac698709d..7c31e6205f8 100644
--- a/drivers/hwmon/lm92.c
+++ b/drivers/hwmon/lm92.c
@@ -54,9 +54,6 @@
54static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 54static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b,
55 I2C_CLIENT_END }; 55 I2C_CLIENT_END };
56 56
57/* Insmod parameters */
58I2C_CLIENT_INSMOD_1(lm92);
59
60/* The LM92 registers */ 57/* The LM92 registers */
61#define LM92_REG_CONFIG 0x01 /* 8-bit, RW */ 58#define LM92_REG_CONFIG 0x01 /* 8-bit, RW */
62#define LM92_REG_TEMP 0x00 /* 16-bit, RO */ 59#define LM92_REG_TEMP 0x00 /* 16-bit, RO */
@@ -319,7 +316,7 @@ static const struct attribute_group lm92_group = {
319}; 316};
320 317
321/* Return 0 if detection is successful, -ENODEV otherwise */ 318/* Return 0 if detection is successful, -ENODEV otherwise */
322static int lm92_detect(struct i2c_client *new_client, int kind, 319static int lm92_detect(struct i2c_client *new_client,
323 struct i2c_board_info *info) 320 struct i2c_board_info *info)
324{ 321{
325 struct i2c_adapter *adapter = new_client->adapter; 322 struct i2c_adapter *adapter = new_client->adapter;
@@ -401,7 +398,7 @@ static int lm92_remove(struct i2c_client *client)
401 */ 398 */
402 399
403static const struct i2c_device_id lm92_id[] = { 400static const struct i2c_device_id lm92_id[] = {
404 { "lm92", lm92 }, 401 { "lm92", 0 },
405 /* max6635 could be added here */ 402 /* max6635 could be added here */
406 { } 403 { }
407}; 404};
@@ -416,7 +413,7 @@ static struct i2c_driver lm92_driver = {
416 .remove = lm92_remove, 413 .remove = lm92_remove,
417 .id_table = lm92_id, 414 .id_table = lm92_id,
418 .detect = lm92_detect, 415 .detect = lm92_detect,
419 .address_data = &addr_data, 416 .address_list = normal_i2c,
420}; 417};
421 418
422static int __init sensors_lm92_init(void) 419static int __init sensors_lm92_init(void)
diff --git a/drivers/hwmon/lm93.c b/drivers/hwmon/lm93.c
index 124dd7cea54..6669255aadc 100644
--- a/drivers/hwmon/lm93.c
+++ b/drivers/hwmon/lm93.c
@@ -145,7 +145,6 @@
145static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; 145static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
146 146
147/* Insmod parameters */ 147/* Insmod parameters */
148I2C_CLIENT_INSMOD_1(lm93);
149 148
150static int disable_block; 149static int disable_block;
151module_param(disable_block, bool, 0); 150module_param(disable_block, bool, 0);
@@ -2501,8 +2500,7 @@ static void lm93_init_client(struct i2c_client *client)
2501} 2500}
2502 2501
2503/* Return 0 if detection is successful, -ENODEV otherwise */ 2502/* Return 0 if detection is successful, -ENODEV otherwise */
2504static int lm93_detect(struct i2c_client *client, int kind, 2503static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info)
2505 struct i2c_board_info *info)
2506{ 2504{
2507 struct i2c_adapter *adapter = client->adapter; 2505 struct i2c_adapter *adapter = client->adapter;
2508 int mfr, ver; 2506 int mfr, ver;
@@ -2603,7 +2601,7 @@ static int lm93_remove(struct i2c_client *client)
2603} 2601}
2604 2602
2605static const struct i2c_device_id lm93_id[] = { 2603static const struct i2c_device_id lm93_id[] = {
2606 { "lm93", lm93 }, 2604 { "lm93", 0 },
2607 { } 2605 { }
2608}; 2606};
2609MODULE_DEVICE_TABLE(i2c, lm93_id); 2607MODULE_DEVICE_TABLE(i2c, lm93_id);
@@ -2617,7 +2615,7 @@ static struct i2c_driver lm93_driver = {
2617 .remove = lm93_remove, 2615 .remove = lm93_remove,
2618 .id_table = lm93_id, 2616 .id_table = lm93_id,
2619 .detect = lm93_detect, 2617 .detect = lm93_detect,
2620 .address_data = &addr_data, 2618 .address_list = normal_i2c,
2621}; 2619};
2622 2620
2623static int __init lm93_init(void) 2621static int __init lm93_init(void)
diff --git a/drivers/hwmon/lm95241.c b/drivers/hwmon/lm95241.c
index 906b896cf1d..8fc8eb8cba4 100644
--- a/drivers/hwmon/lm95241.c
+++ b/drivers/hwmon/lm95241.c
@@ -39,9 +39,6 @@
39static const unsigned short normal_i2c[] = { 39static const unsigned short normal_i2c[] = {
40 0x19, 0x2a, 0x2b, I2C_CLIENT_END}; 40 0x19, 0x2a, 0x2b, I2C_CLIENT_END};
41 41
42/* Insmod parameters */
43I2C_CLIENT_INSMOD_1(lm95241);
44
45/* LM95241 registers */ 42/* LM95241 registers */
46#define LM95241_REG_R_MAN_ID 0xFE 43#define LM95241_REG_R_MAN_ID 0xFE
47#define LM95241_REG_R_CHIP_ID 0xFF 44#define LM95241_REG_R_CHIP_ID 0xFF
@@ -310,7 +307,7 @@ static const struct attribute_group lm95241_group = {
310}; 307};
311 308
312/* Return 0 if detection is successful, -ENODEV otherwise */ 309/* Return 0 if detection is successful, -ENODEV otherwise */
313static int lm95241_detect(struct i2c_client *new_client, int kind, 310static int lm95241_detect(struct i2c_client *new_client,
314 struct i2c_board_info *info) 311 struct i2c_board_info *info)
315{ 312{
316 struct i2c_adapter *adapter = new_client->adapter; 313 struct i2c_adapter *adapter = new_client->adapter;
@@ -446,7 +443,7 @@ static struct lm95241_data *lm95241_update_device(struct device *dev)
446 443
447/* Driver data (common to all clients) */ 444/* Driver data (common to all clients) */
448static const struct i2c_device_id lm95241_id[] = { 445static const struct i2c_device_id lm95241_id[] = {
449 { "lm95241", lm95241 }, 446 { "lm95241", 0 },
450 { } 447 { }
451}; 448};
452MODULE_DEVICE_TABLE(i2c, lm95241_id); 449MODULE_DEVICE_TABLE(i2c, lm95241_id);
@@ -460,7 +457,7 @@ static struct i2c_driver lm95241_driver = {
460 .remove = lm95241_remove, 457 .remove = lm95241_remove,
461 .id_table = lm95241_id, 458 .id_table = lm95241_id,
462 .detect = lm95241_detect, 459 .detect = lm95241_detect,
463 .address_data = &addr_data, 460 .address_list = normal_i2c,
464}; 461};
465 462
466static int __init sensors_lm95241_init(void) 463static int __init sensors_lm95241_init(void)
diff --git a/drivers/hwmon/max1619.c b/drivers/hwmon/max1619.c
index 7fcf5ff89e7..022ded09810 100644
--- a/drivers/hwmon/max1619.c
+++ b/drivers/hwmon/max1619.c
@@ -41,12 +41,6 @@ static const unsigned short normal_i2c[] = {
41 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, 0x4d, 0x4e, I2C_CLIENT_END }; 41 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, 0x4d, 0x4e, I2C_CLIENT_END };
42 42
43/* 43/*
44 * Insmod parameters
45 */
46
47I2C_CLIENT_INSMOD_1(max1619);
48
49/*
50 * The MAX1619 registers 44 * The MAX1619 registers
51 */ 45 */
52 46
@@ -88,7 +82,7 @@ static int temp_to_reg(int val)
88 82
89static int max1619_probe(struct i2c_client *client, 83static int max1619_probe(struct i2c_client *client,
90 const struct i2c_device_id *id); 84 const struct i2c_device_id *id);
91static int max1619_detect(struct i2c_client *client, int kind, 85static int max1619_detect(struct i2c_client *client,
92 struct i2c_board_info *info); 86 struct i2c_board_info *info);
93static void max1619_init_client(struct i2c_client *client); 87static void max1619_init_client(struct i2c_client *client);
94static int max1619_remove(struct i2c_client *client); 88static int max1619_remove(struct i2c_client *client);
@@ -99,7 +93,7 @@ static struct max1619_data *max1619_update_device(struct device *dev);
99 */ 93 */
100 94
101static const struct i2c_device_id max1619_id[] = { 95static const struct i2c_device_id max1619_id[] = {
102 { "max1619", max1619 }, 96 { "max1619", 0 },
103 { } 97 { }
104}; 98};
105MODULE_DEVICE_TABLE(i2c, max1619_id); 99MODULE_DEVICE_TABLE(i2c, max1619_id);
@@ -113,7 +107,7 @@ static struct i2c_driver max1619_driver = {
113 .remove = max1619_remove, 107 .remove = max1619_remove,
114 .id_table = max1619_id, 108 .id_table = max1619_id,
115 .detect = max1619_detect, 109 .detect = max1619_detect,
116 .address_data = &addr_data, 110 .address_list = normal_i2c,
117}; 111};
118 112
119/* 113/*
@@ -226,7 +220,7 @@ static const struct attribute_group max1619_group = {
226 */ 220 */
227 221
228/* Return 0 if detection is successful, -ENODEV otherwise */ 222/* Return 0 if detection is successful, -ENODEV otherwise */
229static int max1619_detect(struct i2c_client *client, int kind, 223static int max1619_detect(struct i2c_client *client,
230 struct i2c_board_info *info) 224 struct i2c_board_info *info)
231{ 225{
232 struct i2c_adapter *adapter = client->adapter; 226 struct i2c_adapter *adapter = client->adapter;
diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c
index 1da561e0cb3..a0160ee5cae 100644
--- a/drivers/hwmon/max6650.c
+++ b/drivers/hwmon/max6650.c
@@ -62,8 +62,6 @@ module_param(fan_voltage, int, S_IRUGO);
62module_param(prescaler, int, S_IRUGO); 62module_param(prescaler, int, S_IRUGO);
63module_param(clock, int, S_IRUGO); 63module_param(clock, int, S_IRUGO);
64 64
65I2C_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
117static int max6650_probe(struct i2c_client *client, 115static int max6650_probe(struct i2c_client *client,
118 const struct i2c_device_id *id); 116 const struct i2c_device_id *id);
119static int max6650_detect(struct i2c_client *client, int kind, 117static int max6650_detect(struct i2c_client *client,
120 struct i2c_board_info *info); 118 struct i2c_board_info *info);
121static int max6650_init_client(struct i2c_client *client); 119static int max6650_init_client(struct i2c_client *client);
122static int max6650_remove(struct i2c_client *client); 120static 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
129static const struct i2c_device_id max6650_id[] = { 127static const struct i2c_device_id max6650_id[] = {
130 { "max6650", max6650 }, 128 { "max6650", 0 },
131 { } 129 { }
132}; 130};
133MODULE_DEVICE_TABLE(i2c, max6650_id); 131MODULE_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,7 +526,7 @@ 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 */
531static int max6650_detect(struct i2c_client *client, int kind, 529static 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;
diff --git a/drivers/hwmon/pcf8591.c b/drivers/hwmon/pcf8591.c
index 1d7ffebd679..d4478794985 100644
--- a/drivers/hwmon/pcf8591.c
+++ b/drivers/hwmon/pcf8591.c
@@ -29,7 +29,6 @@ static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c,
29 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; 29 0x4d, 0x4e, 0x4f, I2C_CLIENT_END };
30 30
31/* Insmod parameters */ 31/* Insmod parameters */
32I2C_CLIENT_INSMOD_1(pcf8591);
33 32
34static int input_mode; 33static int input_mode;
35module_param(input_mode, int, 0); 34module_param(input_mode, int, 0);
@@ -169,7 +168,7 @@ static const struct attribute_group pcf8591_attr_group_opt = {
169 */ 168 */
170 169
171/* Return 0 if detection is successful, -ENODEV otherwise */ 170/* Return 0 if detection is successful, -ENODEV otherwise */
172static int pcf8591_detect(struct i2c_client *client, int kind, 171static int pcf8591_detect(struct i2c_client *client,
173 struct i2c_board_info *info) 172 struct i2c_board_info *info)
174{ 173{
175 struct i2c_adapter *adapter = client->adapter; 174 struct i2c_adapter *adapter = client->adapter;
@@ -299,7 +298,7 @@ static struct i2c_driver pcf8591_driver = {
299 298
300 .class = I2C_CLASS_HWMON, /* Nearest choice */ 299 .class = I2C_CLASS_HWMON, /* Nearest choice */
301 .detect = pcf8591_detect, 300 .detect = pcf8591_detect,
302 .address_data = &addr_data, 301 .address_list = normal_i2c,
303}; 302};
304 303
305static int __init pcf8591_init(void) 304static int __init pcf8591_init(void)
diff --git a/drivers/hwmon/smsc47m192.c b/drivers/hwmon/smsc47m192.c
index 4d88c045781..40b26673d87 100644
--- a/drivers/hwmon/smsc47m192.c
+++ b/drivers/hwmon/smsc47m192.c
@@ -36,9 +36,6 @@
36/* Addresses to scan */ 36/* Addresses to scan */
37static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; 37static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END };
38 38
39/* Insmod parameters */
40I2C_CLIENT_INSMOD_1(smsc47m192);
41
42/* SMSC47M192 registers */ 39/* SMSC47M192 registers */
43#define SMSC47M192_REG_IN(nr) ((nr)<6 ? (0x20 + (nr)) : \ 40#define SMSC47M192_REG_IN(nr) ((nr)<6 ? (0x20 + (nr)) : \
44 (0x50 + (nr) - 6)) 41 (0x50 + (nr) - 6))
@@ -115,13 +112,13 @@ struct smsc47m192_data {
115 112
116static int smsc47m192_probe(struct i2c_client *client, 113static int smsc47m192_probe(struct i2c_client *client,
117 const struct i2c_device_id *id); 114 const struct i2c_device_id *id);
118static int smsc47m192_detect(struct i2c_client *client, int kind, 115static int smsc47m192_detect(struct i2c_client *client,
119 struct i2c_board_info *info); 116 struct i2c_board_info *info);
120static int smsc47m192_remove(struct i2c_client *client); 117static int smsc47m192_remove(struct i2c_client *client);
121static struct smsc47m192_data *smsc47m192_update_device(struct device *dev); 118static struct smsc47m192_data *smsc47m192_update_device(struct device *dev);
122 119
123static const struct i2c_device_id smsc47m192_id[] = { 120static const struct i2c_device_id smsc47m192_id[] = {
124 { "smsc47m192", smsc47m192 }, 121 { "smsc47m192", 0 },
125 { } 122 { }
126}; 123};
127MODULE_DEVICE_TABLE(i2c, smsc47m192_id); 124MODULE_DEVICE_TABLE(i2c, smsc47m192_id);
@@ -135,7 +132,7 @@ static struct i2c_driver smsc47m192_driver = {
135 .remove = smsc47m192_remove, 132 .remove = smsc47m192_remove,
136 .id_table = smsc47m192_id, 133 .id_table = smsc47m192_id,
137 .detect = smsc47m192_detect, 134 .detect = smsc47m192_detect,
138 .address_data = &addr_data, 135 .address_list = normal_i2c,
139}; 136};
140 137
141/* Voltages */ 138/* Voltages */
@@ -481,7 +478,7 @@ static void smsc47m192_init_client(struct i2c_client *client)
481} 478}
482 479
483/* Return 0 if detection is successful, -ENODEV otherwise */ 480/* Return 0 if detection is successful, -ENODEV otherwise */
484static int smsc47m192_detect(struct i2c_client *client, int kind, 481static int smsc47m192_detect(struct i2c_client *client,
485 struct i2c_board_info *info) 482 struct i2c_board_info *info)
486{ 483{
487 struct i2c_adapter *adapter = client->adapter; 484 struct i2c_adapter *adapter = client->adapter;
diff --git a/drivers/hwmon/thmc50.c b/drivers/hwmon/thmc50.c
index 4b793849c73..7dfb4dec4c5 100644
--- a/drivers/hwmon/thmc50.c
+++ b/drivers/hwmon/thmc50.c
@@ -35,7 +35,7 @@ MODULE_LICENSE("GPL");
35static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; 35static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
36 36
37/* Insmod parameters */ 37/* Insmod parameters */
38I2C_CLIENT_INSMOD_2(thmc50, adm1022); 38enum chips { thmc50, adm1022 };
39 39
40static unsigned short adm1022_temp3[16]; 40static unsigned short adm1022_temp3[16];
41static unsigned int adm1022_temp3_num; 41static unsigned int adm1022_temp3_num;
@@ -84,7 +84,7 @@ struct thmc50_data {
84 u8 alarms; 84 u8 alarms;
85}; 85};
86 86
87static int thmc50_detect(struct i2c_client *client, int kind, 87static int thmc50_detect(struct i2c_client *client,
88 struct i2c_board_info *info); 88 struct i2c_board_info *info);
89static int thmc50_probe(struct i2c_client *client, 89static int thmc50_probe(struct i2c_client *client,
90 const struct i2c_device_id *id); 90 const struct i2c_device_id *id);
@@ -108,7 +108,7 @@ static struct i2c_driver thmc50_driver = {
108 .remove = thmc50_remove, 108 .remove = thmc50_remove,
109 .id_table = thmc50_id, 109 .id_table = thmc50_id,
110 .detect = thmc50_detect, 110 .detect = thmc50_detect,
111 .address_data = &addr_data, 111 .address_list = normal_i2c,
112}; 112};
113 113
114static ssize_t show_analog_out(struct device *dev, 114static ssize_t show_analog_out(struct device *dev,
@@ -286,7 +286,7 @@ static const struct attribute_group temp3_group = {
286}; 286};
287 287
288/* Return 0 if detection is successful, -ENODEV otherwise */ 288/* Return 0 if detection is successful, -ENODEV otherwise */
289static int thmc50_detect(struct i2c_client *client, int kind, 289static int thmc50_detect(struct i2c_client *client,
290 struct i2c_board_info *info) 290 struct i2c_board_info *info)
291{ 291{
292 unsigned company; 292 unsigned company;
diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c
index ee9673467c4..a13b30e8d8d 100644
--- a/drivers/hwmon/tmp401.c
+++ b/drivers/hwmon/tmp401.c
@@ -42,8 +42,7 @@
42/* Addresses to scan */ 42/* Addresses to scan */
43static const unsigned short normal_i2c[] = { 0x4c, I2C_CLIENT_END }; 43static const unsigned short normal_i2c[] = { 0x4c, I2C_CLIENT_END };
44 44
45/* Insmod parameters */ 45enum chips { tmp401, tmp411 };
46I2C_CLIENT_INSMOD_2(tmp401, tmp411);
47 46
48/* 47/*
49 * The TMP401 registers, note some registers have different addresses for 48 * The TMP401 registers, note some registers have different addresses for
@@ -98,7 +97,7 @@ static const u8 TMP411_TEMP_HIGHEST_LSB[2] = { 0x33, 0x37 };
98 97
99static int tmp401_probe(struct i2c_client *client, 98static int tmp401_probe(struct i2c_client *client,
100 const struct i2c_device_id *id); 99 const struct i2c_device_id *id);
101static int tmp401_detect(struct i2c_client *client, int kind, 100static int tmp401_detect(struct i2c_client *client,
102 struct i2c_board_info *info); 101 struct i2c_board_info *info);
103static int tmp401_remove(struct i2c_client *client); 102static int tmp401_remove(struct i2c_client *client);
104static struct tmp401_data *tmp401_update_device(struct device *dev); 103static struct tmp401_data *tmp401_update_device(struct device *dev);
@@ -123,7 +122,7 @@ static struct i2c_driver tmp401_driver = {
123 .remove = tmp401_remove, 122 .remove = tmp401_remove,
124 .id_table = tmp401_id, 123 .id_table = tmp401_id,
125 .detect = tmp401_detect, 124 .detect = tmp401_detect,
126 .address_data = &addr_data, 125 .address_list = normal_i2c,
127}; 126};
128 127
129/* 128/*
@@ -488,7 +487,7 @@ static void tmp401_init_client(struct i2c_client *client)
488 i2c_smbus_write_byte_data(client, TMP401_CONFIG_WRITE, config); 487 i2c_smbus_write_byte_data(client, TMP401_CONFIG_WRITE, config);
489} 488}
490 489
491static int tmp401_detect(struct i2c_client *client, int _kind, 490static int tmp401_detect(struct i2c_client *client,
492 struct i2c_board_info *info) 491 struct i2c_board_info *info)
493{ 492{
494 enum chips kind; 493 enum chips kind;
diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c
index bb5464a289c..4f7c051e2d7 100644
--- a/drivers/hwmon/tmp421.c
+++ b/drivers/hwmon/tmp421.c
@@ -39,8 +39,7 @@
39static unsigned short normal_i2c[] = { 0x2a, 0x4c, 0x4d, 0x4e, 0x4f, 39static unsigned short normal_i2c[] = { 0x2a, 0x4c, 0x4d, 0x4e, 0x4f,
40 I2C_CLIENT_END }; 40 I2C_CLIENT_END };
41 41
42/* Insmod parameters */ 42enum chips { tmp421, tmp422, tmp423 };
43I2C_CLIENT_INSMOD_3(tmp421, tmp422, tmp423);
44 43
45/* The TMP421 registers */ 44/* The TMP421 registers */
46#define TMP421_CONFIG_REG_1 0x09 45#define TMP421_CONFIG_REG_1 0x09
@@ -223,7 +222,7 @@ static int tmp421_init_client(struct i2c_client *client)
223 return 0; 222 return 0;
224} 223}
225 224
226static int tmp421_detect(struct i2c_client *client, int _kind, 225static int tmp421_detect(struct i2c_client *client,
227 struct i2c_board_info *info) 226 struct i2c_board_info *info)
228{ 227{
229 enum chips kind; 228 enum chips kind;
@@ -322,7 +321,7 @@ static struct i2c_driver tmp421_driver = {
322 .remove = tmp421_remove, 321 .remove = tmp421_remove,
323 .id_table = tmp421_id, 322 .id_table = tmp421_id,
324 .detect = tmp421_detect, 323 .detect = tmp421_detect,
325 .address_data = &addr_data, 324 .address_list = normal_i2c,
326}; 325};
327 326
328static int __init tmp421_init(void) 327static int __init tmp421_init(void)
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index 7ab7967da0a..05f9225b6f9 100644
--- a/drivers/hwmon/w83781d.c
+++ b/drivers/hwmon/w83781d.c
@@ -56,9 +56,10 @@
56/* Addresses to scan */ 56/* Addresses to scan */
57static const unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 57static const unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
58 0x2e, 0x2f, I2C_CLIENT_END }; 58 0x2e, 0x2f, I2C_CLIENT_END };
59/* Insmod parameters */
60I2C_CLIENT_INSMOD_4(w83781d, w83782d, w83783s, as99127f);
61 59
60enum chips { w83781d, w83782d, w83783s, as99127f };
61
62/* Insmod parameters */
62static unsigned short force_subclients[4]; 63static unsigned short force_subclients[4];
63module_param_array(force_subclients, short, NULL, 0); 64module_param_array(force_subclients, short, NULL, 0);
64MODULE_PARM_DESC(force_subclients, "List of subclient addresses: " 65MODULE_PARM_DESC(force_subclients, "List of subclient addresses: "
@@ -1051,8 +1052,7 @@ w83781d_create_files(struct device *dev, int kind, int is_isa)
1051 1052
1052/* Return 0 if detection is successful, -ENODEV otherwise */ 1053/* Return 0 if detection is successful, -ENODEV otherwise */
1053static int 1054static int
1054w83781d_detect(struct i2c_client *client, int kind, 1055w83781d_detect(struct i2c_client *client, struct i2c_board_info *info)
1055 struct i2c_board_info *info)
1056{ 1056{
1057 int val1, val2; 1057 int val1, val2;
1058 struct w83781d_data *isa = w83781d_data_if_isa(); 1058 struct w83781d_data *isa = w83781d_data_if_isa();
@@ -1537,7 +1537,7 @@ static struct i2c_driver w83781d_driver = {
1537 .remove = w83781d_remove, 1537 .remove = w83781d_remove,
1538 .id_table = w83781d_ids, 1538 .id_table = w83781d_ids,
1539 .detect = w83781d_detect, 1539 .detect = w83781d_detect,
1540 .address_data = &addr_data, 1540 .address_list = normal_i2c,
1541}; 1541};
1542 1542
1543/* 1543/*
diff --git a/drivers/hwmon/w83791d.c b/drivers/hwmon/w83791d.c
index 0410bf12c52..400a88bde27 100644
--- a/drivers/hwmon/w83791d.c
+++ b/drivers/hwmon/w83791d.c
@@ -52,7 +52,6 @@ static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f,
52 I2C_CLIENT_END }; 52 I2C_CLIENT_END };
53 53
54/* Insmod parameters */ 54/* Insmod parameters */
55I2C_CLIENT_INSMOD_1(w83791d);
56 55
57static unsigned short force_subclients[4]; 56static unsigned short force_subclients[4];
58module_param_array(force_subclients, short, NULL, 0); 57module_param_array(force_subclients, short, NULL, 0);
@@ -326,7 +325,7 @@ struct w83791d_data {
326 325
327static int w83791d_probe(struct i2c_client *client, 326static int w83791d_probe(struct i2c_client *client,
328 const struct i2c_device_id *id); 327 const struct i2c_device_id *id);
329static int w83791d_detect(struct i2c_client *client, int kind, 328static int w83791d_detect(struct i2c_client *client,
330 struct i2c_board_info *info); 329 struct i2c_board_info *info);
331static int w83791d_remove(struct i2c_client *client); 330static int w83791d_remove(struct i2c_client *client);
332 331
@@ -341,7 +340,7 @@ static void w83791d_print_debug(struct w83791d_data *data, struct device *dev);
341static void w83791d_init_client(struct i2c_client *client); 340static void w83791d_init_client(struct i2c_client *client);
342 341
343static const struct i2c_device_id w83791d_id[] = { 342static const struct i2c_device_id w83791d_id[] = {
344 { "w83791d", w83791d }, 343 { "w83791d", 0 },
345 { } 344 { }
346}; 345};
347MODULE_DEVICE_TABLE(i2c, w83791d_id); 346MODULE_DEVICE_TABLE(i2c, w83791d_id);
@@ -355,7 +354,7 @@ static struct i2c_driver w83791d_driver = {
355 .remove = w83791d_remove, 354 .remove = w83791d_remove,
356 .id_table = w83791d_id, 355 .id_table = w83791d_id,
357 .detect = w83791d_detect, 356 .detect = w83791d_detect,
358 .address_data = &addr_data, 357 .address_list = normal_i2c,
359}; 358};
360 359
361/* following are the sysfs callback functions */ 360/* following are the sysfs callback functions */
@@ -1259,7 +1258,7 @@ error_sc_0:
1259 1258
1260 1259
1261/* Return 0 if detection is successful, -ENODEV otherwise */ 1260/* Return 0 if detection is successful, -ENODEV otherwise */
1262static int w83791d_detect(struct i2c_client *client, int kind, 1261static int w83791d_detect(struct i2c_client *client,
1263 struct i2c_board_info *info) 1262 struct i2c_board_info *info)
1264{ 1263{
1265 struct i2c_adapter *adapter = client->adapter; 1264 struct i2c_adapter *adapter = client->adapter;
diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c
index 38978851333..679718e6b01 100644
--- a/drivers/hwmon/w83792d.c
+++ b/drivers/hwmon/w83792d.c
@@ -50,7 +50,6 @@ static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f,
50 I2C_CLIENT_END }; 50 I2C_CLIENT_END };
51 51
52/* Insmod parameters */ 52/* Insmod parameters */
53I2C_CLIENT_INSMOD_1(w83792d);
54 53
55static unsigned short force_subclients[4]; 54static unsigned short force_subclients[4];
56module_param_array(force_subclients, short, NULL, 0); 55module_param_array(force_subclients, short, NULL, 0);
@@ -302,7 +301,7 @@ struct w83792d_data {
302 301
303static int w83792d_probe(struct i2c_client *client, 302static int w83792d_probe(struct i2c_client *client,
304 const struct i2c_device_id *id); 303 const struct i2c_device_id *id);
305static int w83792d_detect(struct i2c_client *client, int kind, 304static int w83792d_detect(struct i2c_client *client,
306 struct i2c_board_info *info); 305 struct i2c_board_info *info);
307static int w83792d_remove(struct i2c_client *client); 306static int w83792d_remove(struct i2c_client *client);
308static struct w83792d_data *w83792d_update_device(struct device *dev); 307static struct w83792d_data *w83792d_update_device(struct device *dev);
@@ -314,7 +313,7 @@ static void w83792d_print_debug(struct w83792d_data *data, struct device *dev);
314static void w83792d_init_client(struct i2c_client *client); 313static void w83792d_init_client(struct i2c_client *client);
315 314
316static const struct i2c_device_id w83792d_id[] = { 315static const struct i2c_device_id w83792d_id[] = {
317 { "w83792d", w83792d }, 316 { "w83792d", 0 },
318 { } 317 { }
319}; 318};
320MODULE_DEVICE_TABLE(i2c, w83792d_id); 319MODULE_DEVICE_TABLE(i2c, w83792d_id);
@@ -328,7 +327,7 @@ static struct i2c_driver w83792d_driver = {
328 .remove = w83792d_remove, 327 .remove = w83792d_remove,
329 .id_table = w83792d_id, 328 .id_table = w83792d_id,
330 .detect = w83792d_detect, 329 .detect = w83792d_detect,
331 .address_data = &addr_data, 330 .address_list = normal_i2c,
332}; 331};
333 332
334static inline long in_count_from_reg(int nr, struct w83792d_data *data) 333static inline long in_count_from_reg(int nr, struct w83792d_data *data)
@@ -1263,7 +1262,7 @@ static const struct attribute_group w83792d_group = {
1263 1262
1264/* Return 0 if detection is successful, -ENODEV otherwise */ 1263/* Return 0 if detection is successful, -ENODEV otherwise */
1265static int 1264static int
1266w83792d_detect(struct i2c_client *client, int kind, struct i2c_board_info *info) 1265w83792d_detect(struct i2c_client *client, struct i2c_board_info *info)
1267{ 1266{
1268 struct i2c_adapter *adapter = client->adapter; 1267 struct i2c_adapter *adapter = client->adapter;
1269 int val1, val2; 1268 int val1, val2;
diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c
index 80a2191bf12..9a2022b6749 100644
--- a/drivers/hwmon/w83793.c
+++ b/drivers/hwmon/w83793.c
@@ -41,7 +41,6 @@ static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f,
41 I2C_CLIENT_END }; 41 I2C_CLIENT_END };
42 42
43/* Insmod parameters */ 43/* Insmod parameters */
44I2C_CLIENT_INSMOD_1(w83793);
45 44
46static unsigned short force_subclients[4]; 45static unsigned short force_subclients[4];
47module_param_array(force_subclients, short, NULL, 0); 46module_param_array(force_subclients, short, NULL, 0);
@@ -230,7 +229,7 @@ static u8 w83793_read_value(struct i2c_client *client, u16 reg);
230static int w83793_write_value(struct i2c_client *client, u16 reg, u8 value); 229static int w83793_write_value(struct i2c_client *client, u16 reg, u8 value);
231static int w83793_probe(struct i2c_client *client, 230static int w83793_probe(struct i2c_client *client,
232 const struct i2c_device_id *id); 231 const struct i2c_device_id *id);
233static int w83793_detect(struct i2c_client *client, int kind, 232static int w83793_detect(struct i2c_client *client,
234 struct i2c_board_info *info); 233 struct i2c_board_info *info);
235static int w83793_remove(struct i2c_client *client); 234static int w83793_remove(struct i2c_client *client);
236static void w83793_init_client(struct i2c_client *client); 235static void w83793_init_client(struct i2c_client *client);
@@ -238,7 +237,7 @@ static void w83793_update_nonvolatile(struct device *dev);
238static struct w83793_data *w83793_update_device(struct device *dev); 237static struct w83793_data *w83793_update_device(struct device *dev);
239 238
240static const struct i2c_device_id w83793_id[] = { 239static const struct i2c_device_id w83793_id[] = {
241 { "w83793", w83793 }, 240 { "w83793", 0 },
242 { } 241 { }
243}; 242};
244MODULE_DEVICE_TABLE(i2c, w83793_id); 243MODULE_DEVICE_TABLE(i2c, w83793_id);
@@ -252,7 +251,7 @@ static struct i2c_driver w83793_driver = {
252 .remove = w83793_remove, 251 .remove = w83793_remove,
253 .id_table = w83793_id, 252 .id_table = w83793_id,
254 .detect = w83793_detect, 253 .detect = w83793_detect,
255 .address_data = &addr_data, 254 .address_list = normal_i2c,
256}; 255};
257 256
258static ssize_t 257static ssize_t
@@ -1161,7 +1160,7 @@ ERROR_SC_0:
1161} 1160}
1162 1161
1163/* Return 0 if detection is successful, -ENODEV otherwise */ 1162/* Return 0 if detection is successful, -ENODEV otherwise */
1164static int w83793_detect(struct i2c_client *client, int kind, 1163static int w83793_detect(struct i2c_client *client,
1165 struct i2c_board_info *info) 1164 struct i2c_board_info *info)
1166{ 1165{
1167 u8 tmp, bank, chip_id; 1166 u8 tmp, bank, chip_id;
diff --git a/drivers/hwmon/w83l785ts.c b/drivers/hwmon/w83l785ts.c
index 9b6c4c10fba..20781def65e 100644
--- a/drivers/hwmon/w83l785ts.c
+++ b/drivers/hwmon/w83l785ts.c
@@ -52,12 +52,6 @@
52static const unsigned short normal_i2c[] = { 0x2e, I2C_CLIENT_END }; 52static const unsigned short normal_i2c[] = { 0x2e, I2C_CLIENT_END };
53 53
54/* 54/*
55 * Insmod parameters
56 */
57
58I2C_CLIENT_INSMOD_1(w83l785ts);
59
60/*
61 * The W83L785TS-S registers 55 * The W83L785TS-S registers
62 * Manufacturer ID is 0x5CA3 for Winbond. 56 * Manufacturer ID is 0x5CA3 for Winbond.
63 */ 57 */
@@ -83,7 +77,7 @@ I2C_CLIENT_INSMOD_1(w83l785ts);
83 77
84static int w83l785ts_probe(struct i2c_client *client, 78static int w83l785ts_probe(struct i2c_client *client,
85 const struct i2c_device_id *id); 79 const struct i2c_device_id *id);
86static int w83l785ts_detect(struct i2c_client *client, int kind, 80static int w83l785ts_detect(struct i2c_client *client,
87 struct i2c_board_info *info); 81 struct i2c_board_info *info);
88static int w83l785ts_remove(struct i2c_client *client); 82static int w83l785ts_remove(struct i2c_client *client);
89static u8 w83l785ts_read_value(struct i2c_client *client, u8 reg, u8 defval); 83static u8 w83l785ts_read_value(struct i2c_client *client, u8 reg, u8 defval);
@@ -94,7 +88,7 @@ static struct w83l785ts_data *w83l785ts_update_device(struct device *dev);
94 */ 88 */
95 89
96static const struct i2c_device_id w83l785ts_id[] = { 90static const struct i2c_device_id w83l785ts_id[] = {
97 { "w83l785ts", w83l785ts }, 91 { "w83l785ts", 0 },
98 { } 92 { }
99}; 93};
100MODULE_DEVICE_TABLE(i2c, w83l785ts_id); 94MODULE_DEVICE_TABLE(i2c, w83l785ts_id);
@@ -108,7 +102,7 @@ static struct i2c_driver w83l785ts_driver = {
108 .remove = w83l785ts_remove, 102 .remove = w83l785ts_remove,
109 .id_table = w83l785ts_id, 103 .id_table = w83l785ts_id,
110 .detect = w83l785ts_detect, 104 .detect = w83l785ts_detect,
111 .address_data = &addr_data, 105 .address_list = normal_i2c,
112}; 106};
113 107
114/* 108/*
@@ -146,7 +140,7 @@ static SENSOR_DEVICE_ATTR(temp1_max, S_IRUGO, show_temp, NULL, 1);
146 */ 140 */
147 141
148/* Return 0 if detection is successful, -ENODEV otherwise */ 142/* Return 0 if detection is successful, -ENODEV otherwise */
149static int w83l785ts_detect(struct i2c_client *client, int kind, 143static int w83l785ts_detect(struct i2c_client *client,
150 struct i2c_board_info *info) 144 struct i2c_board_info *info)
151{ 145{
152 struct i2c_adapter *adapter = client->adapter; 146 struct i2c_adapter *adapter = client->adapter;
diff --git a/drivers/hwmon/w83l786ng.c b/drivers/hwmon/w83l786ng.c
index 27da7d2b15f..0254e181893 100644
--- a/drivers/hwmon/w83l786ng.c
+++ b/drivers/hwmon/w83l786ng.c
@@ -38,7 +38,6 @@
38static const unsigned short normal_i2c[] = { 0x2e, 0x2f, I2C_CLIENT_END }; 38static const unsigned short normal_i2c[] = { 0x2e, 0x2f, I2C_CLIENT_END };
39 39
40/* Insmod parameters */ 40/* Insmod parameters */
41I2C_CLIENT_INSMOD_1(w83l786ng);
42 41
43static int reset; 42static int reset;
44module_param(reset, bool, 0); 43module_param(reset, bool, 0);
@@ -147,14 +146,14 @@ struct w83l786ng_data {
147 146
148static int w83l786ng_probe(struct i2c_client *client, 147static int w83l786ng_probe(struct i2c_client *client,
149 const struct i2c_device_id *id); 148 const struct i2c_device_id *id);
150static int w83l786ng_detect(struct i2c_client *client, int kind, 149static int w83l786ng_detect(struct i2c_client *client,
151 struct i2c_board_info *info); 150 struct i2c_board_info *info);
152static int w83l786ng_remove(struct i2c_client *client); 151static int w83l786ng_remove(struct i2c_client *client);
153static void w83l786ng_init_client(struct i2c_client *client); 152static void w83l786ng_init_client(struct i2c_client *client);
154static struct w83l786ng_data *w83l786ng_update_device(struct device *dev); 153static struct w83l786ng_data *w83l786ng_update_device(struct device *dev);
155 154
156static const struct i2c_device_id w83l786ng_id[] = { 155static const struct i2c_device_id w83l786ng_id[] = {
157 { "w83l786ng", w83l786ng }, 156 { "w83l786ng", 0 },
158 { } 157 { }
159}; 158};
160MODULE_DEVICE_TABLE(i2c, w83l786ng_id); 159MODULE_DEVICE_TABLE(i2c, w83l786ng_id);
@@ -168,7 +167,7 @@ static struct i2c_driver w83l786ng_driver = {
168 .remove = w83l786ng_remove, 167 .remove = w83l786ng_remove,
169 .id_table = w83l786ng_id, 168 .id_table = w83l786ng_id,
170 .detect = w83l786ng_detect, 169 .detect = w83l786ng_detect,
171 .address_data = &addr_data, 170 .address_list = normal_i2c,
172}; 171};
173 172
174static u8 173static u8
@@ -586,8 +585,7 @@ static const struct attribute_group w83l786ng_group = {
586}; 585};
587 586
588static int 587static int
589w83l786ng_detect(struct i2c_client *client, int kind, 588w83l786ng_detect(struct i2c_client *client, struct i2c_board_info *info)
590 struct i2c_board_info *info)
591{ 589{
592 struct i2c_adapter *adapter = client->adapter; 590 struct i2c_adapter *adapter = client->adapter;
593 u16 man_id; 591 u16 man_id;
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 4f34823e86b..0ac2f90ab84 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -155,6 +155,35 @@ static void i2c_device_shutdown(struct device *dev)
155 driver->shutdown(client); 155 driver->shutdown(client);
156} 156}
157 157
158#ifdef CONFIG_SUSPEND
159static int i2c_device_pm_suspend(struct device *dev)
160{
161 const struct dev_pm_ops *pm;
162
163 if (!dev->driver)
164 return 0;
165 pm = dev->driver->pm;
166 if (!pm || !pm->suspend)
167 return 0;
168 return pm->suspend(dev);
169}
170
171static int i2c_device_pm_resume(struct device *dev)
172{
173 const struct dev_pm_ops *pm;
174
175 if (!dev->driver)
176 return 0;
177 pm = dev->driver->pm;
178 if (!pm || !pm->resume)
179 return 0;
180 return pm->resume(dev);
181}
182#else
183#define i2c_device_pm_suspend NULL
184#define i2c_device_pm_resume NULL
185#endif
186
158static int i2c_device_suspend(struct device *dev, pm_message_t mesg) 187static int i2c_device_suspend(struct device *dev, pm_message_t mesg)
159{ 188{
160 struct i2c_client *client = i2c_verify_client(dev); 189 struct i2c_client *client = i2c_verify_client(dev);
@@ -219,6 +248,11 @@ static const struct attribute_group *i2c_dev_attr_groups[] = {
219 NULL 248 NULL
220}; 249};
221 250
251const static struct dev_pm_ops i2c_device_pm_ops = {
252 .suspend = i2c_device_pm_suspend,
253 .resume = i2c_device_pm_resume,
254};
255
222struct bus_type i2c_bus_type = { 256struct bus_type i2c_bus_type = {
223 .name = "i2c", 257 .name = "i2c",
224 .match = i2c_device_match, 258 .match = i2c_device_match,
@@ -227,6 +261,7 @@ struct bus_type i2c_bus_type = {
227 .shutdown = i2c_device_shutdown, 261 .shutdown = i2c_device_shutdown,
228 .suspend = i2c_device_suspend, 262 .suspend = i2c_device_suspend,
229 .resume = i2c_device_resume, 263 .resume = i2c_device_resume,
264 .pm = &i2c_device_pm_ops,
230}; 265};
231EXPORT_SYMBOL_GPL(i2c_bus_type); 266EXPORT_SYMBOL_GPL(i2c_bus_type);
232 267
@@ -1184,7 +1219,7 @@ static int i2c_detect_address(struct i2c_client *temp_client,
1184 /* Finally call the custom detection function */ 1219 /* Finally call the custom detection function */
1185 memset(&info, 0, sizeof(struct i2c_board_info)); 1220 memset(&info, 0, sizeof(struct i2c_board_info));
1186 info.addr = addr; 1221 info.addr = addr;
1187 err = driver->detect(temp_client, -1, &info); 1222 err = driver->detect(temp_client, &info);
1188 if (err) { 1223 if (err) {
1189 /* -ENODEV is returned if the detection fails. We catch it 1224 /* -ENODEV is returned if the detection fails. We catch it
1190 here as this isn't an error. */ 1225 here as this isn't an error. */
@@ -1214,13 +1249,13 @@ static int i2c_detect_address(struct i2c_client *temp_client,
1214 1249
1215static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver) 1250static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver)
1216{ 1251{
1217 const struct i2c_client_address_data *address_data; 1252 const unsigned short *address_list;
1218 struct i2c_client *temp_client; 1253 struct i2c_client *temp_client;
1219 int i, err = 0; 1254 int i, err = 0;
1220 int adap_id = i2c_adapter_id(adapter); 1255 int adap_id = i2c_adapter_id(adapter);
1221 1256
1222 address_data = driver->address_data; 1257 address_list = driver->address_list;
1223 if (!driver->detect || !address_data) 1258 if (!driver->detect || !address_list)
1224 return 0; 1259 return 0;
1225 1260
1226 /* Set up a temporary client to help detect callback */ 1261 /* Set up a temporary client to help detect callback */
@@ -1235,7 +1270,7 @@ static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver)
1235 1270
1236 /* Stop here if we can't use SMBUS_QUICK */ 1271 /* Stop here if we can't use SMBUS_QUICK */
1237 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_QUICK)) { 1272 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_QUICK)) {
1238 if (address_data->normal_i2c[0] == I2C_CLIENT_END) 1273 if (address_list[0] == I2C_CLIENT_END)
1239 goto exit_free; 1274 goto exit_free;
1240 1275
1241 dev_warn(&adapter->dev, "SMBus Quick command not supported, " 1276 dev_warn(&adapter->dev, "SMBus Quick command not supported, "
@@ -1244,11 +1279,10 @@ static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver)
1244 goto exit_free; 1279 goto exit_free;
1245 } 1280 }
1246 1281
1247 for (i = 0; address_data->normal_i2c[i] != I2C_CLIENT_END; i += 1) { 1282 for (i = 0; address_list[i] != I2C_CLIENT_END; i += 1) {
1248 dev_dbg(&adapter->dev, "found normal entry for adapter %d, " 1283 dev_dbg(&adapter->dev, "found normal entry for adapter %d, "
1249 "addr 0x%02x\n", adap_id, 1284 "addr 0x%02x\n", adap_id, address_list[i]);
1250 address_data->normal_i2c[i]); 1285 temp_client->addr = address_list[i];
1251 temp_client->addr = address_data->normal_i2c[i];
1252 err = i2c_detect_address(temp_client, driver); 1286 err = i2c_detect_address(temp_client, driver);
1253 if (err) 1287 if (err)
1254 goto exit_free; 1288 goto exit_free;
diff --git a/drivers/misc/eeprom/eeprom.c b/drivers/misc/eeprom/eeprom.c
index 2c27193aeaa..f939ebc2507 100644
--- a/drivers/misc/eeprom/eeprom.c
+++ b/drivers/misc/eeprom/eeprom.c
@@ -32,9 +32,6 @@
32static const unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54, 32static const unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54,
33 0x55, 0x56, 0x57, I2C_CLIENT_END }; 33 0x55, 0x56, 0x57, I2C_CLIENT_END };
34 34
35/* Insmod parameters */
36I2C_CLIENT_INSMOD_1(eeprom);
37
38 35
39/* Size of EEPROM in bytes */ 36/* Size of EEPROM in bytes */
40#define EEPROM_SIZE 256 37#define EEPROM_SIZE 256
@@ -135,8 +132,7 @@ static struct bin_attribute eeprom_attr = {
135}; 132};
136 133
137/* Return 0 if detection is successful, -ENODEV otherwise */ 134/* Return 0 if detection is successful, -ENODEV otherwise */
138static int eeprom_detect(struct i2c_client *client, int kind, 135static int eeprom_detect(struct i2c_client *client, struct i2c_board_info *info)
139 struct i2c_board_info *info)
140{ 136{
141 struct i2c_adapter *adapter = client->adapter; 137 struct i2c_adapter *adapter = client->adapter;
142 138
@@ -233,7 +229,7 @@ static struct i2c_driver eeprom_driver = {
233 229
234 .class = I2C_CLASS_DDC | I2C_CLASS_SPD, 230 .class = I2C_CLASS_DDC | I2C_CLASS_SPD,
235 .detect = eeprom_detect, 231 .detect = eeprom_detect,
236 .address_data = &addr_data, 232 .address_list = normal_i2c,
237}; 233};
238 234
239static int __init eeprom_init(void) 235static int __init eeprom_init(void)
diff --git a/drivers/misc/ics932s401.c b/drivers/misc/ics932s401.c
index 4bb7a3af9ad..395a4ea64e9 100644
--- a/drivers/misc/ics932s401.c
+++ b/drivers/misc/ics932s401.c
@@ -30,9 +30,6 @@
30/* Addresses to scan */ 30/* Addresses to scan */
31static const unsigned short normal_i2c[] = { 0x69, I2C_CLIENT_END }; 31static const unsigned short normal_i2c[] = { 0x69, I2C_CLIENT_END };
32 32
33/* Insmod parameters */
34I2C_CLIENT_INSMOD_1(ics932s401);
35
36/* ICS932S401 registers */ 33/* ICS932S401 registers */
37#define ICS932S401_REG_CFG2 0x01 34#define ICS932S401_REG_CFG2 0x01
38#define ICS932S401_CFG1_SPREAD 0x01 35#define ICS932S401_CFG1_SPREAD 0x01
@@ -106,12 +103,12 @@ struct ics932s401_data {
106 103
107static int ics932s401_probe(struct i2c_client *client, 104static int ics932s401_probe(struct i2c_client *client,
108 const struct i2c_device_id *id); 105 const struct i2c_device_id *id);
109static int ics932s401_detect(struct i2c_client *client, int kind, 106static int ics932s401_detect(struct i2c_client *client,
110 struct i2c_board_info *info); 107 struct i2c_board_info *info);
111static int ics932s401_remove(struct i2c_client *client); 108static int ics932s401_remove(struct i2c_client *client);
112 109
113static const struct i2c_device_id ics932s401_id[] = { 110static const struct i2c_device_id ics932s401_id[] = {
114 { "ics932s401", ics932s401 }, 111 { "ics932s401", 0 },
115 { } 112 { }
116}; 113};
117MODULE_DEVICE_TABLE(i2c, ics932s401_id); 114MODULE_DEVICE_TABLE(i2c, ics932s401_id);
@@ -125,7 +122,7 @@ static struct i2c_driver ics932s401_driver = {
125 .remove = ics932s401_remove, 122 .remove = ics932s401_remove,
126 .id_table = ics932s401_id, 123 .id_table = ics932s401_id,
127 .detect = ics932s401_detect, 124 .detect = ics932s401_detect,
128 .address_data = &addr_data, 125 .address_list = normal_i2c,
129}; 126};
130 127
131static struct ics932s401_data *ics932s401_update_device(struct device *dev) 128static struct ics932s401_data *ics932s401_update_device(struct device *dev)
@@ -413,7 +410,7 @@ static ssize_t show_spread(struct device *dev,
413} 410}
414 411
415/* Return 0 if detection is successful, -ENODEV otherwise */ 412/* Return 0 if detection is successful, -ENODEV otherwise */
416static int ics932s401_detect(struct i2c_client *client, int kind, 413static int ics932s401_detect(struct i2c_client *client,
417 struct i2c_board_info *info) 414 struct i2c_board_info *info)
418{ 415{
419 struct i2c_adapter *adapter = client->adapter; 416 struct i2c_adapter *adapter = client->adapter;
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 419ab546b26..02fc617782e 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -110,7 +110,7 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client,
110 * @driver: Device driver model driver 110 * @driver: Device driver model driver
111 * @id_table: List of I2C devices supported by this driver 111 * @id_table: List of I2C devices supported by this driver
112 * @detect: Callback for device detection 112 * @detect: Callback for device detection
113 * @address_data: The I2C addresses to probe (for detect) 113 * @address_list: The I2C addresses to probe (for detect)
114 * @clients: List of detected clients we created (for i2c-core use only) 114 * @clients: List of detected clients we created (for i2c-core use only)
115 * 115 *
116 * The driver.owner field should be set to the module owner of this driver. 116 * The driver.owner field should be set to the module owner of this driver.
@@ -161,8 +161,8 @@ struct i2c_driver {
161 const struct i2c_device_id *id_table; 161 const struct i2c_device_id *id_table;
162 162
163 /* Device detection callback for automatic device creation */ 163 /* Device detection callback for automatic device creation */
164 int (*detect)(struct i2c_client *, int kind, struct i2c_board_info *); 164 int (*detect)(struct i2c_client *, struct i2c_board_info *);
165 const struct i2c_client_address_data *address_data; 165 const unsigned short *address_list;
166 struct list_head clients; 166 struct list_head clients;
167}; 167};
168#define to_i2c_driver(d) container_of(d, struct i2c_driver, driver) 168#define to_i2c_driver(d) container_of(d, struct i2c_driver, driver)
@@ -391,14 +391,6 @@ static inline void i2c_unlock_adapter(struct i2c_adapter *adapter)
391#define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ 391#define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */
392#define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */ 392#define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */
393 393
394/* i2c_client_address_data is the struct for holding default client
395 * addresses for a driver and for the parameters supplied on the
396 * command line
397 */
398struct i2c_client_address_data {
399 const unsigned short *normal_i2c;
400};
401
402/* Internal numbers to terminate lists */ 394/* Internal numbers to terminate lists */
403#define I2C_CLIENT_END 0xfffeU 395#define I2C_CLIENT_END 0xfffeU
404 396
@@ -576,82 +568,4 @@ union i2c_smbus_data {
576#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ 568#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */
577#define I2C_SMBUS_I2C_BLOCK_DATA 8 569#define I2C_SMBUS_I2C_BLOCK_DATA 8
578 570
579
580#ifdef __KERNEL__
581
582/* These defines are used for probing i2c client addresses */
583/* The length of the option lists */
584#define I2C_CLIENT_MAX_OPTS 48
585
586/* Default fill of many variables */
587#define I2C_CLIENT_DEFAULTS {I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
588 I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
589 I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
590 I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
591 I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
592 I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
593 I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
594 I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
595 I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
596 I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
597 I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
598 I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
599 I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
600 I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
601 I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
602 I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END}
603
604/* I2C_CLIENT_MODULE_PARM creates a module parameter, and puts it in the
605 module header */
606
607#define I2C_CLIENT_MODULE_PARM(var,desc) \
608 static unsigned short var[I2C_CLIENT_MAX_OPTS] = I2C_CLIENT_DEFAULTS; \
609 static unsigned int var##_num; \
610 module_param_array(var, short, &var##_num, 0); \
611 MODULE_PARM_DESC(var, desc)
612
613#define I2C_CLIENT_INSMOD_COMMON \
614static const struct i2c_client_address_data addr_data = { \
615 .normal_i2c = normal_i2c, \
616}
617
618/* These are the ones you want to use in your own drivers. Pick the one
619 which matches the number of devices the driver differenciates between. */
620#define I2C_CLIENT_INSMOD \
621I2C_CLIENT_INSMOD_COMMON
622
623#define I2C_CLIENT_INSMOD_1(chip1) \
624enum chips { any_chip, chip1 }; \
625I2C_CLIENT_INSMOD_COMMON
626
627#define I2C_CLIENT_INSMOD_2(chip1, chip2) \
628enum chips { any_chip, chip1, chip2 }; \
629I2C_CLIENT_INSMOD_COMMON
630
631#define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \
632enum chips { any_chip, chip1, chip2, chip3 }; \
633I2C_CLIENT_INSMOD_COMMON
634
635#define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \
636enum chips { any_chip, chip1, chip2, chip3, chip4 }; \
637I2C_CLIENT_INSMOD_COMMON
638
639#define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \
640enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \
641I2C_CLIENT_INSMOD_COMMON
642
643#define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \
644enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \
645I2C_CLIENT_INSMOD_COMMON
646
647#define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \
648enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \
649 chip7 }; \
650I2C_CLIENT_INSMOD_COMMON
651
652#define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \
653enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \
654 chip7, chip8 }; \
655I2C_CLIENT_INSMOD_COMMON
656#endif /* __KERNEL__ */
657#endif /* _LINUX_I2C_H */ 571#endif /* _LINUX_I2C_H */