diff options
50 files changed, 232 insertions, 411 deletions
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients index 7860aafb483d..0a74603eb671 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 33acf29531af..1ad0a885c5a5 100644 --- a/drivers/hwmon/adm1021.c +++ b/drivers/hwmon/adm1021.c | |||
@@ -34,9 +34,8 @@ | |||
34 | static const unsigned short normal_i2c[] = { | 34 | static 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 */ | 37 | enum chips { |
38 | I2C_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 | ||
98 | static int adm1021_probe(struct i2c_client *client, | 97 | static int adm1021_probe(struct i2c_client *client, |
99 | const struct i2c_device_id *id); | 98 | const struct i2c_device_id *id); |
100 | static int adm1021_detect(struct i2c_client *client, int kind, | 99 | static int adm1021_detect(struct i2c_client *client, |
101 | struct i2c_board_info *info); | 100 | struct i2c_board_info *info); |
102 | static void adm1021_init_client(struct i2c_client *client); | 101 | static void adm1021_init_client(struct i2c_client *client); |
103 | static int adm1021_remove(struct i2c_client *client); | 102 | static 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 | ||
136 | static ssize_t show_temp(struct device *dev, | 135 | static 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 */ |
287 | static int adm1021_detect(struct i2c_client *client, int kind, | 286 | static 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 db6ac2b04f6f..251b63165e2a 100644 --- a/drivers/hwmon/adm1025.c +++ b/drivers/hwmon/adm1025.c | |||
@@ -64,11 +64,7 @@ | |||
64 | 64 | ||
65 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; | 65 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; |
66 | 66 | ||
67 | /* | 67 | enum chips { adm1025, ne1619 }; |
68 | * Insmod parameters | ||
69 | */ | ||
70 | |||
71 | I2C_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 | ||
112 | static int adm1025_probe(struct i2c_client *client, | 108 | static int adm1025_probe(struct i2c_client *client, |
113 | const struct i2c_device_id *id); | 109 | const struct i2c_device_id *id); |
114 | static int adm1025_detect(struct i2c_client *client, int kind, | 110 | static int adm1025_detect(struct i2c_client *client, |
115 | struct i2c_board_info *info); | 111 | struct i2c_board_info *info); |
116 | static void adm1025_init_client(struct i2c_client *client); | 112 | static void adm1025_init_client(struct i2c_client *client); |
117 | static int adm1025_remove(struct i2c_client *client); | 113 | static 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 */ |
412 | static int adm1025_detect(struct i2c_client *client, int kind, | 408 | static 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 fb5363985e21..65335b268fa9 100644 --- a/drivers/hwmon/adm1026.c +++ b/drivers/hwmon/adm1026.c | |||
@@ -37,9 +37,6 @@ | |||
37 | /* Addresses to scan */ | 37 | /* Addresses to scan */ |
38 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; | 38 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; |
39 | 39 | ||
40 | /* Insmod parameters */ | ||
41 | I2C_CLIENT_INSMOD_1(adm1026); | ||
42 | |||
43 | static int gpio_input[17] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, | 40 | static int gpio_input[17] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, |
44 | -1, -1, -1, -1, -1, -1, -1, -1 }; | 41 | -1, -1, -1, -1, -1, -1, -1, -1 }; |
45 | static int gpio_output[17] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, | 42 | static int gpio_output[17] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, |
@@ -293,7 +290,7 @@ struct adm1026_data { | |||
293 | 290 | ||
294 | static int adm1026_probe(struct i2c_client *client, | 291 | static int adm1026_probe(struct i2c_client *client, |
295 | const struct i2c_device_id *id); | 292 | const struct i2c_device_id *id); |
296 | static int adm1026_detect(struct i2c_client *client, int kind, | 293 | static int adm1026_detect(struct i2c_client *client, |
297 | struct i2c_board_info *info); | 294 | struct i2c_board_info *info); |
298 | static int adm1026_remove(struct i2c_client *client); | 295 | static int adm1026_remove(struct i2c_client *client); |
299 | static int adm1026_read_value(struct i2c_client *client, u8 reg); | 296 | static int adm1026_read_value(struct i2c_client *client, u8 reg); |
@@ -305,7 +302,7 @@ static void adm1026_init_client(struct i2c_client *client); | |||
305 | 302 | ||
306 | 303 | ||
307 | static const struct i2c_device_id adm1026_id[] = { | 304 | static const struct i2c_device_id adm1026_id[] = { |
308 | { "adm1026", adm1026 }, | 305 | { "adm1026", 0 }, |
309 | { } | 306 | { } |
310 | }; | 307 | }; |
311 | MODULE_DEVICE_TABLE(i2c, adm1026_id); | 308 | MODULE_DEVICE_TABLE(i2c, adm1026_id); |
@@ -319,7 +316,7 @@ static struct i2c_driver adm1026_driver = { | |||
319 | .remove = adm1026_remove, | 316 | .remove = adm1026_remove, |
320 | .id_table = adm1026_id, | 317 | .id_table = adm1026_id, |
321 | .detect = adm1026_detect, | 318 | .detect = adm1026_detect, |
322 | .address_data = &addr_data, | 319 | .address_list = normal_i2c, |
323 | }; | 320 | }; |
324 | 321 | ||
325 | static int adm1026_read_value(struct i2c_client *client, u8 reg) | 322 | static int adm1026_read_value(struct i2c_client *client, u8 reg) |
@@ -1650,7 +1647,7 @@ static const struct attribute_group adm1026_group_in8_9 = { | |||
1650 | }; | 1647 | }; |
1651 | 1648 | ||
1652 | /* Return 0 if detection is successful, -ENODEV otherwise */ | 1649 | /* Return 0 if detection is successful, -ENODEV otherwise */ |
1653 | static int adm1026_detect(struct i2c_client *client, int kind, | 1650 | static int adm1026_detect(struct i2c_client *client, |
1654 | struct i2c_board_info *info) | 1651 | struct i2c_board_info *info) |
1655 | { | 1652 | { |
1656 | struct i2c_adapter *adapter = client->adapter; | 1653 | struct i2c_adapter *adapter = client->adapter; |
diff --git a/drivers/hwmon/adm1029.c b/drivers/hwmon/adm1029.c index ef91e2a4a567..0b8a3b145bd2 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 | |||
50 | I2C_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 | ||
118 | static int adm1029_probe(struct i2c_client *client, | 112 | static int adm1029_probe(struct i2c_client *client, |
119 | const struct i2c_device_id *id); | 113 | const struct i2c_device_id *id); |
120 | static int adm1029_detect(struct i2c_client *client, int kind, | 114 | static int adm1029_detect(struct i2c_client *client, |
121 | struct i2c_board_info *info); | 115 | struct i2c_board_info *info); |
122 | static int adm1029_remove(struct i2c_client *client); | 116 | static int adm1029_remove(struct i2c_client *client); |
123 | static struct adm1029_data *adm1029_update_device(struct device *dev); | 117 | static 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 | ||
130 | static const struct i2c_device_id adm1029_id[] = { | 124 | static const struct i2c_device_id adm1029_id[] = { |
131 | { "adm1029", adm1029 }, | 125 | { "adm1029", 0 }, |
132 | { } | 126 | { } |
133 | }; | 127 | }; |
134 | MODULE_DEVICE_TABLE(i2c, adm1029_id); | 128 | MODULE_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 */ |
300 | static int adm1029_detect(struct i2c_client *client, int kind, | 294 | static 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 0e722175aae0..1644b92e7cc4 100644 --- a/drivers/hwmon/adm1031.c +++ b/drivers/hwmon/adm1031.c | |||
@@ -64,8 +64,7 @@ | |||
64 | /* Addresses to scan */ | 64 | /* Addresses to scan */ |
65 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; | 65 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; |
66 | 66 | ||
67 | /* Insmod parameters */ | 67 | enum chips { adm1030, adm1031 }; |
68 | I2C_CLIENT_INSMOD_2(adm1030, adm1031); | ||
69 | 68 | ||
70 | typedef u8 auto_chan_table_t[8][2]; | 69 | typedef u8 auto_chan_table_t[8][2]; |
71 | 70 | ||
@@ -102,7 +101,7 @@ struct adm1031_data { | |||
102 | 101 | ||
103 | static int adm1031_probe(struct i2c_client *client, | 102 | static int adm1031_probe(struct i2c_client *client, |
104 | const struct i2c_device_id *id); | 103 | const struct i2c_device_id *id); |
105 | static int adm1031_detect(struct i2c_client *client, int kind, | 104 | static int adm1031_detect(struct i2c_client *client, |
106 | struct i2c_board_info *info); | 105 | struct i2c_board_info *info); |
107 | static void adm1031_init_client(struct i2c_client *client); | 106 | static void adm1031_init_client(struct i2c_client *client); |
108 | static int adm1031_remove(struct i2c_client *client); | 107 | static 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 | ||
131 | static inline u8 adm1031_read_value(struct i2c_client *client, u8 reg) | 130 | static 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 */ |
816 | static int adm1031_detect(struct i2c_client *client, int kind, | 815 | static 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 20e0481cc206..0727ad250793 100644 --- a/drivers/hwmon/adm9240.c +++ b/drivers/hwmon/adm9240.c | |||
@@ -55,8 +55,7 @@ | |||
55 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f, | 55 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f, |
56 | I2C_CLIENT_END }; | 56 | I2C_CLIENT_END }; |
57 | 57 | ||
58 | /* Insmod parameters */ | 58 | enum chips { adm9240, ds1780, lm81 }; |
59 | I2C_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 | ||
133 | static int adm9240_probe(struct i2c_client *client, | 132 | static int adm9240_probe(struct i2c_client *client, |
134 | const struct i2c_device_id *id); | 133 | const struct i2c_device_id *id); |
135 | static int adm9240_detect(struct i2c_client *client, int kind, | 134 | static int adm9240_detect(struct i2c_client *client, |
136 | struct i2c_board_info *info); | 135 | struct i2c_board_info *info); |
137 | static void adm9240_init_client(struct i2c_client *client); | 136 | static void adm9240_init_client(struct i2c_client *client); |
138 | static int adm9240_remove(struct i2c_client *client); | 137 | static 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 */ |
548 | static int adm9240_detect(struct i2c_client *new_client, int kind, | 547 | static 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 451977bca7d6..aac85f3aed50 100644 --- a/drivers/hwmon/ads7828.c +++ b/drivers/hwmon/ads7828.c | |||
@@ -47,10 +47,7 @@ | |||
47 | static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, | 47 | static 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 */ |
51 | I2C_CLIENT_INSMOD_1(ads7828); | ||
52 | |||
53 | /* Other module parameters */ | ||
54 | static int se_input = 1; /* Default is SE, 0 == diff */ | 51 | static int se_input = 1; /* Default is SE, 0 == diff */ |
55 | static int int_vref = 1; /* Default is internal ref ON */ | 52 | static int int_vref = 1; /* Default is internal ref ON */ |
56 | static int vref_mv = ADS7828_INT_VREF_MV; /* set if vref != 2.5V */ | 53 | static 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 */ |
75 | static int ads7828_detect(struct i2c_client *client, int kind, | 72 | static int ads7828_detect(struct i2c_client *client, |
76 | struct i2c_board_info *info); | 73 | struct i2c_board_info *info); |
77 | static int ads7828_probe(struct i2c_client *client, | 74 | static 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 | ||
170 | static const struct i2c_device_id ads7828_id[] = { | 167 | static const struct i2c_device_id ads7828_id[] = { |
171 | { "ads7828", ads7828 }, | 168 | { "ads7828", 0 }, |
172 | { } | 169 | { } |
173 | }; | 170 | }; |
174 | MODULE_DEVICE_TABLE(i2c, ads7828_id); | 171 | MODULE_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 */ |
190 | static int ads7828_detect(struct i2c_client *client, int kind, | 187 | static 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 f9c9562b6a94..a1a7ef14b519 100644 --- a/drivers/hwmon/adt7462.c +++ b/drivers/hwmon/adt7462.c | |||
@@ -32,9 +32,6 @@ | |||
32 | /* Addresses to scan */ | 32 | /* Addresses to scan */ |
33 | static const unsigned short normal_i2c[] = { 0x58, 0x5C, I2C_CLIENT_END }; | 33 | static const unsigned short normal_i2c[] = { 0x58, 0x5C, I2C_CLIENT_END }; |
34 | 34 | ||
35 | /* Insmod parameters */ | ||
36 | I2C_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 | ||
238 | static int adt7462_probe(struct i2c_client *client, | 235 | static int adt7462_probe(struct i2c_client *client, |
239 | const struct i2c_device_id *id); | 236 | const struct i2c_device_id *id); |
240 | static int adt7462_detect(struct i2c_client *client, int kind, | 237 | static int adt7462_detect(struct i2c_client *client, |
241 | struct i2c_board_info *info); | 238 | struct i2c_board_info *info); |
242 | static int adt7462_remove(struct i2c_client *client); | 239 | static int adt7462_remove(struct i2c_client *client); |
243 | 240 | ||
244 | static const struct i2c_device_id adt7462_id[] = { | 241 | static const struct i2c_device_id adt7462_id[] = { |
245 | { "adt7462", adt7462 }, | 242 | { "adt7462", 0 }, |
246 | { } | 243 | { } |
247 | }; | 244 | }; |
248 | MODULE_DEVICE_TABLE(i2c, adt7462_id); | 245 | MODULE_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 */ |
1905 | static int adt7462_detect(struct i2c_client *client, int kind, | 1902 | static 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 32b1750a6890..3445ce1cba81 100644 --- a/drivers/hwmon/adt7470.c +++ b/drivers/hwmon/adt7470.c | |||
@@ -33,9 +33,6 @@ | |||
33 | /* Addresses to scan */ | 33 | /* Addresses to scan */ |
34 | static const unsigned short normal_i2c[] = { 0x2C, 0x2E, 0x2F, I2C_CLIENT_END }; | 34 | static const unsigned short normal_i2c[] = { 0x2C, 0x2E, 0x2F, I2C_CLIENT_END }; |
35 | 35 | ||
36 | /* Insmod parameters */ | ||
37 | I2C_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 | ||
178 | static int adt7470_probe(struct i2c_client *client, | 175 | static int adt7470_probe(struct i2c_client *client, |
179 | const struct i2c_device_id *id); | 176 | const struct i2c_device_id *id); |
180 | static int adt7470_detect(struct i2c_client *client, int kind, | 177 | static int adt7470_detect(struct i2c_client *client, |
181 | struct i2c_board_info *info); | 178 | struct i2c_board_info *info); |
182 | static int adt7470_remove(struct i2c_client *client); | 179 | static int adt7470_remove(struct i2c_client *client); |
183 | 180 | ||
184 | static const struct i2c_device_id adt7470_id[] = { | 181 | static const struct i2c_device_id adt7470_id[] = { |
185 | { "adt7470", adt7470 }, | 182 | { "adt7470", 0 }, |
186 | { } | 183 | { } |
187 | }; | 184 | }; |
188 | MODULE_DEVICE_TABLE(i2c, adt7470_id); | 185 | MODULE_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 */ |
1228 | static int adt7470_detect(struct i2c_client *client, int kind, | 1225 | static 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 aea244db974e..434576f61c84 100644 --- a/drivers/hwmon/adt7473.c +++ b/drivers/hwmon/adt7473.c | |||
@@ -32,9 +32,6 @@ | |||
32 | /* Addresses to scan */ | 32 | /* Addresses to scan */ |
33 | static const unsigned short normal_i2c[] = { 0x2C, 0x2D, 0x2E, I2C_CLIENT_END }; | 33 | static const unsigned short normal_i2c[] = { 0x2C, 0x2D, 0x2E, I2C_CLIENT_END }; |
34 | 34 | ||
35 | /* Insmod parameters */ | ||
36 | I2C_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 | ||
167 | static int adt7473_probe(struct i2c_client *client, | 164 | static int adt7473_probe(struct i2c_client *client, |
168 | const struct i2c_device_id *id); | 165 | const struct i2c_device_id *id); |
169 | static int adt7473_detect(struct i2c_client *client, int kind, | 166 | static int adt7473_detect(struct i2c_client *client, |
170 | struct i2c_board_info *info); | 167 | struct i2c_board_info *info); |
171 | static int adt7473_remove(struct i2c_client *client); | 168 | static int adt7473_remove(struct i2c_client *client); |
172 | 169 | ||
173 | static const struct i2c_device_id adt7473_id[] = { | 170 | static 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 */ |
1088 | static int adt7473_detect(struct i2c_client *client, int kind, | 1085 | static 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 99abfddedbc3..a0c385145686 100644 --- a/drivers/hwmon/adt7475.c +++ b/drivers/hwmon/adt7475.c | |||
@@ -148,7 +148,7 @@ | |||
148 | 148 | ||
149 | static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; | 149 | static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; |
150 | 150 | ||
151 | I2C_CLIENT_INSMOD_4(adt7473, adt7475, adt7476, adt7490); | 151 | enum chips { adt7473, adt7475, adt7476, adt7490 }; |
152 | 152 | ||
153 | static const struct i2c_device_id adt7475_id[] = { | 153 | static 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 }; | |||
1172 | static struct attribute_group in5_attr_group = { .attrs = in5_attrs }; | 1172 | static struct attribute_group in5_attr_group = { .attrs = in5_attrs }; |
1173 | static struct attribute_group vid_attr_group = { .attrs = vid_attrs }; | 1173 | static struct attribute_group vid_attr_group = { .attrs = vid_attrs }; |
1174 | 1174 | ||
1175 | static int adt7475_detect(struct i2c_client *client, int kind, | 1175 | static 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 | ||
1418 | static void adt7475_read_hystersis(struct i2c_client *client) | 1418 | static void adt7475_read_hystersis(struct i2c_client *client) |
diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c index 480f80ea1fa0..7dada559b3a1 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 */ |
52 | static const unsigned short normal_i2c[] = { 0x2d, I2C_CLIENT_END }; | 52 | static const unsigned short normal_i2c[] = { 0x2d, I2C_CLIENT_END }; |
53 | 53 | ||
54 | /* Insmod parameters */ | ||
55 | I2C_CLIENT_INSMOD_1(asb100); | ||
56 | |||
57 | static unsigned short force_subclients[4]; | 54 | static unsigned short force_subclients[4]; |
58 | module_param_array(force_subclients, short, NULL, 0); | 55 | module_param_array(force_subclients, short, NULL, 0); |
59 | MODULE_PARM_DESC(force_subclients, "List of subclient addresses: " | 56 | MODULE_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 | ||
210 | static int asb100_probe(struct i2c_client *client, | 207 | static int asb100_probe(struct i2c_client *client, |
211 | const struct i2c_device_id *id); | 208 | const struct i2c_device_id *id); |
212 | static int asb100_detect(struct i2c_client *client, int kind, | 209 | static int asb100_detect(struct i2c_client *client, |
213 | struct i2c_board_info *info); | 210 | struct i2c_board_info *info); |
214 | static int asb100_remove(struct i2c_client *client); | 211 | static int asb100_remove(struct i2c_client *client); |
215 | static struct asb100_data *asb100_update_device(struct device *dev); | 212 | static struct asb100_data *asb100_update_device(struct device *dev); |
216 | static void asb100_init_client(struct i2c_client *client); | 213 | static void asb100_init_client(struct i2c_client *client); |
217 | 214 | ||
218 | static const struct i2c_device_id asb100_id[] = { | 215 | static const struct i2c_device_id asb100_id[] = { |
219 | { "asb100", asb100 }, | 216 | { "asb100", 0 }, |
220 | { } | 217 | { } |
221 | }; | 218 | }; |
222 | MODULE_DEVICE_TABLE(i2c, asb100_id); | 219 | MODULE_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 */ |
700 | static int asb100_detect(struct i2c_client *client, int kind, | 697 | static 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 d6b490d3e36f..94cadc19f0c5 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 | ||
45 | static const unsigned short normal_i2c[] = { 0x37, 0x4e, I2C_CLIENT_END }; | 45 | static const unsigned short normal_i2c[] = { 0x37, 0x4e, I2C_CLIENT_END }; |
46 | 46 | ||
47 | I2C_CLIENT_INSMOD_1(atxp1); | ||
48 | |||
49 | static int atxp1_probe(struct i2c_client *client, | 47 | static int atxp1_probe(struct i2c_client *client, |
50 | const struct i2c_device_id *id); | 48 | const struct i2c_device_id *id); |
51 | static int atxp1_remove(struct i2c_client *client); | 49 | static int atxp1_remove(struct i2c_client *client); |
52 | static struct atxp1_data * atxp1_update_device(struct device *dev); | 50 | static struct atxp1_data * atxp1_update_device(struct device *dev); |
53 | static int atxp1_detect(struct i2c_client *client, int kind, | 51 | static int atxp1_detect(struct i2c_client *client, struct i2c_board_info *info); |
54 | struct i2c_board_info *info); | ||
55 | 52 | ||
56 | static const struct i2c_device_id atxp1_id[] = { | 53 | static const struct i2c_device_id atxp1_id[] = { |
57 | { "atxp1", atxp1 }, | 54 | { "atxp1", 0 }, |
58 | { } | 55 | { } |
59 | }; | 56 | }; |
60 | MODULE_DEVICE_TABLE(i2c, atxp1_id); | 57 | MODULE_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 | ||
74 | struct atxp1_data { | 71 | struct 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 */ |
278 | static int atxp1_detect(struct i2c_client *new_client, int kind, | 275 | static 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 4377bb0cc526..823dd28a902c 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 */ |
58 | static const unsigned short normal_i2c[] = {0x2c, 0x2d, 0x2e, I2C_CLIENT_END}; | 58 | static const unsigned short normal_i2c[] = {0x2c, 0x2d, 0x2e, I2C_CLIENT_END}; |
59 | 59 | ||
60 | /* Insmod parameters */ | 60 | enum chips { dme1737, sch5027, sch311x }; |
61 | I2C_CLIENT_INSMOD_2(dme1737, sch5027); | ||
62 | |||
63 | /* ISA chip types */ | ||
64 | enum 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 */ |
2211 | static int dme1737_i2c_detect(struct i2c_client *client, int kind, | 2207 | static 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 2a4c6a05b14f..e11363467a8d 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 */ |
41 | I2C_CLIENT_INSMOD_1(ds1621); | ||
42 | static int polarity = -1; | 41 | static int polarity = -1; |
43 | module_param(polarity, int, 0); | 42 | module_param(polarity, int, 0); |
44 | MODULE_PARM_DESC(polarity, "Output's polarity: 0 = active high, 1 = active low"); | 43 | MODULE_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 */ |
227 | static int ds1621_detect(struct i2c_client *client, int kind, | 226 | static 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 | ||
307 | static const struct i2c_device_id ds1621_id[] = { | 306 | static const struct i2c_device_id ds1621_id[] = { |
308 | { "ds1621", ds1621 }, | 307 | { "ds1621", 0 }, |
309 | { "ds1625", ds1621 }, | 308 | { "ds1625", 0 }, |
310 | { } | 309 | { } |
311 | }; | 310 | }; |
312 | MODULE_DEVICE_TABLE(i2c, ds1621_id); | 311 | MODULE_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 | ||
327 | static int __init ds1621_init(void) | 326 | static int __init ds1621_init(void) |
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c index 40dfbcd3f3f2..277398f9c938 100644 --- a/drivers/hwmon/f75375s.c +++ b/drivers/hwmon/f75375s.c | |||
@@ -39,8 +39,7 @@ | |||
39 | /* Addresses to scan */ | 39 | /* Addresses to scan */ |
40 | static const unsigned short normal_i2c[] = { 0x2d, 0x2e, I2C_CLIENT_END }; | 40 | static const unsigned short normal_i2c[] = { 0x2d, 0x2e, I2C_CLIENT_END }; |
41 | 41 | ||
42 | /* Insmod parameters */ | 42 | enum chips { f75373, f75375 }; |
43 | I2C_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 | ||
116 | static int f75375_detect(struct i2c_client *client, int kind, | 115 | static int f75375_detect(struct i2c_client *client, |
117 | struct i2c_board_info *info); | 116 | struct i2c_board_info *info); |
118 | static int f75375_probe(struct i2c_client *client, | 117 | static 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 | ||
141 | static inline int f75375_read8(struct i2c_client *client, u8 reg) | 140 | static 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 */ |
680 | static int f75375_detect(struct i2c_client *client, int kind, | 679 | static 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 281829cd1533..bd0fc67e804b 100644 --- a/drivers/hwmon/fschmd.c +++ b/drivers/hwmon/fschmd.c | |||
@@ -56,7 +56,8 @@ static int nowayout = WATCHDOG_NOWAYOUT; | |||
56 | module_param(nowayout, int, 0); | 56 | module_param(nowayout, int, 0); |
57 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" | 57 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" |
58 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); | 58 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); |
59 | I2C_CLIENT_INSMOD_7(fscpos, fscher, fscscy, fschrc, fschmd, fschds, fscsyl); | 59 | |
60 | enum 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 | ||
222 | static int fschmd_probe(struct i2c_client *client, | 223 | static int fschmd_probe(struct i2c_client *client, |
223 | const struct i2c_device_id *id); | 224 | const struct i2c_device_id *id); |
224 | static int fschmd_detect(struct i2c_client *client, int kind, | 225 | static int fschmd_detect(struct i2c_client *client, |
225 | struct i2c_board_info *info); | 226 | struct i2c_board_info *info); |
226 | static int fschmd_remove(struct i2c_client *client); | 227 | static int fschmd_remove(struct i2c_client *client); |
227 | static struct fschmd_data *fschmd_update_device(struct device *dev); | 228 | static 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 | ||
1003 | static int fschmd_detect(struct i2c_client *client, int _kind, | 1004 | static 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 1d69458aa0b6..e7ae5743e181 100644 --- a/drivers/hwmon/gl518sm.c +++ b/drivers/hwmon/gl518sm.c | |||
@@ -46,8 +46,7 @@ | |||
46 | /* Addresses to scan */ | 46 | /* Addresses to scan */ |
47 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; | 47 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; |
48 | 48 | ||
49 | /* Insmod parameters */ | 49 | enum chips { gl518sm_r00, gl518sm_r80 }; |
50 | I2C_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 | ||
140 | static int gl518_probe(struct i2c_client *client, | 139 | static int gl518_probe(struct i2c_client *client, |
141 | const struct i2c_device_id *id); | 140 | const struct i2c_device_id *id); |
142 | static int gl518_detect(struct i2c_client *client, int kind, | 141 | static int gl518_detect(struct i2c_client *client, struct i2c_board_info *info); |
143 | struct i2c_board_info *info); | ||
144 | static void gl518_init_client(struct i2c_client *client); | 142 | static void gl518_init_client(struct i2c_client *client); |
145 | static int gl518_remove(struct i2c_client *client); | 143 | static int gl518_remove(struct i2c_client *client); |
146 | static int gl518_read_value(struct i2c_client *client, u8 reg); | 144 | static 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 */ |
487 | static int gl518_detect(struct i2c_client *client, int kind, | 485 | static 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 92b5720ceaff..ec588026f0a9 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 */ |
42 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; | 42 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; |
43 | 43 | ||
44 | /* Insmod parameters */ | ||
45 | I2C_CLIENT_INSMOD_1(gl520sm); | ||
46 | |||
47 | /* Many GL520 constants specified below | 44 | /* Many GL520 constants specified below |
48 | One of the inputs can be configured as either temp or voltage. | 45 | One of the inputs can be configured as either temp or voltage. |
49 | That's why _TEMP2 and _IN4 access the same register | 46 | That'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 | ||
82 | static int gl520_probe(struct i2c_client *client, | 79 | static int gl520_probe(struct i2c_client *client, |
83 | const struct i2c_device_id *id); | 80 | const struct i2c_device_id *id); |
84 | static int gl520_detect(struct i2c_client *client, int kind, | 81 | static int gl520_detect(struct i2c_client *client, struct i2c_board_info *info); |
85 | struct i2c_board_info *info); | ||
86 | static void gl520_init_client(struct i2c_client *client); | 82 | static void gl520_init_client(struct i2c_client *client); |
87 | static int gl520_remove(struct i2c_client *client); | 83 | static int gl520_remove(struct i2c_client *client); |
88 | static int gl520_read_value(struct i2c_client *client, u8 reg); | 84 | static 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 */ |
93 | static const struct i2c_device_id gl520_id[] = { | 89 | static const struct i2c_device_id gl520_id[] = { |
94 | { "gl520sm", gl520sm }, | 90 | { "gl520sm", 0 }, |
95 | { } | 91 | { } |
96 | }; | 92 | }; |
97 | MODULE_DEVICE_TABLE(i2c, gl520_id); | 93 | MODULE_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 */ |
684 | static int gl520_detect(struct i2c_client *client, int kind, | 680 | static 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 5da66ab04f74..bf81aff7051d 100644 --- a/drivers/hwmon/lm63.c +++ b/drivers/hwmon/lm63.c | |||
@@ -56,12 +56,6 @@ | |||
56 | static const unsigned short normal_i2c[] = { 0x4c, I2C_CLIENT_END }; | 56 | static const unsigned short normal_i2c[] = { 0x4c, I2C_CLIENT_END }; |
57 | 57 | ||
58 | /* | 58 | /* |
59 | * Insmod parameters | ||
60 | */ | ||
61 | |||
62 | I2C_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 | ||
135 | static struct lm63_data *lm63_update_device(struct device *dev); | 129 | static struct lm63_data *lm63_update_device(struct device *dev); |
136 | 130 | ||
137 | static int lm63_detect(struct i2c_client *client, int kind, | 131 | static int lm63_detect(struct i2c_client *client, struct i2c_board_info *info); |
138 | struct i2c_board_info *info); | ||
139 | static void lm63_init_client(struct i2c_client *client); | 132 | static 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 | ||
145 | static const struct i2c_device_id lm63_id[] = { | 138 | static const struct i2c_device_id lm63_id[] = { |
146 | { "lm63", lm63 }, | 139 | { "lm63", 0 }, |
147 | { } | 140 | { } |
148 | }; | 141 | }; |
149 | MODULE_DEVICE_TABLE(i2c, lm63_id); | 142 | MODULE_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 */ |
426 | static int lm63_detect(struct i2c_client *new_client, int kind, | 419 | static 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 0bf8b2a8e9f0..c5f39ba103c0 100644 --- a/drivers/hwmon/lm73.c +++ b/drivers/hwmon/lm73.c | |||
@@ -27,9 +27,6 @@ | |||
27 | static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4c, | 27 | static 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 */ | ||
31 | I2C_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 | ||
147 | static const struct i2c_device_id lm73_ids[] = { | 144 | static const struct i2c_device_id lm73_ids[] = { |
148 | { "lm73", lm73 }, | 145 | { "lm73", 0 }, |
149 | { /* LIST END */ } | 146 | { /* LIST END */ } |
150 | }; | 147 | }; |
151 | MODULE_DEVICE_TABLE(i2c, lm73_ids); | 148 | MODULE_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 */ |
154 | static int lm73_detect(struct i2c_client *new_client, int kind, | 151 | static 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 e392548cccb8..8ae2cfe2d827 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 | ||
40 | enum lm75_type { /* keep sorted in alphabetical order */ | 37 | enum 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 */ | |||
58 | static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c, | 55 | static 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 */ | ||
62 | I2C_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[] = { | |||
234 | MODULE_DEVICE_TABLE(i2c, lm75_ids); | 228 | MODULE_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 */ |
237 | static int lm75_detect(struct i2c_client *new_client, int kind, | 231 | static 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 ac067fd19482..b28a297be50c 100644 --- a/drivers/hwmon/lm77.c +++ b/drivers/hwmon/lm77.c | |||
@@ -39,9 +39,6 @@ | |||
39 | static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, | 39 | static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, |
40 | I2C_CLIENT_END }; | 40 | I2C_CLIENT_END }; |
41 | 41 | ||
42 | /* Insmod parameters */ | ||
43 | I2C_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 | ||
67 | static int lm77_probe(struct i2c_client *client, | 64 | static int lm77_probe(struct i2c_client *client, |
68 | const struct i2c_device_id *id); | 65 | const struct i2c_device_id *id); |
69 | static int lm77_detect(struct i2c_client *client, int kind, | 66 | static int lm77_detect(struct i2c_client *client, struct i2c_board_info *info); |
70 | struct i2c_board_info *info); | ||
71 | static void lm77_init_client(struct i2c_client *client); | 67 | static void lm77_init_client(struct i2c_client *client); |
72 | static int lm77_remove(struct i2c_client *client); | 68 | static int lm77_remove(struct i2c_client *client); |
73 | static u16 lm77_read_value(struct i2c_client *client, u8 reg); | 69 | static 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 | ||
79 | static const struct i2c_device_id lm77_id[] = { | 75 | static const struct i2c_device_id lm77_id[] = { |
80 | { "lm77", lm77 }, | 76 | { "lm77", 0 }, |
81 | { } | 77 | { } |
82 | }; | 78 | }; |
83 | MODULE_DEVICE_TABLE(i2c, lm77_id); | 79 | MODULE_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 */ |
248 | static int lm77_detect(struct i2c_client *new_client, int kind, | 244 | static 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 5978291cebb3..cadcbd90ff3b 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 }; |
42 | static unsigned short isa_address = 0x290; | 42 | static unsigned short isa_address = 0x290; |
43 | 43 | ||
44 | /* Insmod parameters */ | 44 | enum chips { lm78, lm79 }; |
45 | I2C_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 | ||
145 | static int lm78_i2c_detect(struct i2c_client *client, int kind, | 144 | static int lm78_i2c_detect(struct i2c_client *client, |
146 | struct i2c_board_info *info); | 145 | struct i2c_board_info *info); |
147 | static int lm78_i2c_probe(struct i2c_client *client, | 146 | static 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 | ||
179 | static struct platform_driver lm78_isa_driver = { | 178 | static 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 | ||
561 | static int lm78_i2c_detect(struct i2c_client *client, int kind, | 560 | static 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 bcffc1899403..18a0e6c5fe88 100644 --- a/drivers/hwmon/lm80.c +++ b/drivers/hwmon/lm80.c | |||
@@ -35,9 +35,6 @@ | |||
35 | static const unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, | 35 | static 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 */ | ||
39 | I2C_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 | ||
134 | static int lm80_probe(struct i2c_client *client, | 131 | static int lm80_probe(struct i2c_client *client, |
135 | const struct i2c_device_id *id); | 132 | const struct i2c_device_id *id); |
136 | static int lm80_detect(struct i2c_client *client, int kind, | 133 | static int lm80_detect(struct i2c_client *client, struct i2c_board_info *info); |
137 | struct i2c_board_info *info); | ||
138 | static void lm80_init_client(struct i2c_client *client); | 134 | static void lm80_init_client(struct i2c_client *client); |
139 | static int lm80_remove(struct i2c_client *client); | 135 | static int lm80_remove(struct i2c_client *client); |
140 | static struct lm80_data *lm80_update_device(struct device *dev); | 136 | static 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 | ||
148 | static const struct i2c_device_id lm80_id[] = { | 144 | static const struct i2c_device_id lm80_id[] = { |
149 | { "lm80", lm80 }, | 145 | { "lm80", 0 }, |
150 | { } | 146 | { } |
151 | }; | 147 | }; |
152 | MODULE_DEVICE_TABLE(i2c, lm80_id); | 148 | MODULE_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 */ |
450 | static int lm80_detect(struct i2c_client *client, int kind, | 446 | static 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 08b03e6ed0b7..8290476aee4a 100644 --- a/drivers/hwmon/lm83.c +++ b/drivers/hwmon/lm83.c | |||
@@ -51,11 +51,7 @@ | |||
51 | static const unsigned short normal_i2c[] = { | 51 | static 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 | /* | 54 | enum chips { lm83, lm82 }; |
55 | * Insmod parameters | ||
56 | */ | ||
57 | |||
58 | I2C_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 | ||
121 | static int lm83_detect(struct i2c_client *new_client, int kind, | 117 | static int lm83_detect(struct i2c_client *new_client, |
122 | struct i2c_board_info *info); | 118 | struct i2c_board_info *info); |
123 | static int lm83_probe(struct i2c_client *client, | 119 | static 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 */ |
294 | static int lm83_detect(struct i2c_client *new_client, int kind, | 290 | static 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 d56da2e74708..b3841a615595 100644 --- a/drivers/hwmon/lm85.c +++ b/drivers/hwmon/lm85.c | |||
@@ -38,9 +38,11 @@ | |||
38 | /* Addresses to scan */ | 38 | /* Addresses to scan */ |
39 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; | 39 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; |
40 | 40 | ||
41 | /* Insmod parameters */ | 41 | enum chips { |
42 | I2C_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 | ||
326 | static int lm85_detect(struct i2c_client *client, int kind, | 328 | static int lm85_detect(struct i2c_client *client, struct i2c_board_info *info); |
327 | struct i2c_board_info *info); | ||
328 | static int lm85_probe(struct i2c_client *client, | 329 | static int lm85_probe(struct i2c_client *client, |
329 | const struct i2c_device_id *id); | 330 | const struct i2c_device_id *id); |
330 | static int lm85_remove(struct i2c_client *client); | 331 | static 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 */ |
1159 | static int lm85_detect(struct i2c_client *client, int kind, | 1160 | static 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 4929b1815eee..f1e6e7512ffa 100644 --- a/drivers/hwmon/lm87.c +++ b/drivers/hwmon/lm87.c | |||
@@ -74,11 +74,7 @@ | |||
74 | 74 | ||
75 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; | 75 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; |
76 | 76 | ||
77 | /* | 77 | enum chips { lm87, adm1024 }; |
78 | * Insmod parameters | ||
79 | */ | ||
80 | |||
81 | I2C_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 | ||
159 | static int lm87_probe(struct i2c_client *client, | 155 | static int lm87_probe(struct i2c_client *client, |
160 | const struct i2c_device_id *id); | 156 | const struct i2c_device_id *id); |
161 | static int lm87_detect(struct i2c_client *new_client, int kind, | 157 | static int lm87_detect(struct i2c_client *new_client, |
162 | struct i2c_board_info *info); | 158 | struct i2c_board_info *info); |
163 | static void lm87_init_client(struct i2c_client *client); | 159 | static void lm87_init_client(struct i2c_client *client); |
164 | static int lm87_remove(struct i2c_client *client); | 160 | static 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 */ |
665 | static int lm87_detect(struct i2c_client *new_client, int kind, | 661 | static 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 b7c905f50ed4..7c9bdc167426 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c | |||
@@ -93,12 +93,7 @@ | |||
93 | static const unsigned short normal_i2c[] = { | 93 | static 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 | /* | 96 | enum chips { lm90, adm1032, lm99, lm86, max6657, adt7461, max6680, max6646 }; |
97 | * Insmod parameters | ||
98 | */ | ||
99 | |||
100 | I2C_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 | ||
155 | static int lm90_detect(struct i2c_client *client, int kind, | 150 | static int lm90_detect(struct i2c_client *client, struct i2c_board_info *info); |
156 | struct i2c_board_info *info); | ||
157 | static int lm90_probe(struct i2c_client *client, | 151 | static int lm90_probe(struct i2c_client *client, |
158 | const struct i2c_device_id *id); | 152 | const struct i2c_device_id *id); |
159 | static void lm90_init_client(struct i2c_client *client); | 153 | static 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 */ |
659 | static int lm90_detect(struct i2c_client *new_client, int kind, | 653 | static 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 47ac698709dc..7c31e6205f85 100644 --- a/drivers/hwmon/lm92.c +++ b/drivers/hwmon/lm92.c | |||
@@ -54,9 +54,6 @@ | |||
54 | static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, | 54 | static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, |
55 | I2C_CLIENT_END }; | 55 | I2C_CLIENT_END }; |
56 | 56 | ||
57 | /* Insmod parameters */ | ||
58 | I2C_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 */ |
322 | static int lm92_detect(struct i2c_client *new_client, int kind, | 319 | static 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 | ||
403 | static const struct i2c_device_id lm92_id[] = { | 400 | static 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 | ||
422 | static int __init sensors_lm92_init(void) | 419 | static int __init sensors_lm92_init(void) |
diff --git a/drivers/hwmon/lm93.c b/drivers/hwmon/lm93.c index 124dd7cea54c..6669255aadcf 100644 --- a/drivers/hwmon/lm93.c +++ b/drivers/hwmon/lm93.c | |||
@@ -145,7 +145,6 @@ | |||
145 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; | 145 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; |
146 | 146 | ||
147 | /* Insmod parameters */ | 147 | /* Insmod parameters */ |
148 | I2C_CLIENT_INSMOD_1(lm93); | ||
149 | 148 | ||
150 | static int disable_block; | 149 | static int disable_block; |
151 | module_param(disable_block, bool, 0); | 150 | module_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 */ |
2504 | static int lm93_detect(struct i2c_client *client, int kind, | 2503 | static 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 | ||
2605 | static const struct i2c_device_id lm93_id[] = { | 2603 | static const struct i2c_device_id lm93_id[] = { |
2606 | { "lm93", lm93 }, | 2604 | { "lm93", 0 }, |
2607 | { } | 2605 | { } |
2608 | }; | 2606 | }; |
2609 | MODULE_DEVICE_TABLE(i2c, lm93_id); | 2607 | MODULE_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 | ||
2623 | static int __init lm93_init(void) | 2621 | static int __init lm93_init(void) |
diff --git a/drivers/hwmon/lm95241.c b/drivers/hwmon/lm95241.c index 906b896cf1d0..8fc8eb8cba47 100644 --- a/drivers/hwmon/lm95241.c +++ b/drivers/hwmon/lm95241.c | |||
@@ -39,9 +39,6 @@ | |||
39 | static const unsigned short normal_i2c[] = { | 39 | static const unsigned short normal_i2c[] = { |
40 | 0x19, 0x2a, 0x2b, I2C_CLIENT_END}; | 40 | 0x19, 0x2a, 0x2b, I2C_CLIENT_END}; |
41 | 41 | ||
42 | /* Insmod parameters */ | ||
43 | I2C_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 */ |
313 | static int lm95241_detect(struct i2c_client *new_client, int kind, | 310 | static 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) */ |
448 | static const struct i2c_device_id lm95241_id[] = { | 445 | static const struct i2c_device_id lm95241_id[] = { |
449 | { "lm95241", lm95241 }, | 446 | { "lm95241", 0 }, |
450 | { } | 447 | { } |
451 | }; | 448 | }; |
452 | MODULE_DEVICE_TABLE(i2c, lm95241_id); | 449 | MODULE_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 | ||
466 | static int __init sensors_lm95241_init(void) | 463 | static int __init sensors_lm95241_init(void) |
diff --git a/drivers/hwmon/max1619.c b/drivers/hwmon/max1619.c index 7fcf5ff89e7f..022ded098100 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 | |||
47 | I2C_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 | ||
89 | static int max1619_probe(struct i2c_client *client, | 83 | static int max1619_probe(struct i2c_client *client, |
90 | const struct i2c_device_id *id); | 84 | const struct i2c_device_id *id); |
91 | static int max1619_detect(struct i2c_client *client, int kind, | 85 | static int max1619_detect(struct i2c_client *client, |
92 | struct i2c_board_info *info); | 86 | struct i2c_board_info *info); |
93 | static void max1619_init_client(struct i2c_client *client); | 87 | static void max1619_init_client(struct i2c_client *client); |
94 | static int max1619_remove(struct i2c_client *client); | 88 | static 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 | ||
101 | static const struct i2c_device_id max1619_id[] = { | 95 | static const struct i2c_device_id max1619_id[] = { |
102 | { "max1619", max1619 }, | 96 | { "max1619", 0 }, |
103 | { } | 97 | { } |
104 | }; | 98 | }; |
105 | MODULE_DEVICE_TABLE(i2c, max1619_id); | 99 | MODULE_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 */ |
229 | static int max1619_detect(struct i2c_client *client, int kind, | 223 | static 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 1da561e0cb37..a0160ee5caef 100644 --- a/drivers/hwmon/max6650.c +++ b/drivers/hwmon/max6650.c | |||
@@ -62,8 +62,6 @@ module_param(fan_voltage, int, S_IRUGO); | |||
62 | module_param(prescaler, int, S_IRUGO); | 62 | module_param(prescaler, int, S_IRUGO); |
63 | module_param(clock, int, S_IRUGO); | 63 | module_param(clock, int, S_IRUGO); |
64 | 64 | ||
65 | I2C_CLIENT_INSMOD_1(max6650); | ||
66 | |||
67 | /* | 65 | /* |
68 | * MAX 6650/6651 registers | 66 | * MAX 6650/6651 registers |
69 | */ | 67 | */ |
@@ -116,7 +114,7 @@ I2C_CLIENT_INSMOD_1(max6650); | |||
116 | 114 | ||
117 | static int max6650_probe(struct i2c_client *client, | 115 | static int max6650_probe(struct i2c_client *client, |
118 | const struct i2c_device_id *id); | 116 | const struct i2c_device_id *id); |
119 | static int max6650_detect(struct i2c_client *client, int kind, | 117 | static int max6650_detect(struct i2c_client *client, |
120 | struct i2c_board_info *info); | 118 | struct i2c_board_info *info); |
121 | static int max6650_init_client(struct i2c_client *client); | 119 | static int max6650_init_client(struct i2c_client *client); |
122 | static int max6650_remove(struct i2c_client *client); | 120 | static int max6650_remove(struct i2c_client *client); |
@@ -127,7 +125,7 @@ static struct max6650_data *max6650_update_device(struct device *dev); | |||
127 | */ | 125 | */ |
128 | 126 | ||
129 | static const struct i2c_device_id max6650_id[] = { | 127 | static const struct i2c_device_id max6650_id[] = { |
130 | { "max6650", max6650 }, | 128 | { "max6650", 0 }, |
131 | { } | 129 | { } |
132 | }; | 130 | }; |
133 | MODULE_DEVICE_TABLE(i2c, max6650_id); | 131 | MODULE_DEVICE_TABLE(i2c, max6650_id); |
@@ -141,7 +139,7 @@ static struct i2c_driver max6650_driver = { | |||
141 | .remove = max6650_remove, | 139 | .remove = max6650_remove, |
142 | .id_table = max6650_id, | 140 | .id_table = max6650_id, |
143 | .detect = max6650_detect, | 141 | .detect = max6650_detect, |
144 | .address_data = &addr_data, | 142 | .address_list = normal_i2c, |
145 | }; | 143 | }; |
146 | 144 | ||
147 | /* | 145 | /* |
@@ -528,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 */ |
531 | static int max6650_detect(struct i2c_client *client, int kind, | 529 | static int max6650_detect(struct i2c_client *client, |
532 | struct i2c_board_info *info) | 530 | struct i2c_board_info *info) |
533 | { | 531 | { |
534 | struct i2c_adapter *adapter = client->adapter; | 532 | struct i2c_adapter *adapter = client->adapter; |
diff --git a/drivers/hwmon/pcf8591.c b/drivers/hwmon/pcf8591.c index 1d7ffebd679d..d44787949851 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 */ |
32 | I2C_CLIENT_INSMOD_1(pcf8591); | ||
33 | 32 | ||
34 | static int input_mode; | 33 | static int input_mode; |
35 | module_param(input_mode, int, 0); | 34 | module_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 */ |
172 | static int pcf8591_detect(struct i2c_client *client, int kind, | 171 | static 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 | ||
305 | static int __init pcf8591_init(void) | 304 | static int __init pcf8591_init(void) |
diff --git a/drivers/hwmon/smsc47m192.c b/drivers/hwmon/smsc47m192.c index 4d88c045781c..40b26673d87f 100644 --- a/drivers/hwmon/smsc47m192.c +++ b/drivers/hwmon/smsc47m192.c | |||
@@ -36,9 +36,6 @@ | |||
36 | /* Addresses to scan */ | 36 | /* Addresses to scan */ |
37 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; | 37 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; |
38 | 38 | ||
39 | /* Insmod parameters */ | ||
40 | I2C_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 | ||
116 | static int smsc47m192_probe(struct i2c_client *client, | 113 | static int smsc47m192_probe(struct i2c_client *client, |
117 | const struct i2c_device_id *id); | 114 | const struct i2c_device_id *id); |
118 | static int smsc47m192_detect(struct i2c_client *client, int kind, | 115 | static int smsc47m192_detect(struct i2c_client *client, |
119 | struct i2c_board_info *info); | 116 | struct i2c_board_info *info); |
120 | static int smsc47m192_remove(struct i2c_client *client); | 117 | static int smsc47m192_remove(struct i2c_client *client); |
121 | static struct smsc47m192_data *smsc47m192_update_device(struct device *dev); | 118 | static struct smsc47m192_data *smsc47m192_update_device(struct device *dev); |
122 | 119 | ||
123 | static const struct i2c_device_id smsc47m192_id[] = { | 120 | static const struct i2c_device_id smsc47m192_id[] = { |
124 | { "smsc47m192", smsc47m192 }, | 121 | { "smsc47m192", 0 }, |
125 | { } | 122 | { } |
126 | }; | 123 | }; |
127 | MODULE_DEVICE_TABLE(i2c, smsc47m192_id); | 124 | MODULE_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 */ |
484 | static int smsc47m192_detect(struct i2c_client *client, int kind, | 481 | static 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 4b793849c738..7dfb4dec4c5f 100644 --- a/drivers/hwmon/thmc50.c +++ b/drivers/hwmon/thmc50.c | |||
@@ -35,7 +35,7 @@ MODULE_LICENSE("GPL"); | |||
35 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; | 35 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; |
36 | 36 | ||
37 | /* Insmod parameters */ | 37 | /* Insmod parameters */ |
38 | I2C_CLIENT_INSMOD_2(thmc50, adm1022); | 38 | enum chips { thmc50, adm1022 }; |
39 | 39 | ||
40 | static unsigned short adm1022_temp3[16]; | 40 | static unsigned short adm1022_temp3[16]; |
41 | static unsigned int adm1022_temp3_num; | 41 | static unsigned int adm1022_temp3_num; |
@@ -84,7 +84,7 @@ struct thmc50_data { | |||
84 | u8 alarms; | 84 | u8 alarms; |
85 | }; | 85 | }; |
86 | 86 | ||
87 | static int thmc50_detect(struct i2c_client *client, int kind, | 87 | static int thmc50_detect(struct i2c_client *client, |
88 | struct i2c_board_info *info); | 88 | struct i2c_board_info *info); |
89 | static int thmc50_probe(struct i2c_client *client, | 89 | static 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 | ||
114 | static ssize_t show_analog_out(struct device *dev, | 114 | static 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 */ |
289 | static int thmc50_detect(struct i2c_client *client, int kind, | 289 | static 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 ee9673467c4a..a13b30e8d8d8 100644 --- a/drivers/hwmon/tmp401.c +++ b/drivers/hwmon/tmp401.c | |||
@@ -42,8 +42,7 @@ | |||
42 | /* Addresses to scan */ | 42 | /* Addresses to scan */ |
43 | static const unsigned short normal_i2c[] = { 0x4c, I2C_CLIENT_END }; | 43 | static const unsigned short normal_i2c[] = { 0x4c, I2C_CLIENT_END }; |
44 | 44 | ||
45 | /* Insmod parameters */ | 45 | enum chips { tmp401, tmp411 }; |
46 | I2C_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 | ||
99 | static int tmp401_probe(struct i2c_client *client, | 98 | static int tmp401_probe(struct i2c_client *client, |
100 | const struct i2c_device_id *id); | 99 | const struct i2c_device_id *id); |
101 | static int tmp401_detect(struct i2c_client *client, int kind, | 100 | static int tmp401_detect(struct i2c_client *client, |
102 | struct i2c_board_info *info); | 101 | struct i2c_board_info *info); |
103 | static int tmp401_remove(struct i2c_client *client); | 102 | static int tmp401_remove(struct i2c_client *client); |
104 | static struct tmp401_data *tmp401_update_device(struct device *dev); | 103 | static 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 | ||
491 | static int tmp401_detect(struct i2c_client *client, int _kind, | 490 | static 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 bb5464a289ca..4f7c051e2d7b 100644 --- a/drivers/hwmon/tmp421.c +++ b/drivers/hwmon/tmp421.c | |||
@@ -39,8 +39,7 @@ | |||
39 | static unsigned short normal_i2c[] = { 0x2a, 0x4c, 0x4d, 0x4e, 0x4f, | 39 | static unsigned short normal_i2c[] = { 0x2a, 0x4c, 0x4d, 0x4e, 0x4f, |
40 | I2C_CLIENT_END }; | 40 | I2C_CLIENT_END }; |
41 | 41 | ||
42 | /* Insmod parameters */ | 42 | enum chips { tmp421, tmp422, tmp423 }; |
43 | I2C_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 | ||
226 | static int tmp421_detect(struct i2c_client *client, int _kind, | 225 | static 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 | ||
328 | static int __init tmp421_init(void) | 327 | static int __init tmp421_init(void) |
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c index 7ab7967da0a0..05f9225b6f94 100644 --- a/drivers/hwmon/w83781d.c +++ b/drivers/hwmon/w83781d.c | |||
@@ -56,9 +56,10 @@ | |||
56 | /* Addresses to scan */ | 56 | /* Addresses to scan */ |
57 | static const unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, | 57 | static 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 */ | ||
60 | I2C_CLIENT_INSMOD_4(w83781d, w83782d, w83783s, as99127f); | ||
61 | 59 | ||
60 | enum chips { w83781d, w83782d, w83783s, as99127f }; | ||
61 | |||
62 | /* Insmod parameters */ | ||
62 | static unsigned short force_subclients[4]; | 63 | static unsigned short force_subclients[4]; |
63 | module_param_array(force_subclients, short, NULL, 0); | 64 | module_param_array(force_subclients, short, NULL, 0); |
64 | MODULE_PARM_DESC(force_subclients, "List of subclient addresses: " | 65 | MODULE_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 */ |
1053 | static int | 1054 | static int |
1054 | w83781d_detect(struct i2c_client *client, int kind, | 1055 | w83781d_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 0410bf12c521..400a88bde278 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 */ |
55 | I2C_CLIENT_INSMOD_1(w83791d); | ||
56 | 55 | ||
57 | static unsigned short force_subclients[4]; | 56 | static unsigned short force_subclients[4]; |
58 | module_param_array(force_subclients, short, NULL, 0); | 57 | module_param_array(force_subclients, short, NULL, 0); |
@@ -326,7 +325,7 @@ struct w83791d_data { | |||
326 | 325 | ||
327 | static int w83791d_probe(struct i2c_client *client, | 326 | static int w83791d_probe(struct i2c_client *client, |
328 | const struct i2c_device_id *id); | 327 | const struct i2c_device_id *id); |
329 | static int w83791d_detect(struct i2c_client *client, int kind, | 328 | static int w83791d_detect(struct i2c_client *client, |
330 | struct i2c_board_info *info); | 329 | struct i2c_board_info *info); |
331 | static int w83791d_remove(struct i2c_client *client); | 330 | static 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); | |||
341 | static void w83791d_init_client(struct i2c_client *client); | 340 | static void w83791d_init_client(struct i2c_client *client); |
342 | 341 | ||
343 | static const struct i2c_device_id w83791d_id[] = { | 342 | static const struct i2c_device_id w83791d_id[] = { |
344 | { "w83791d", w83791d }, | 343 | { "w83791d", 0 }, |
345 | { } | 344 | { } |
346 | }; | 345 | }; |
347 | MODULE_DEVICE_TABLE(i2c, w83791d_id); | 346 | MODULE_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 */ |
1262 | static int w83791d_detect(struct i2c_client *client, int kind, | 1261 | static 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 38978851333f..679718e6b017 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 */ |
53 | I2C_CLIENT_INSMOD_1(w83792d); | ||
54 | 53 | ||
55 | static unsigned short force_subclients[4]; | 54 | static unsigned short force_subclients[4]; |
56 | module_param_array(force_subclients, short, NULL, 0); | 55 | module_param_array(force_subclients, short, NULL, 0); |
@@ -302,7 +301,7 @@ struct w83792d_data { | |||
302 | 301 | ||
303 | static int w83792d_probe(struct i2c_client *client, | 302 | static int w83792d_probe(struct i2c_client *client, |
304 | const struct i2c_device_id *id); | 303 | const struct i2c_device_id *id); |
305 | static int w83792d_detect(struct i2c_client *client, int kind, | 304 | static int w83792d_detect(struct i2c_client *client, |
306 | struct i2c_board_info *info); | 305 | struct i2c_board_info *info); |
307 | static int w83792d_remove(struct i2c_client *client); | 306 | static int w83792d_remove(struct i2c_client *client); |
308 | static struct w83792d_data *w83792d_update_device(struct device *dev); | 307 | static 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); | |||
314 | static void w83792d_init_client(struct i2c_client *client); | 313 | static void w83792d_init_client(struct i2c_client *client); |
315 | 314 | ||
316 | static const struct i2c_device_id w83792d_id[] = { | 315 | static const struct i2c_device_id w83792d_id[] = { |
317 | { "w83792d", w83792d }, | 316 | { "w83792d", 0 }, |
318 | { } | 317 | { } |
319 | }; | 318 | }; |
320 | MODULE_DEVICE_TABLE(i2c, w83792d_id); | 319 | MODULE_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 | ||
334 | static inline long in_count_from_reg(int nr, struct w83792d_data *data) | 333 | static 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 */ |
1265 | static int | 1264 | static int |
1266 | w83792d_detect(struct i2c_client *client, int kind, struct i2c_board_info *info) | 1265 | w83792d_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 80a2191bf127..9a2022b67495 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 */ |
44 | I2C_CLIENT_INSMOD_1(w83793); | ||
45 | 44 | ||
46 | static unsigned short force_subclients[4]; | 45 | static unsigned short force_subclients[4]; |
47 | module_param_array(force_subclients, short, NULL, 0); | 46 | module_param_array(force_subclients, short, NULL, 0); |
@@ -230,7 +229,7 @@ static u8 w83793_read_value(struct i2c_client *client, u16 reg); | |||
230 | static int w83793_write_value(struct i2c_client *client, u16 reg, u8 value); | 229 | static int w83793_write_value(struct i2c_client *client, u16 reg, u8 value); |
231 | static int w83793_probe(struct i2c_client *client, | 230 | static int w83793_probe(struct i2c_client *client, |
232 | const struct i2c_device_id *id); | 231 | const struct i2c_device_id *id); |
233 | static int w83793_detect(struct i2c_client *client, int kind, | 232 | static int w83793_detect(struct i2c_client *client, |
234 | struct i2c_board_info *info); | 233 | struct i2c_board_info *info); |
235 | static int w83793_remove(struct i2c_client *client); | 234 | static int w83793_remove(struct i2c_client *client); |
236 | static void w83793_init_client(struct i2c_client *client); | 235 | static void w83793_init_client(struct i2c_client *client); |
@@ -238,7 +237,7 @@ static void w83793_update_nonvolatile(struct device *dev); | |||
238 | static struct w83793_data *w83793_update_device(struct device *dev); | 237 | static struct w83793_data *w83793_update_device(struct device *dev); |
239 | 238 | ||
240 | static const struct i2c_device_id w83793_id[] = { | 239 | static const struct i2c_device_id w83793_id[] = { |
241 | { "w83793", w83793 }, | 240 | { "w83793", 0 }, |
242 | { } | 241 | { } |
243 | }; | 242 | }; |
244 | MODULE_DEVICE_TABLE(i2c, w83793_id); | 243 | MODULE_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 | ||
258 | static ssize_t | 257 | static 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 */ |
1164 | static int w83793_detect(struct i2c_client *client, int kind, | 1163 | static 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 9b6c4c10fba7..20781def65ed 100644 --- a/drivers/hwmon/w83l785ts.c +++ b/drivers/hwmon/w83l785ts.c | |||
@@ -52,12 +52,6 @@ | |||
52 | static const unsigned short normal_i2c[] = { 0x2e, I2C_CLIENT_END }; | 52 | static const unsigned short normal_i2c[] = { 0x2e, I2C_CLIENT_END }; |
53 | 53 | ||
54 | /* | 54 | /* |
55 | * Insmod parameters | ||
56 | */ | ||
57 | |||
58 | I2C_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 | ||
84 | static int w83l785ts_probe(struct i2c_client *client, | 78 | static int w83l785ts_probe(struct i2c_client *client, |
85 | const struct i2c_device_id *id); | 79 | const struct i2c_device_id *id); |
86 | static int w83l785ts_detect(struct i2c_client *client, int kind, | 80 | static int w83l785ts_detect(struct i2c_client *client, |
87 | struct i2c_board_info *info); | 81 | struct i2c_board_info *info); |
88 | static int w83l785ts_remove(struct i2c_client *client); | 82 | static int w83l785ts_remove(struct i2c_client *client); |
89 | static u8 w83l785ts_read_value(struct i2c_client *client, u8 reg, u8 defval); | 83 | static 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 | ||
96 | static const struct i2c_device_id w83l785ts_id[] = { | 90 | static const struct i2c_device_id w83l785ts_id[] = { |
97 | { "w83l785ts", w83l785ts }, | 91 | { "w83l785ts", 0 }, |
98 | { } | 92 | { } |
99 | }; | 93 | }; |
100 | MODULE_DEVICE_TABLE(i2c, w83l785ts_id); | 94 | MODULE_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 */ |
149 | static int w83l785ts_detect(struct i2c_client *client, int kind, | 143 | static 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 27da7d2b15fb..0254e181893d 100644 --- a/drivers/hwmon/w83l786ng.c +++ b/drivers/hwmon/w83l786ng.c | |||
@@ -38,7 +38,6 @@ | |||
38 | static const unsigned short normal_i2c[] = { 0x2e, 0x2f, I2C_CLIENT_END }; | 38 | static const unsigned short normal_i2c[] = { 0x2e, 0x2f, I2C_CLIENT_END }; |
39 | 39 | ||
40 | /* Insmod parameters */ | 40 | /* Insmod parameters */ |
41 | I2C_CLIENT_INSMOD_1(w83l786ng); | ||
42 | 41 | ||
43 | static int reset; | 42 | static int reset; |
44 | module_param(reset, bool, 0); | 43 | module_param(reset, bool, 0); |
@@ -147,14 +146,14 @@ struct w83l786ng_data { | |||
147 | 146 | ||
148 | static int w83l786ng_probe(struct i2c_client *client, | 147 | static int w83l786ng_probe(struct i2c_client *client, |
149 | const struct i2c_device_id *id); | 148 | const struct i2c_device_id *id); |
150 | static int w83l786ng_detect(struct i2c_client *client, int kind, | 149 | static int w83l786ng_detect(struct i2c_client *client, |
151 | struct i2c_board_info *info); | 150 | struct i2c_board_info *info); |
152 | static int w83l786ng_remove(struct i2c_client *client); | 151 | static int w83l786ng_remove(struct i2c_client *client); |
153 | static void w83l786ng_init_client(struct i2c_client *client); | 152 | static void w83l786ng_init_client(struct i2c_client *client); |
154 | static struct w83l786ng_data *w83l786ng_update_device(struct device *dev); | 153 | static struct w83l786ng_data *w83l786ng_update_device(struct device *dev); |
155 | 154 | ||
156 | static const struct i2c_device_id w83l786ng_id[] = { | 155 | static const struct i2c_device_id w83l786ng_id[] = { |
157 | { "w83l786ng", w83l786ng }, | 156 | { "w83l786ng", 0 }, |
158 | { } | 157 | { } |
159 | }; | 158 | }; |
160 | MODULE_DEVICE_TABLE(i2c, w83l786ng_id); | 159 | MODULE_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 | ||
174 | static u8 | 173 | static u8 |
@@ -586,8 +585,7 @@ static const struct attribute_group w83l786ng_group = { | |||
586 | }; | 585 | }; |
587 | 586 | ||
588 | static int | 587 | static int |
589 | w83l786ng_detect(struct i2c_client *client, int kind, | 588 | w83l786ng_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 4f34823e86b1..0ac2f90ab840 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 | ||
159 | static 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 | |||
171 | static 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 | |||
158 | static int i2c_device_suspend(struct device *dev, pm_message_t mesg) | 187 | static 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 | ||
251 | const static struct dev_pm_ops i2c_device_pm_ops = { | ||
252 | .suspend = i2c_device_pm_suspend, | ||
253 | .resume = i2c_device_pm_resume, | ||
254 | }; | ||
255 | |||
222 | struct bus_type i2c_bus_type = { | 256 | struct 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 | }; |
231 | EXPORT_SYMBOL_GPL(i2c_bus_type); | 266 | EXPORT_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 | ||
1215 | static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver) | 1250 | static 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 2c27193aeaa0..f939ebc2507c 100644 --- a/drivers/misc/eeprom/eeprom.c +++ b/drivers/misc/eeprom/eeprom.c | |||
@@ -32,9 +32,6 @@ | |||
32 | static const unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54, | 32 | static 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 */ | ||
36 | I2C_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 */ |
138 | static int eeprom_detect(struct i2c_client *client, int kind, | 135 | static 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 | ||
239 | static int __init eeprom_init(void) | 235 | static int __init eeprom_init(void) |
diff --git a/drivers/misc/ics932s401.c b/drivers/misc/ics932s401.c index 4bb7a3af9ad9..395a4ea64e9c 100644 --- a/drivers/misc/ics932s401.c +++ b/drivers/misc/ics932s401.c | |||
@@ -30,9 +30,6 @@ | |||
30 | /* Addresses to scan */ | 30 | /* Addresses to scan */ |
31 | static const unsigned short normal_i2c[] = { 0x69, I2C_CLIENT_END }; | 31 | static const unsigned short normal_i2c[] = { 0x69, I2C_CLIENT_END }; |
32 | 32 | ||
33 | /* Insmod parameters */ | ||
34 | I2C_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 | ||
107 | static int ics932s401_probe(struct i2c_client *client, | 104 | static int ics932s401_probe(struct i2c_client *client, |
108 | const struct i2c_device_id *id); | 105 | const struct i2c_device_id *id); |
109 | static int ics932s401_detect(struct i2c_client *client, int kind, | 106 | static int ics932s401_detect(struct i2c_client *client, |
110 | struct i2c_board_info *info); | 107 | struct i2c_board_info *info); |
111 | static int ics932s401_remove(struct i2c_client *client); | 108 | static int ics932s401_remove(struct i2c_client *client); |
112 | 109 | ||
113 | static const struct i2c_device_id ics932s401_id[] = { | 110 | static const struct i2c_device_id ics932s401_id[] = { |
114 | { "ics932s401", ics932s401 }, | 111 | { "ics932s401", 0 }, |
115 | { } | 112 | { } |
116 | }; | 113 | }; |
117 | MODULE_DEVICE_TABLE(i2c, ics932s401_id); | 114 | MODULE_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 | ||
131 | static struct ics932s401_data *ics932s401_update_device(struct device *dev) | 128 | static 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 */ |
416 | static int ics932s401_detect(struct i2c_client *client, int kind, | 413 | static 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 419ab546b266..02fc617782ef 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 | */ | ||
398 | struct 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 \ | ||
614 | static 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 \ | ||
621 | I2C_CLIENT_INSMOD_COMMON | ||
622 | |||
623 | #define I2C_CLIENT_INSMOD_1(chip1) \ | ||
624 | enum chips { any_chip, chip1 }; \ | ||
625 | I2C_CLIENT_INSMOD_COMMON | ||
626 | |||
627 | #define I2C_CLIENT_INSMOD_2(chip1, chip2) \ | ||
628 | enum chips { any_chip, chip1, chip2 }; \ | ||
629 | I2C_CLIENT_INSMOD_COMMON | ||
630 | |||
631 | #define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \ | ||
632 | enum chips { any_chip, chip1, chip2, chip3 }; \ | ||
633 | I2C_CLIENT_INSMOD_COMMON | ||
634 | |||
635 | #define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \ | ||
636 | enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ | ||
637 | I2C_CLIENT_INSMOD_COMMON | ||
638 | |||
639 | #define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \ | ||
640 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ | ||
641 | I2C_CLIENT_INSMOD_COMMON | ||
642 | |||
643 | #define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \ | ||
644 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ | ||
645 | I2C_CLIENT_INSMOD_COMMON | ||
646 | |||
647 | #define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \ | ||
648 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ | ||
649 | chip7 }; \ | ||
650 | I2C_CLIENT_INSMOD_COMMON | ||
651 | |||
652 | #define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \ | ||
653 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ | ||
654 | chip7, chip8 }; \ | ||
655 | I2C_CLIENT_INSMOD_COMMON | ||
656 | #endif /* __KERNEL__ */ | ||
657 | #endif /* _LINUX_I2C_H */ | 571 | #endif /* _LINUX_I2C_H */ |