diff options
author | Jean Delvare <khali@linux-fr.org> | 2005-07-31 15:49:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-09-05 12:14:21 -0400 |
commit | f4b50261207c987913f076d867c2e154d71fd012 (patch) | |
tree | 0b50cfa93f2e1e6a877f51028f93539db0e4547e | |
parent | 96478ef3f3f71fa929cc905cc794993e312d9a5d (diff) |
[PATCH] hwmon: hwmon vs i2c, second round (06/11)
The only thing left in i2c-sensor.h are module parameter definition
macros. It's only an extension of what i2c.h offers, and this extension
is not sensors-specific. As a matter of fact, a few non-sensors drivers
use them. So we better merge them in i2c.h, and get rid of i2c-sensor.h
altogether.
Signed-off-by: Jean Delvare <khali@linux-fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
41 files changed, 188 insertions, 342 deletions
diff --git a/Documentation/i2c/porting-clients b/Documentation/i2c/porting-clients index f9099211bd0b..8b819379adcb 100644 --- a/Documentation/i2c/porting-clients +++ b/Documentation/i2c/porting-clients | |||
@@ -1,4 +1,4 @@ | |||
1 | Revision 4, 2004-03-30 | 1 | Revision 5, 2005-07-29 |
2 | Jean Delvare <khali@linux-fr.org> | 2 | Jean Delvare <khali@linux-fr.org> |
3 | Greg KH <greg@kroah.com> | 3 | Greg KH <greg@kroah.com> |
4 | 4 | ||
@@ -17,13 +17,12 @@ yours for best results. | |||
17 | 17 | ||
18 | Technical changes: | 18 | Technical changes: |
19 | 19 | ||
20 | * [Includes] Get rid of "version.h". Replace <linux/i2c-proc.h> with | 20 | * [Includes] Get rid of "version.h" and <linux/i2c-proc.h>. |
21 | <linux/i2c-sensor.h>. Includes typically look like that: | 21 | Includes typically look like that: |
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/i2c.h> | 25 | #include <linux/i2c.h> |
26 | #include <linux/i2c-sensor.h> | ||
27 | #include <linux/i2c-vid.h> /* if you need VRM support */ | 26 | #include <linux/i2c-vid.h> /* if you need VRM support */ |
28 | #include <asm/io.h> /* if you have I/O operations */ | 27 | #include <asm/io.h> /* if you have I/O operations */ |
29 | Please respect this inclusion order. Some extra headers may be | 28 | Please respect this inclusion order. Some extra headers may be |
@@ -31,6 +30,7 @@ Technical changes: | |||
31 | 30 | ||
32 | * [Addresses] SENSORS_I2C_END becomes I2C_CLIENT_END, ISA addresses | 31 | * [Addresses] SENSORS_I2C_END becomes I2C_CLIENT_END, ISA addresses |
33 | are no more handled by the i2c core. | 32 | are no more handled by the i2c core. |
33 | SENSORS_INSMOD_<n> becomes I2C_CLIENT_INSMOD_<n>. | ||
34 | 34 | ||
35 | * [Client data] Get rid of sysctl_id. Try using standard names for | 35 | * [Client data] Get rid of sysctl_id. Try using standard names for |
36 | register values (for example, temp_os becomes temp_max). You're | 36 | register values (for example, temp_os becomes temp_max). You're |
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients index 43d7928056ae..97e138cbb2a9 100644 --- a/Documentation/i2c/writing-clients +++ b/Documentation/i2c/writing-clients | |||
@@ -155,8 +155,8 @@ NOTE: If you want to write a `sensors' driver, the interface is slightly | |||
155 | 155 | ||
156 | 156 | ||
157 | 157 | ||
158 | Probing classes (i2c) | 158 | Probing classes |
159 | --------------------- | 159 | --------------- |
160 | 160 | ||
161 | All parameters are given as lists of unsigned 16-bit integers. Lists are | 161 | All parameters are given as lists of unsigned 16-bit integers. Lists are |
162 | terminated by I2C_CLIENT_END. | 162 | terminated by I2C_CLIENT_END. |
@@ -171,12 +171,18 @@ The following lists are used internally: | |||
171 | ignore: insmod parameter. | 171 | ignore: insmod parameter. |
172 | A list of pairs. The first value is a bus number (-1 for any I2C bus), | 172 | A list of pairs. The first value is a bus number (-1 for any I2C bus), |
173 | the second is the I2C address. These addresses are never probed. | 173 | the second is the I2C address. These addresses are never probed. |
174 | This parameter overrules 'normal' and 'probe', but not the 'force' lists. | 174 | This parameter overrules the 'normal_i2c' list only. |
175 | force: insmod parameter. | 175 | force: insmod parameter. |
176 | A list of pairs. The first value is a bus number (-1 for any I2C bus), | 176 | A list of pairs. The first value is a bus number (-1 for any I2C bus), |
177 | the second is the I2C address. A device is blindly assumed to be on | 177 | the second is the I2C address. A device is blindly assumed to be on |
178 | the given address, no probing is done. | 178 | the given address, no probing is done. |
179 | 179 | ||
180 | Additionally, kind-specific force lists may optionally be defined if | ||
181 | the driver supports several chip kinds. They are grouped in a | ||
182 | NULL-terminated list of pointers named forces, those first element if the | ||
183 | generic force list mentioned above. Each additional list correspond to an | ||
184 | insmod parameter of the form force_<kind>. | ||
185 | |||
180 | Fortunately, as a module writer, you just have to define the `normal_i2c' | 186 | Fortunately, as a module writer, you just have to define the `normal_i2c' |
181 | parameter. The complete declaration could look like this: | 187 | parameter. The complete declaration could look like this: |
182 | 188 | ||
@@ -186,61 +192,17 @@ parameter. The complete declaration could look like this: | |||
186 | 192 | ||
187 | /* Magic definition of all other variables and things */ | 193 | /* Magic definition of all other variables and things */ |
188 | I2C_CLIENT_INSMOD; | 194 | I2C_CLIENT_INSMOD; |
195 | /* Or, if your driver supports, say, 2 kind of devices: */ | ||
196 | I2C_CLIENT_INSMOD_2(foo, bar); | ||
197 | |||
198 | If you use the multi-kind form, an enum will be defined for you: | ||
199 | enum chips { any_chip, foo, bar, ... } | ||
200 | You can then (and certainly should) use it in the driver code. | ||
189 | 201 | ||
190 | Note that you *have* to call the defined variable `normal_i2c', | 202 | Note that you *have* to call the defined variable `normal_i2c', |
191 | without any prefix! | 203 | without any prefix! |
192 | 204 | ||
193 | 205 | ||
194 | Probing classes (sensors) | ||
195 | ------------------------- | ||
196 | |||
197 | If you write a `sensors' driver, you use a slightly different interface. | ||
198 | Also, we use a enum of chip types. Don't forget to include `sensors.h'. | ||
199 | |||
200 | The following lists are used internally. They are all lists of integers. | ||
201 | |||
202 | normal_i2c: filled in by the module writer. Terminated by I2C_CLIENT_END. | ||
203 | A list of I2C addresses which should normally be examined. | ||
204 | probe: insmod parameter. Initialize this list with I2C_CLIENT_END values. | ||
205 | A list of pairs. The first value is a bus number (ANY_I2C_BUS for any | ||
206 | I2C bus), the second is the address. These addresses are also probed, | ||
207 | as if they were in the 'normal' list. | ||
208 | ignore: insmod parameter. Initialize this list with I2C_CLIENT_END values. | ||
209 | A list of pairs. The first value is a bus number (ANY_I2C_BUS for any | ||
210 | I2C bus), the second is the I2C address. These addresses are never | ||
211 | probed. This parameter overrules 'normal' and 'probe', but not the | ||
212 | 'force' lists. | ||
213 | |||
214 | Also used is a list of pointers to sensors_force_data structures: | ||
215 | force_data: insmod parameters. A list, ending with an element of which | ||
216 | the force field is NULL. | ||
217 | Each element contains the type of chip and a list of pairs. | ||
218 | The first value is a bus number (ANY_I2C_BUS for any I2C bus), the | ||
219 | second is the address. | ||
220 | These are automatically translated to insmod variables of the form | ||
221 | force_foo. | ||
222 | |||
223 | So we have a generic insmod variabled `force', and chip-specific variables | ||
224 | `force_CHIPNAME'. | ||
225 | |||
226 | Fortunately, as a module writer, you just have to define the `normal_i2c' | ||
227 | parameter, and define what chip names are used. The complete declaration | ||
228 | could look like this: | ||
229 | /* Scan i2c addresses 0x37, and 0x48 to 0x4f */ | ||
230 | static unsigned short normal_i2c[] = { 0x37, 0x48, 0x49, 0x4a, 0x4b, 0x4c, | ||
231 | 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; | ||
232 | |||
233 | /* Define chips foo and bar, as well as all module parameters and things */ | ||
234 | SENSORS_INSMOD_2(foo,bar); | ||
235 | |||
236 | If you have one chip, you use macro SENSORS_INSMOD_1(chip), if you have 2 | ||
237 | you use macro SENSORS_INSMOD_2(chip1,chip2), etc. If you do not want to | ||
238 | bother with chip types, you can use SENSORS_INSMOD_0. | ||
239 | |||
240 | A enum is automatically defined as follows: | ||
241 | enum chips { any_chip, chip1, chip2, ... } | ||
242 | |||
243 | |||
244 | Attaching to an adapter | 206 | Attaching to an adapter |
245 | ----------------------- | 207 | ----------------------- |
246 | 208 | ||
diff --git a/drivers/hwmon/adm1021.c b/drivers/hwmon/adm1021.c index 21f6dfeb04ac..e928cdb041cb 100644 --- a/drivers/hwmon/adm1021.c +++ b/drivers/hwmon/adm1021.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/jiffies.h> | 25 | #include <linux/jiffies.h> |
26 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
27 | #include <linux/i2c-sensor.h> | ||
28 | #include <linux/hwmon.h> | 27 | #include <linux/hwmon.h> |
29 | #include <linux/err.h> | 28 | #include <linux/err.h> |
30 | 29 | ||
@@ -36,7 +35,7 @@ static unsigned short normal_i2c[] = { 0x18, 0x19, 0x1a, | |||
36 | I2C_CLIENT_END }; | 35 | I2C_CLIENT_END }; |
37 | 36 | ||
38 | /* Insmod parameters */ | 37 | /* Insmod parameters */ |
39 | SENSORS_INSMOD_8(adm1021, adm1023, max1617, max1617a, thmc10, lm84, gl523sm, mc1066); | 38 | I2C_CLIENT_INSMOD_8(adm1021, adm1023, max1617, max1617a, thmc10, lm84, gl523sm, mc1066); |
40 | 39 | ||
41 | /* adm1021 constants specified below */ | 40 | /* adm1021 constants specified below */ |
42 | 41 | ||
diff --git a/drivers/hwmon/adm1025.c b/drivers/hwmon/adm1025.c index 5b21284df2f8..229fd0de6f9e 100644 --- a/drivers/hwmon/adm1025.c +++ b/drivers/hwmon/adm1025.c | |||
@@ -50,7 +50,6 @@ | |||
50 | #include <linux/slab.h> | 50 | #include <linux/slab.h> |
51 | #include <linux/jiffies.h> | 51 | #include <linux/jiffies.h> |
52 | #include <linux/i2c.h> | 52 | #include <linux/i2c.h> |
53 | #include <linux/i2c-sensor.h> | ||
54 | #include <linux/i2c-vid.h> | 53 | #include <linux/i2c-vid.h> |
55 | #include <linux/hwmon.h> | 54 | #include <linux/hwmon.h> |
56 | #include <linux/err.h> | 55 | #include <linux/err.h> |
@@ -67,7 +66,7 @@ static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; | |||
67 | * Insmod parameters | 66 | * Insmod parameters |
68 | */ | 67 | */ |
69 | 68 | ||
70 | SENSORS_INSMOD_2(adm1025, ne1619); | 69 | I2C_CLIENT_INSMOD_2(adm1025, ne1619); |
71 | 70 | ||
72 | /* | 71 | /* |
73 | * The ADM1025 registers | 72 | * The ADM1025 registers |
diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c index f3a78f792919..f32f819efcfc 100644 --- a/drivers/hwmon/adm1026.c +++ b/drivers/hwmon/adm1026.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | #include <linux/jiffies.h> | 29 | #include <linux/jiffies.h> |
30 | #include <linux/i2c.h> | 30 | #include <linux/i2c.h> |
31 | #include <linux/i2c-sensor.h> | ||
32 | #include <linux/i2c-vid.h> | 31 | #include <linux/i2c-vid.h> |
33 | #include <linux/hwmon-sysfs.h> | 32 | #include <linux/hwmon-sysfs.h> |
34 | #include <linux/hwmon.h> | 33 | #include <linux/hwmon.h> |
@@ -38,7 +37,7 @@ | |||
38 | static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; | 37 | static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; |
39 | 38 | ||
40 | /* Insmod parameters */ | 39 | /* Insmod parameters */ |
41 | SENSORS_INSMOD_1(adm1026); | 40 | I2C_CLIENT_INSMOD_1(adm1026); |
42 | 41 | ||
43 | static int gpio_input[17] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, | 42 | static int gpio_input[17] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, |
44 | -1, -1, -1, -1, -1, -1, -1, -1 }; | 43 | -1, -1, -1, -1, -1, -1, -1, -1 }; |
diff --git a/drivers/hwmon/adm1031.c b/drivers/hwmon/adm1031.c index 9221653590a8..58338ed7c8a1 100644 --- a/drivers/hwmon/adm1031.c +++ b/drivers/hwmon/adm1031.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <linux/jiffies.h> | 27 | #include <linux/jiffies.h> |
28 | #include <linux/i2c.h> | 28 | #include <linux/i2c.h> |
29 | #include <linux/i2c-sensor.h> | ||
30 | #include <linux/hwmon.h> | 29 | #include <linux/hwmon.h> |
31 | #include <linux/err.h> | 30 | #include <linux/err.h> |
32 | 31 | ||
@@ -63,7 +62,7 @@ | |||
63 | static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; | 62 | static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; |
64 | 63 | ||
65 | /* Insmod parameters */ | 64 | /* Insmod parameters */ |
66 | SENSORS_INSMOD_2(adm1030, adm1031); | 65 | I2C_CLIENT_INSMOD_2(adm1030, adm1031); |
67 | 66 | ||
68 | typedef u8 auto_chan_table_t[8][2]; | 67 | typedef u8 auto_chan_table_t[8][2]; |
69 | 68 | ||
diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c index 6b20b28aa3b9..0a742cb88f4c 100644 --- a/drivers/hwmon/adm9240.c +++ b/drivers/hwmon/adm9240.c | |||
@@ -45,7 +45,6 @@ | |||
45 | #include <linux/module.h> | 45 | #include <linux/module.h> |
46 | #include <linux/slab.h> | 46 | #include <linux/slab.h> |
47 | #include <linux/i2c.h> | 47 | #include <linux/i2c.h> |
48 | #include <linux/i2c-sensor.h> | ||
49 | #include <linux/i2c-vid.h> | 48 | #include <linux/i2c-vid.h> |
50 | #include <linux/hwmon.h> | 49 | #include <linux/hwmon.h> |
51 | #include <linux/err.h> | 50 | #include <linux/err.h> |
@@ -55,7 +54,7 @@ static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f, | |||
55 | I2C_CLIENT_END }; | 54 | I2C_CLIENT_END }; |
56 | 55 | ||
57 | /* Insmod parameters */ | 56 | /* Insmod parameters */ |
58 | SENSORS_INSMOD_3(adm9240, ds1780, lm81); | 57 | I2C_CLIENT_INSMOD_3(adm9240, ds1780, lm81); |
59 | 58 | ||
60 | /* ADM9240 registers */ | 59 | /* ADM9240 registers */ |
61 | #define ADM9240_REG_MAN_ID 0x3e | 60 | #define ADM9240_REG_MAN_ID 0x3e |
diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c index a6c6c9d3fddd..66b0dbd1af0e 100644 --- a/drivers/hwmon/asb100.c +++ b/drivers/hwmon/asb100.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include <linux/module.h> | 39 | #include <linux/module.h> |
40 | #include <linux/slab.h> | 40 | #include <linux/slab.h> |
41 | #include <linux/i2c.h> | 41 | #include <linux/i2c.h> |
42 | #include <linux/i2c-sensor.h> | ||
43 | #include <linux/i2c-vid.h> | 42 | #include <linux/i2c-vid.h> |
44 | #include <linux/hwmon.h> | 43 | #include <linux/hwmon.h> |
45 | #include <linux/err.h> | 44 | #include <linux/err.h> |
@@ -57,7 +56,7 @@ | |||
57 | static unsigned short normal_i2c[] = { 0x2d, I2C_CLIENT_END }; | 56 | static unsigned short normal_i2c[] = { 0x2d, I2C_CLIENT_END }; |
58 | 57 | ||
59 | /* Insmod parameters */ | 58 | /* Insmod parameters */ |
60 | SENSORS_INSMOD_1(asb100); | 59 | I2C_CLIENT_INSMOD_1(asb100); |
61 | I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: " | 60 | I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: " |
62 | "{bus, clientaddr, subclientaddr1, subclientaddr2}"); | 61 | "{bus, clientaddr, subclientaddr1, subclientaddr2}"); |
63 | 62 | ||
diff --git a/drivers/hwmon/atxp1.c b/drivers/hwmon/atxp1.c index 329ddafd524b..5cf77e67a2ed 100644 --- a/drivers/hwmon/atxp1.c +++ b/drivers/hwmon/atxp1.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/jiffies.h> | 24 | #include <linux/jiffies.h> |
25 | #include <linux/i2c.h> | 25 | #include <linux/i2c.h> |
26 | #include <linux/i2c-sensor.h> | ||
27 | #include <linux/i2c-vid.h> | 26 | #include <linux/i2c-vid.h> |
28 | #include <linux/hwmon.h> | 27 | #include <linux/hwmon.h> |
29 | #include <linux/err.h> | 28 | #include <linux/err.h> |
@@ -43,7 +42,7 @@ MODULE_AUTHOR("Sebastian Witt <se.witt@gmx.net>"); | |||
43 | 42 | ||
44 | static unsigned short normal_i2c[] = { 0x37, 0x4e, I2C_CLIENT_END }; | 43 | static unsigned short normal_i2c[] = { 0x37, 0x4e, I2C_CLIENT_END }; |
45 | 44 | ||
46 | SENSORS_INSMOD_1(atxp1); | 45 | I2C_CLIENT_INSMOD_1(atxp1); |
47 | 46 | ||
48 | static int atxp1_attach_adapter(struct i2c_adapter * adapter); | 47 | static int atxp1_attach_adapter(struct i2c_adapter * adapter); |
49 | static int atxp1_detach_client(struct i2c_client * client); | 48 | static int atxp1_detach_client(struct i2c_client * client); |
diff --git a/drivers/hwmon/ds1621.c b/drivers/hwmon/ds1621.c index a3b3a5887621..b0199e063d0e 100644 --- a/drivers/hwmon/ds1621.c +++ b/drivers/hwmon/ds1621.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <linux/jiffies.h> | 27 | #include <linux/jiffies.h> |
28 | #include <linux/i2c.h> | 28 | #include <linux/i2c.h> |
29 | #include <linux/i2c-sensor.h> | ||
30 | #include <linux/hwmon.h> | 29 | #include <linux/hwmon.h> |
31 | #include <linux/err.h> | 30 | #include <linux/err.h> |
32 | #include "lm75.h" | 31 | #include "lm75.h" |
@@ -36,7 +35,7 @@ static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c, | |||
36 | 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; | 35 | 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; |
37 | 36 | ||
38 | /* Insmod parameters */ | 37 | /* Insmod parameters */ |
39 | SENSORS_INSMOD_1(ds1621); | 38 | I2C_CLIENT_INSMOD_1(ds1621); |
40 | static int polarity = -1; | 39 | static int polarity = -1; |
41 | module_param(polarity, int, 0); | 40 | module_param(polarity, int, 0); |
42 | MODULE_PARM_DESC(polarity, "Output's polarity: 0 = active high, 1 = active low"); | 41 | MODULE_PARM_DESC(polarity, "Output's polarity: 0 = active high, 1 = active low"); |
diff --git a/drivers/hwmon/fscher.c b/drivers/hwmon/fscher.c index 5629e68a5ca3..eef6061d786b 100644 --- a/drivers/hwmon/fscher.c +++ b/drivers/hwmon/fscher.c | |||
@@ -31,7 +31,6 @@ | |||
31 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
32 | #include <linux/jiffies.h> | 32 | #include <linux/jiffies.h> |
33 | #include <linux/i2c.h> | 33 | #include <linux/i2c.h> |
34 | #include <linux/i2c-sensor.h> | ||
35 | #include <linux/hwmon.h> | 34 | #include <linux/hwmon.h> |
36 | #include <linux/err.h> | 35 | #include <linux/err.h> |
37 | 36 | ||
@@ -45,7 +44,7 @@ static unsigned short normal_i2c[] = { 0x73, I2C_CLIENT_END }; | |||
45 | * Insmod parameters | 44 | * Insmod parameters |
46 | */ | 45 | */ |
47 | 46 | ||
48 | SENSORS_INSMOD_1(fscher); | 47 | I2C_CLIENT_INSMOD_1(fscher); |
49 | 48 | ||
50 | /* | 49 | /* |
51 | * The FSCHER registers | 50 | * The FSCHER registers |
diff --git a/drivers/hwmon/fscpos.c b/drivers/hwmon/fscpos.c index edc84f2f6454..5fc77a5fed07 100644 --- a/drivers/hwmon/fscpos.c +++ b/drivers/hwmon/fscpos.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
35 | #include <linux/jiffies.h> | 35 | #include <linux/jiffies.h> |
36 | #include <linux/i2c.h> | 36 | #include <linux/i2c.h> |
37 | #include <linux/i2c-sensor.h> | ||
38 | #include <linux/init.h> | 37 | #include <linux/init.h> |
39 | #include <linux/hwmon.h> | 38 | #include <linux/hwmon.h> |
40 | #include <linux/err.h> | 39 | #include <linux/err.h> |
@@ -47,7 +46,7 @@ static unsigned short normal_i2c[] = { 0x73, I2C_CLIENT_END }; | |||
47 | /* | 46 | /* |
48 | * Insmod parameters | 47 | * Insmod parameters |
49 | */ | 48 | */ |
50 | SENSORS_INSMOD_1(fscpos); | 49 | I2C_CLIENT_INSMOD_1(fscpos); |
51 | 50 | ||
52 | /* | 51 | /* |
53 | * The FSCPOS registers | 52 | * The FSCPOS registers |
diff --git a/drivers/hwmon/gl518sm.c b/drivers/hwmon/gl518sm.c index 15376a6e0494..256b9323c84b 100644 --- a/drivers/hwmon/gl518sm.c +++ b/drivers/hwmon/gl518sm.c | |||
@@ -41,7 +41,6 @@ | |||
41 | #include <linux/slab.h> | 41 | #include <linux/slab.h> |
42 | #include <linux/jiffies.h> | 42 | #include <linux/jiffies.h> |
43 | #include <linux/i2c.h> | 43 | #include <linux/i2c.h> |
44 | #include <linux/i2c-sensor.h> | ||
45 | #include <linux/hwmon.h> | 44 | #include <linux/hwmon.h> |
46 | #include <linux/err.h> | 45 | #include <linux/err.h> |
47 | 46 | ||
@@ -49,7 +48,7 @@ | |||
49 | static unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; | 48 | static unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; |
50 | 49 | ||
51 | /* Insmod parameters */ | 50 | /* Insmod parameters */ |
52 | SENSORS_INSMOD_2(gl518sm_r00, gl518sm_r80); | 51 | I2C_CLIENT_INSMOD_2(gl518sm_r00, gl518sm_r80); |
53 | 52 | ||
54 | /* Many GL518 constants specified below */ | 53 | /* Many GL518 constants specified below */ |
55 | 54 | ||
diff --git a/drivers/hwmon/gl520sm.c b/drivers/hwmon/gl520sm.c index 18539c9559c6..de6608a159c3 100644 --- a/drivers/hwmon/gl520sm.c +++ b/drivers/hwmon/gl520sm.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <linux/jiffies.h> | 27 | #include <linux/jiffies.h> |
28 | #include <linux/i2c.h> | 28 | #include <linux/i2c.h> |
29 | #include <linux/i2c-sensor.h> | ||
30 | #include <linux/i2c-vid.h> | 29 | #include <linux/i2c-vid.h> |
31 | #include <linux/hwmon.h> | 30 | #include <linux/hwmon.h> |
32 | #include <linux/err.h> | 31 | #include <linux/err.h> |
@@ -40,7 +39,7 @@ MODULE_PARM_DESC(extra_sensor_type, "Type of extra sensor (0=autodetect, 1=tempe | |||
40 | static unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; | 39 | static unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; |
41 | 40 | ||
42 | /* Insmod parameters */ | 41 | /* Insmod parameters */ |
43 | SENSORS_INSMOD_1(gl520sm); | 42 | I2C_CLIENT_INSMOD_1(gl520sm); |
44 | 43 | ||
45 | /* Many GL520 constants specified below | 44 | /* Many GL520 constants specified below |
46 | 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. |
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index d1e04c40e64c..84877665b66e 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <linux/jiffies.h> | 37 | #include <linux/jiffies.h> |
38 | #include <linux/i2c.h> | 38 | #include <linux/i2c.h> |
39 | #include <linux/i2c-isa.h> | 39 | #include <linux/i2c-isa.h> |
40 | #include <linux/i2c-sensor.h> | ||
41 | #include <linux/i2c-vid.h> | 40 | #include <linux/i2c-vid.h> |
42 | #include <linux/hwmon-sysfs.h> | 41 | #include <linux/hwmon-sysfs.h> |
43 | #include <linux/hwmon.h> | 42 | #include <linux/hwmon.h> |
@@ -51,7 +50,7 @@ static unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, | |||
51 | static unsigned short isa_address = 0x290; | 50 | static unsigned short isa_address = 0x290; |
52 | 51 | ||
53 | /* Insmod parameters */ | 52 | /* Insmod parameters */ |
54 | SENSORS_INSMOD_2(it87, it8712); | 53 | I2C_CLIENT_INSMOD_2(it87, it8712); |
55 | 54 | ||
56 | #define REG 0x2e /* The register to read/write */ | 55 | #define REG 0x2e /* The register to read/write */ |
57 | #define DEV 0x07 /* Register: Logical device select */ | 56 | #define DEV 0x07 /* Register: Logical device select */ |
diff --git a/drivers/hwmon/lm63.c b/drivers/hwmon/lm63.c index dd2702131aed..be5c7095ecbb 100644 --- a/drivers/hwmon/lm63.c +++ b/drivers/hwmon/lm63.c | |||
@@ -42,7 +42,6 @@ | |||
42 | #include <linux/slab.h> | 42 | #include <linux/slab.h> |
43 | #include <linux/jiffies.h> | 43 | #include <linux/jiffies.h> |
44 | #include <linux/i2c.h> | 44 | #include <linux/i2c.h> |
45 | #include <linux/i2c-sensor.h> | ||
46 | #include <linux/hwmon-sysfs.h> | 45 | #include <linux/hwmon-sysfs.h> |
47 | #include <linux/hwmon.h> | 46 | #include <linux/hwmon.h> |
48 | #include <linux/err.h> | 47 | #include <linux/err.h> |
@@ -58,7 +57,7 @@ static unsigned short normal_i2c[] = { 0x4c, I2C_CLIENT_END }; | |||
58 | * Insmod parameters | 57 | * Insmod parameters |
59 | */ | 58 | */ |
60 | 59 | ||
61 | SENSORS_INSMOD_1(lm63); | 60 | I2C_CLIENT_INSMOD_1(lm63); |
62 | 61 | ||
63 | /* | 62 | /* |
64 | * The LM63 registers | 63 | * The LM63 registers |
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c index bd39452db895..9a3ebdf583f4 100644 --- a/drivers/hwmon/lm75.c +++ b/drivers/hwmon/lm75.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
24 | #include <linux/jiffies.h> | 24 | #include <linux/jiffies.h> |
25 | #include <linux/i2c.h> | 25 | #include <linux/i2c.h> |
26 | #include <linux/i2c-sensor.h> | ||
27 | #include <linux/hwmon.h> | 26 | #include <linux/hwmon.h> |
28 | #include <linux/err.h> | 27 | #include <linux/err.h> |
29 | #include "lm75.h" | 28 | #include "lm75.h" |
@@ -34,7 +33,7 @@ static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c, | |||
34 | 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; | 33 | 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; |
35 | 34 | ||
36 | /* Insmod parameters */ | 35 | /* Insmod parameters */ |
37 | SENSORS_INSMOD_1(lm75); | 36 | I2C_CLIENT_INSMOD_1(lm75); |
38 | 37 | ||
39 | /* Many LM75 constants specified below */ | 38 | /* Many LM75 constants specified below */ |
40 | 39 | ||
diff --git a/drivers/hwmon/lm77.c b/drivers/hwmon/lm77.c index 52218570f874..866eab96a6f6 100644 --- a/drivers/hwmon/lm77.c +++ b/drivers/hwmon/lm77.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
31 | #include <linux/jiffies.h> | 31 | #include <linux/jiffies.h> |
32 | #include <linux/i2c.h> | 32 | #include <linux/i2c.h> |
33 | #include <linux/i2c-sensor.h> | ||
34 | #include <linux/hwmon.h> | 33 | #include <linux/hwmon.h> |
35 | #include <linux/err.h> | 34 | #include <linux/err.h> |
36 | 35 | ||
@@ -38,7 +37,7 @@ | |||
38 | static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, I2C_CLIENT_END }; | 37 | static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, I2C_CLIENT_END }; |
39 | 38 | ||
40 | /* Insmod parameters */ | 39 | /* Insmod parameters */ |
41 | SENSORS_INSMOD_1(lm77); | 40 | I2C_CLIENT_INSMOD_1(lm77); |
42 | 41 | ||
43 | /* The LM77 registers */ | 42 | /* The LM77 registers */ |
44 | #define LM77_REG_TEMP 0x00 | 43 | #define LM77_REG_TEMP 0x00 |
diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c index 008fd9310061..51c0b37c4990 100644 --- a/drivers/hwmon/lm78.c +++ b/drivers/hwmon/lm78.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/jiffies.h> | 24 | #include <linux/jiffies.h> |
25 | #include <linux/i2c.h> | 25 | #include <linux/i2c.h> |
26 | #include <linux/i2c-isa.h> | 26 | #include <linux/i2c-isa.h> |
27 | #include <linux/i2c-sensor.h> | ||
28 | #include <linux/hwmon.h> | 27 | #include <linux/hwmon.h> |
29 | #include <linux/err.h> | 28 | #include <linux/err.h> |
30 | #include <asm/io.h> | 29 | #include <asm/io.h> |
@@ -37,7 +36,7 @@ static unsigned short normal_i2c[] = { 0x20, 0x21, 0x22, 0x23, 0x24, | |||
37 | static unsigned short isa_address = 0x290; | 36 | static unsigned short isa_address = 0x290; |
38 | 37 | ||
39 | /* Insmod parameters */ | 38 | /* Insmod parameters */ |
40 | SENSORS_INSMOD_2(lm78, lm79); | 39 | I2C_CLIENT_INSMOD_2(lm78, lm79); |
41 | 40 | ||
42 | /* Many LM78 constants specified below */ | 41 | /* Many LM78 constants specified below */ |
43 | 42 | ||
diff --git a/drivers/hwmon/lm80.c b/drivers/hwmon/lm80.c index 500c38f3feae..83af8b3a0cac 100644 --- a/drivers/hwmon/lm80.c +++ b/drivers/hwmon/lm80.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <linux/jiffies.h> | 27 | #include <linux/jiffies.h> |
28 | #include <linux/i2c.h> | 28 | #include <linux/i2c.h> |
29 | #include <linux/i2c-sensor.h> | ||
30 | #include <linux/hwmon.h> | 29 | #include <linux/hwmon.h> |
31 | #include <linux/err.h> | 30 | #include <linux/err.h> |
32 | 31 | ||
@@ -35,7 +34,7 @@ static unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, | |||
35 | 0x2d, 0x2e, 0x2f, I2C_CLIENT_END }; | 34 | 0x2d, 0x2e, 0x2f, I2C_CLIENT_END }; |
36 | 35 | ||
37 | /* Insmod parameters */ | 36 | /* Insmod parameters */ |
38 | SENSORS_INSMOD_1(lm80); | 37 | I2C_CLIENT_INSMOD_1(lm80); |
39 | 38 | ||
40 | /* Many LM80 constants specified below */ | 39 | /* Many LM80 constants specified below */ |
41 | 40 | ||
diff --git a/drivers/hwmon/lm83.c b/drivers/hwmon/lm83.c index 5b78d19693e8..d74b2c20c719 100644 --- a/drivers/hwmon/lm83.c +++ b/drivers/hwmon/lm83.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
33 | #include <linux/jiffies.h> | 33 | #include <linux/jiffies.h> |
34 | #include <linux/i2c.h> | 34 | #include <linux/i2c.h> |
35 | #include <linux/i2c-sensor.h> | ||
36 | #include <linux/hwmon-sysfs.h> | 35 | #include <linux/hwmon-sysfs.h> |
37 | #include <linux/hwmon.h> | 36 | #include <linux/hwmon.h> |
38 | #include <linux/err.h> | 37 | #include <linux/err.h> |
@@ -52,7 +51,7 @@ static unsigned short normal_i2c[] = { 0x18, 0x19, 0x1a, | |||
52 | * Insmod parameters | 51 | * Insmod parameters |
53 | */ | 52 | */ |
54 | 53 | ||
55 | SENSORS_INSMOD_1(lm83); | 54 | I2C_CLIENT_INSMOD_1(lm83); |
56 | 55 | ||
57 | /* | 56 | /* |
58 | * The LM83 registers | 57 | * The LM83 registers |
diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c index 8976565113f4..aeb478815f72 100644 --- a/drivers/hwmon/lm85.c +++ b/drivers/hwmon/lm85.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | #include <linux/jiffies.h> | 29 | #include <linux/jiffies.h> |
30 | #include <linux/i2c.h> | 30 | #include <linux/i2c.h> |
31 | #include <linux/i2c-sensor.h> | ||
32 | #include <linux/i2c-vid.h> | 31 | #include <linux/i2c-vid.h> |
33 | #include <linux/hwmon.h> | 32 | #include <linux/hwmon.h> |
34 | #include <linux/err.h> | 33 | #include <linux/err.h> |
@@ -37,7 +36,7 @@ | |||
37 | static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; | 36 | static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; |
38 | 37 | ||
39 | /* Insmod parameters */ | 38 | /* Insmod parameters */ |
40 | SENSORS_INSMOD_6(lm85b, lm85c, adm1027, adt7463, emc6d100, emc6d102); | 39 | I2C_CLIENT_INSMOD_6(lm85b, lm85c, adm1027, adt7463, emc6d100, emc6d102); |
41 | 40 | ||
42 | /* The LM85 registers */ | 41 | /* The LM85 registers */ |
43 | 42 | ||
diff --git a/drivers/hwmon/lm87.c b/drivers/hwmon/lm87.c index af161203ce1d..d0d2464c1b73 100644 --- a/drivers/hwmon/lm87.c +++ b/drivers/hwmon/lm87.c | |||
@@ -57,7 +57,6 @@ | |||
57 | #include <linux/slab.h> | 57 | #include <linux/slab.h> |
58 | #include <linux/jiffies.h> | 58 | #include <linux/jiffies.h> |
59 | #include <linux/i2c.h> | 59 | #include <linux/i2c.h> |
60 | #include <linux/i2c-sensor.h> | ||
61 | #include <linux/i2c-vid.h> | 60 | #include <linux/i2c-vid.h> |
62 | #include <linux/hwmon.h> | 61 | #include <linux/hwmon.h> |
63 | #include <linux/err.h> | 62 | #include <linux/err.h> |
@@ -73,7 +72,7 @@ static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; | |||
73 | * Insmod parameters | 72 | * Insmod parameters |
74 | */ | 73 | */ |
75 | 74 | ||
76 | SENSORS_INSMOD_1(lm87); | 75 | I2C_CLIENT_INSMOD_1(lm87); |
77 | 76 | ||
78 | /* | 77 | /* |
79 | * The LM87 registers | 78 | * The LM87 registers |
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 68155c72a4e4..14de05fcd431 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c | |||
@@ -75,7 +75,6 @@ | |||
75 | #include <linux/slab.h> | 75 | #include <linux/slab.h> |
76 | #include <linux/jiffies.h> | 76 | #include <linux/jiffies.h> |
77 | #include <linux/i2c.h> | 77 | #include <linux/i2c.h> |
78 | #include <linux/i2c-sensor.h> | ||
79 | #include <linux/hwmon-sysfs.h> | 78 | #include <linux/hwmon-sysfs.h> |
80 | #include <linux/hwmon.h> | 79 | #include <linux/hwmon.h> |
81 | #include <linux/err.h> | 80 | #include <linux/err.h> |
@@ -96,7 +95,7 @@ static unsigned short normal_i2c[] = { 0x4c, 0x4d, I2C_CLIENT_END }; | |||
96 | * Insmod parameters | 95 | * Insmod parameters |
97 | */ | 96 | */ |
98 | 97 | ||
99 | SENSORS_INSMOD_6(lm90, adm1032, lm99, lm86, max6657, adt7461); | 98 | I2C_CLIENT_INSMOD_6(lm90, adm1032, lm99, lm86, max6657, adt7461); |
100 | 99 | ||
101 | /* | 100 | /* |
102 | * The LM90 registers | 101 | * The LM90 registers |
diff --git a/drivers/hwmon/lm92.c b/drivers/hwmon/lm92.c index 7ddc9116d091..647b7c7cd575 100644 --- a/drivers/hwmon/lm92.c +++ b/drivers/hwmon/lm92.c | |||
@@ -44,7 +44,6 @@ | |||
44 | #include <linux/init.h> | 44 | #include <linux/init.h> |
45 | #include <linux/slab.h> | 45 | #include <linux/slab.h> |
46 | #include <linux/i2c.h> | 46 | #include <linux/i2c.h> |
47 | #include <linux/i2c-sensor.h> | ||
48 | #include <linux/hwmon.h> | 47 | #include <linux/hwmon.h> |
49 | #include <linux/err.h> | 48 | #include <linux/err.h> |
50 | 49 | ||
@@ -54,7 +53,7 @@ static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, | |||
54 | I2C_CLIENT_END }; | 53 | I2C_CLIENT_END }; |
55 | 54 | ||
56 | /* Insmod parameters */ | 55 | /* Insmod parameters */ |
57 | SENSORS_INSMOD_1(lm92); | 56 | I2C_CLIENT_INSMOD_1(lm92); |
58 | 57 | ||
59 | /* The LM92 registers */ | 58 | /* The LM92 registers */ |
60 | #define LM92_REG_CONFIG 0x01 /* 8-bit, RW */ | 59 | #define LM92_REG_CONFIG 0x01 /* 8-bit, RW */ |
diff --git a/drivers/hwmon/max1619.c b/drivers/hwmon/max1619.c index 056506bae5f2..16bf71f3a04d 100644 --- a/drivers/hwmon/max1619.c +++ b/drivers/hwmon/max1619.c | |||
@@ -31,7 +31,6 @@ | |||
31 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
32 | #include <linux/jiffies.h> | 32 | #include <linux/jiffies.h> |
33 | #include <linux/i2c.h> | 33 | #include <linux/i2c.h> |
34 | #include <linux/i2c-sensor.h> | ||
35 | #include <linux/hwmon.h> | 34 | #include <linux/hwmon.h> |
36 | #include <linux/err.h> | 35 | #include <linux/err.h> |
37 | 36 | ||
@@ -44,7 +43,7 @@ static unsigned short normal_i2c[] = { 0x18, 0x19, 0x1a, | |||
44 | * Insmod parameters | 43 | * Insmod parameters |
45 | */ | 44 | */ |
46 | 45 | ||
47 | SENSORS_INSMOD_1(max1619); | 46 | I2C_CLIENT_INSMOD_1(max1619); |
48 | 47 | ||
49 | /* | 48 | /* |
50 | * The MAX1619 registers | 49 | * The MAX1619 registers |
diff --git a/drivers/hwmon/sis5595.c b/drivers/hwmon/sis5595.c index 55716cb579aa..8610bce08244 100644 --- a/drivers/hwmon/sis5595.c +++ b/drivers/hwmon/sis5595.c | |||
@@ -56,7 +56,6 @@ | |||
56 | #include <linux/pci.h> | 56 | #include <linux/pci.h> |
57 | #include <linux/i2c.h> | 57 | #include <linux/i2c.h> |
58 | #include <linux/i2c-isa.h> | 58 | #include <linux/i2c-isa.h> |
59 | #include <linux/i2c-sensor.h> | ||
60 | #include <linux/hwmon.h> | 59 | #include <linux/hwmon.h> |
61 | #include <linux/err.h> | 60 | #include <linux/err.h> |
62 | #include <linux/init.h> | 61 | #include <linux/init.h> |
diff --git a/drivers/hwmon/smsc47m1.c b/drivers/hwmon/smsc47m1.c index dab22bd75b68..7e699a8ede26 100644 --- a/drivers/hwmon/smsc47m1.c +++ b/drivers/hwmon/smsc47m1.c | |||
@@ -31,7 +31,6 @@ | |||
31 | #include <linux/jiffies.h> | 31 | #include <linux/jiffies.h> |
32 | #include <linux/i2c.h> | 32 | #include <linux/i2c.h> |
33 | #include <linux/i2c-isa.h> | 33 | #include <linux/i2c-isa.h> |
34 | #include <linux/i2c-sensor.h> | ||
35 | #include <linux/hwmon.h> | 34 | #include <linux/hwmon.h> |
36 | #include <linux/err.h> | 35 | #include <linux/err.h> |
37 | #include <linux/init.h> | 36 | #include <linux/init.h> |
diff --git a/drivers/hwmon/via686a.c b/drivers/hwmon/via686a.c index d9251fb0b625..eb84997627c8 100644 --- a/drivers/hwmon/via686a.c +++ b/drivers/hwmon/via686a.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <linux/jiffies.h> | 36 | #include <linux/jiffies.h> |
37 | #include <linux/i2c.h> | 37 | #include <linux/i2c.h> |
38 | #include <linux/i2c-isa.h> | 38 | #include <linux/i2c-isa.h> |
39 | #include <linux/i2c-sensor.h> | ||
40 | #include <linux/hwmon.h> | 39 | #include <linux/hwmon.h> |
41 | #include <linux/err.h> | 40 | #include <linux/err.h> |
42 | #include <linux/init.h> | 41 | #include <linux/init.h> |
diff --git a/drivers/hwmon/w83627hf.c b/drivers/hwmon/w83627hf.c index 0466cc4b760e..2d2fcfb706d7 100644 --- a/drivers/hwmon/w83627hf.c +++ b/drivers/hwmon/w83627hf.c | |||
@@ -43,7 +43,6 @@ | |||
43 | #include <linux/jiffies.h> | 43 | #include <linux/jiffies.h> |
44 | #include <linux/i2c.h> | 44 | #include <linux/i2c.h> |
45 | #include <linux/i2c-isa.h> | 45 | #include <linux/i2c-isa.h> |
46 | #include <linux/i2c-sensor.h> | ||
47 | #include <linux/i2c-vid.h> | 46 | #include <linux/i2c-vid.h> |
48 | #include <linux/hwmon.h> | 47 | #include <linux/hwmon.h> |
49 | #include <linux/err.h> | 48 | #include <linux/err.h> |
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c index f269faeffa47..47607983acfd 100644 --- a/drivers/hwmon/w83781d.c +++ b/drivers/hwmon/w83781d.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include <linux/jiffies.h> | 39 | #include <linux/jiffies.h> |
40 | #include <linux/i2c.h> | 40 | #include <linux/i2c.h> |
41 | #include <linux/i2c-isa.h> | 41 | #include <linux/i2c-isa.h> |
42 | #include <linux/i2c-sensor.h> | ||
43 | #include <linux/i2c-vid.h> | 42 | #include <linux/i2c-vid.h> |
44 | #include <linux/hwmon.h> | 43 | #include <linux/hwmon.h> |
45 | #include <linux/err.h> | 44 | #include <linux/err.h> |
@@ -53,7 +52,7 @@ static unsigned short normal_i2c[] = { 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, | |||
53 | static unsigned short isa_address = 0x290; | 52 | static unsigned short isa_address = 0x290; |
54 | 53 | ||
55 | /* Insmod parameters */ | 54 | /* Insmod parameters */ |
56 | SENSORS_INSMOD_5(w83781d, w83782d, w83783s, w83627hf, as99127f); | 55 | I2C_CLIENT_INSMOD_5(w83781d, w83782d, w83783s, w83627hf, as99127f); |
57 | I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: " | 56 | I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: " |
58 | "{bus, clientaddr, subclientaddr1, subclientaddr2}"); | 57 | "{bus, clientaddr, subclientaddr1, subclientaddr2}"); |
59 | 58 | ||
diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c index 49e3ccd84bd0..d6d8c0f04e32 100644 --- a/drivers/hwmon/w83792d.c +++ b/drivers/hwmon/w83792d.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include <linux/init.h> | 40 | #include <linux/init.h> |
41 | #include <linux/slab.h> | 41 | #include <linux/slab.h> |
42 | #include <linux/i2c.h> | 42 | #include <linux/i2c.h> |
43 | #include <linux/i2c-sensor.h> | ||
44 | #include <linux/i2c-vid.h> | 43 | #include <linux/i2c-vid.h> |
45 | #include <linux/hwmon.h> | 44 | #include <linux/hwmon.h> |
46 | #include <linux/hwmon-sysfs.h> | 45 | #include <linux/hwmon-sysfs.h> |
@@ -50,7 +49,7 @@ | |||
50 | static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f, I2C_CLIENT_END }; | 49 | static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f, I2C_CLIENT_END }; |
51 | 50 | ||
52 | /* Insmod parameters */ | 51 | /* Insmod parameters */ |
53 | SENSORS_INSMOD_1(w83792d); | 52 | I2C_CLIENT_INSMOD_1(w83792d); |
54 | I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: " | 53 | I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: " |
55 | "{bus, clientaddr, subclientaddr1, subclientaddr2}"); | 54 | "{bus, clientaddr, subclientaddr1, subclientaddr2}"); |
56 | 55 | ||
diff --git a/drivers/hwmon/w83l785ts.c b/drivers/hwmon/w83l785ts.c index 129d4012e8fd..133e34ab1d0a 100644 --- a/drivers/hwmon/w83l785ts.c +++ b/drivers/hwmon/w83l785ts.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
37 | #include <linux/jiffies.h> | 37 | #include <linux/jiffies.h> |
38 | #include <linux/i2c.h> | 38 | #include <linux/i2c.h> |
39 | #include <linux/i2c-sensor.h> | ||
40 | #include <linux/hwmon.h> | 39 | #include <linux/hwmon.h> |
41 | #include <linux/err.h> | 40 | #include <linux/err.h> |
42 | 41 | ||
@@ -54,7 +53,7 @@ static unsigned short normal_i2c[] = { 0x2e, I2C_CLIENT_END }; | |||
54 | * Insmod parameters | 53 | * Insmod parameters |
55 | */ | 54 | */ |
56 | 55 | ||
57 | SENSORS_INSMOD_1(w83l785ts); | 56 | I2C_CLIENT_INSMOD_1(w83l785ts); |
58 | 57 | ||
59 | /* | 58 | /* |
60 | * The W83L785TS-S registers | 59 | * The W83L785TS-S registers |
diff --git a/drivers/i2c/chips/ds1337.c b/drivers/i2c/chips/ds1337.c index c612f19fc7e6..9d3175c03395 100644 --- a/drivers/i2c/chips/ds1337.c +++ b/drivers/i2c/chips/ds1337.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/i2c-sensor.h> | ||
21 | #include <linux/string.h> | 20 | #include <linux/string.h> |
22 | #include <linux/rtc.h> /* get the user-level API */ | 21 | #include <linux/rtc.h> /* get the user-level API */ |
23 | #include <linux/bcd.h> | 22 | #include <linux/bcd.h> |
@@ -40,7 +39,7 @@ | |||
40 | */ | 39 | */ |
41 | static unsigned short normal_i2c[] = { 0x68, I2C_CLIENT_END }; | 40 | static unsigned short normal_i2c[] = { 0x68, I2C_CLIENT_END }; |
42 | 41 | ||
43 | SENSORS_INSMOD_1(ds1337); | 42 | I2C_CLIENT_INSMOD_1(ds1337); |
44 | 43 | ||
45 | static int ds1337_attach_adapter(struct i2c_adapter *adapter); | 44 | static int ds1337_attach_adapter(struct i2c_adapter *adapter); |
46 | static int ds1337_detect(struct i2c_adapter *adapter, int address, int kind); | 45 | static int ds1337_detect(struct i2c_adapter *adapter, int address, int kind); |
diff --git a/drivers/i2c/chips/eeprom.c b/drivers/i2c/chips/eeprom.c index befac01ecda6..a27420a54c84 100644 --- a/drivers/i2c/chips/eeprom.c +++ b/drivers/i2c/chips/eeprom.c | |||
@@ -33,14 +33,13 @@ | |||
33 | #include <linux/sched.h> | 33 | #include <linux/sched.h> |
34 | #include <linux/jiffies.h> | 34 | #include <linux/jiffies.h> |
35 | #include <linux/i2c.h> | 35 | #include <linux/i2c.h> |
36 | #include <linux/i2c-sensor.h> | ||
37 | 36 | ||
38 | /* Addresses to scan */ | 37 | /* Addresses to scan */ |
39 | static unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54, | 38 | static unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54, |
40 | 0x55, 0x56, 0x57, I2C_CLIENT_END }; | 39 | 0x55, 0x56, 0x57, I2C_CLIENT_END }; |
41 | 40 | ||
42 | /* Insmod parameters */ | 41 | /* Insmod parameters */ |
43 | SENSORS_INSMOD_1(eeprom); | 42 | I2C_CLIENT_INSMOD_1(eeprom); |
44 | 43 | ||
45 | 44 | ||
46 | /* Size of EEPROM in bytes */ | 45 | /* Size of EEPROM in bytes */ |
diff --git a/drivers/i2c/chips/max6875.c b/drivers/i2c/chips/max6875.c index 42663f921ecc..31cee2d34a17 100644 --- a/drivers/i2c/chips/max6875.c +++ b/drivers/i2c/chips/max6875.c | |||
@@ -31,14 +31,13 @@ | |||
31 | #include <linux/module.h> | 31 | #include <linux/module.h> |
32 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
33 | #include <linux/i2c.h> | 33 | #include <linux/i2c.h> |
34 | #include <linux/i2c-sensor.h> | ||
35 | #include <asm/semaphore.h> | 34 | #include <asm/semaphore.h> |
36 | 35 | ||
37 | /* Do not scan - the MAX6875 access method will write to some EEPROM chips */ | 36 | /* Do not scan - the MAX6875 access method will write to some EEPROM chips */ |
38 | static unsigned short normal_i2c[] = {I2C_CLIENT_END}; | 37 | static unsigned short normal_i2c[] = {I2C_CLIENT_END}; |
39 | 38 | ||
40 | /* Insmod parameters */ | 39 | /* Insmod parameters */ |
41 | SENSORS_INSMOD_1(max6875); | 40 | I2C_CLIENT_INSMOD_1(max6875); |
42 | 41 | ||
43 | /* The MAX6875 can only read/write 16 bytes at a time */ | 42 | /* The MAX6875 can only read/write 16 bytes at a time */ |
44 | #define SLICE_SIZE 16 | 43 | #define SLICE_SIZE 16 |
diff --git a/drivers/i2c/chips/pca9539.c b/drivers/i2c/chips/pca9539.c index c8ea2a1e1a45..225577fdda4d 100644 --- a/drivers/i2c/chips/pca9539.c +++ b/drivers/i2c/chips/pca9539.c | |||
@@ -13,13 +13,12 @@ | |||
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/i2c.h> | 14 | #include <linux/i2c.h> |
15 | #include <linux/hwmon-sysfs.h> | 15 | #include <linux/hwmon-sysfs.h> |
16 | #include <linux/i2c-sensor.h> | ||
17 | 16 | ||
18 | /* Addresses to scan */ | 17 | /* Addresses to scan */ |
19 | static unsigned short normal_i2c[] = {0x74, 0x75, 0x76, 0x77, I2C_CLIENT_END}; | 18 | static unsigned short normal_i2c[] = {0x74, 0x75, 0x76, 0x77, I2C_CLIENT_END}; |
20 | 19 | ||
21 | /* Insmod parameters */ | 20 | /* Insmod parameters */ |
22 | SENSORS_INSMOD_1(pca9539); | 21 | I2C_CLIENT_INSMOD_1(pca9539); |
23 | 22 | ||
24 | enum pca9539_cmd | 23 | enum pca9539_cmd |
25 | { | 24 | { |
diff --git a/drivers/i2c/chips/pcf8574.c b/drivers/i2c/chips/pcf8574.c index 01ec9ce19768..6525743ff9fd 100644 --- a/drivers/i2c/chips/pcf8574.c +++ b/drivers/i2c/chips/pcf8574.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include <linux/init.h> | 39 | #include <linux/init.h> |
40 | #include <linux/slab.h> | 40 | #include <linux/slab.h> |
41 | #include <linux/i2c.h> | 41 | #include <linux/i2c.h> |
42 | #include <linux/i2c-sensor.h> | ||
43 | 42 | ||
44 | /* Addresses to scan */ | 43 | /* Addresses to scan */ |
45 | static unsigned short normal_i2c[] = { 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, | 44 | static unsigned short normal_i2c[] = { 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, |
@@ -47,7 +46,7 @@ static unsigned short normal_i2c[] = { 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, | |||
47 | I2C_CLIENT_END }; | 46 | I2C_CLIENT_END }; |
48 | 47 | ||
49 | /* Insmod parameters */ | 48 | /* Insmod parameters */ |
50 | SENSORS_INSMOD_2(pcf8574, pcf8574a); | 49 | I2C_CLIENT_INSMOD_2(pcf8574, pcf8574a); |
51 | 50 | ||
52 | /* Initial values */ | 51 | /* Initial values */ |
53 | #define PCF8574_INIT 255 /* All outputs on (input mode) */ | 52 | #define PCF8574_INIT 255 /* All outputs on (input mode) */ |
diff --git a/drivers/i2c/chips/pcf8591.c b/drivers/i2c/chips/pcf8591.c index dd03f2c725c8..80f1df9a4500 100644 --- a/drivers/i2c/chips/pcf8591.c +++ b/drivers/i2c/chips/pcf8591.c | |||
@@ -24,14 +24,13 @@ | |||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
27 | #include <linux/i2c-sensor.h> | ||
28 | 27 | ||
29 | /* Addresses to scan */ | 28 | /* Addresses to scan */ |
30 | static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c, | 29 | static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c, |
31 | 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; | 30 | 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; |
32 | 31 | ||
33 | /* Insmod parameters */ | 32 | /* Insmod parameters */ |
34 | SENSORS_INSMOD_1(pcf8591); | 33 | I2C_CLIENT_INSMOD_1(pcf8591); |
35 | 34 | ||
36 | static int input_mode; | 35 | static int input_mode; |
37 | module_param(input_mode, int, 0); | 36 | module_param(input_mode, int, 0); |
diff --git a/include/linux/i2c-sensor.h b/include/linux/i2c-sensor.h deleted file mode 100644 index 1563d445dfd1..000000000000 --- a/include/linux/i2c-sensor.h +++ /dev/null | |||
@@ -1,203 +0,0 @@ | |||
1 | /* | ||
2 | i2c-sensor.h - Part of the i2c package | ||
3 | was originally sensors.h - Part of lm_sensors, Linux kernel modules | ||
4 | for hardware monitoring | ||
5 | Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl> | ||
6 | |||
7 | This program is free software; you can redistribute it and/or modify | ||
8 | it under the terms of the GNU General Public License as published by | ||
9 | the Free Software Foundation; either version 2 of the License, or | ||
10 | (at your option) any later version. | ||
11 | |||
12 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | ||
16 | |||
17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program; if not, write to the Free Software | ||
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef _LINUX_I2C_SENSOR_H | ||
23 | #define _LINUX_I2C_SENSOR_H | ||
24 | |||
25 | #include <linux/i2c.h> | ||
26 | |||
27 | #define SENSORS_MODULE_PARM_FORCE(name) \ | ||
28 | I2C_CLIENT_MODULE_PARM(force_ ## name, \ | ||
29 | "List of adapter,address pairs which are unquestionably" \ | ||
30 | " assumed to contain a `" # name "' chip") | ||
31 | |||
32 | |||
33 | /* This defines several insmod variables, and the addr_data structure */ | ||
34 | #define SENSORS_INSMOD \ | ||
35 | I2C_CLIENT_MODULE_PARM(probe, \ | ||
36 | "List of adapter,address pairs to scan additionally"); \ | ||
37 | I2C_CLIENT_MODULE_PARM(ignore, \ | ||
38 | "List of adapter,address pairs not to scan"); \ | ||
39 | static struct i2c_client_address_data addr_data = { \ | ||
40 | .normal_i2c = normal_i2c, \ | ||
41 | .probe = probe, \ | ||
42 | .ignore = ignore, \ | ||
43 | .forces = forces, \ | ||
44 | } | ||
45 | |||
46 | /* The following functions create an enum with the chip names as elements. | ||
47 | The first element of the enum is any_chip. These are the only macros | ||
48 | a module will want to use. */ | ||
49 | |||
50 | #define SENSORS_INSMOD_0 \ | ||
51 | enum chips { any_chip }; \ | ||
52 | I2C_CLIENT_MODULE_PARM(force, \ | ||
53 | "List of adapter,address pairs to boldly assume " \ | ||
54 | "to be present"); \ | ||
55 | static unsigned short *forces[] = { force, \ | ||
56 | NULL }; \ | ||
57 | SENSORS_INSMOD | ||
58 | |||
59 | #define SENSORS_INSMOD_1(chip1) \ | ||
60 | enum chips { any_chip, chip1 }; \ | ||
61 | I2C_CLIENT_MODULE_PARM(force, \ | ||
62 | "List of adapter,address pairs to boldly assume " \ | ||
63 | "to be present"); \ | ||
64 | SENSORS_MODULE_PARM_FORCE(chip1); \ | ||
65 | static unsigned short *forces[] = { force, \ | ||
66 | force_##chip1, \ | ||
67 | NULL }; \ | ||
68 | SENSORS_INSMOD | ||
69 | |||
70 | #define SENSORS_INSMOD_2(chip1,chip2) \ | ||
71 | enum chips { any_chip, chip1, chip2 }; \ | ||
72 | I2C_CLIENT_MODULE_PARM(force, \ | ||
73 | "List of adapter,address pairs to boldly assume " \ | ||
74 | "to be present"); \ | ||
75 | SENSORS_MODULE_PARM_FORCE(chip1); \ | ||
76 | SENSORS_MODULE_PARM_FORCE(chip2); \ | ||
77 | static unsigned short *forces[] = { force, \ | ||
78 | force_##chip1, \ | ||
79 | force_##chip2, \ | ||
80 | NULL }; \ | ||
81 | SENSORS_INSMOD | ||
82 | |||
83 | #define SENSORS_INSMOD_3(chip1,chip2,chip3) \ | ||
84 | enum chips { any_chip, chip1, chip2, chip3 }; \ | ||
85 | I2C_CLIENT_MODULE_PARM(force, \ | ||
86 | "List of adapter,address pairs to boldly assume " \ | ||
87 | "to be present"); \ | ||
88 | SENSORS_MODULE_PARM_FORCE(chip1); \ | ||
89 | SENSORS_MODULE_PARM_FORCE(chip2); \ | ||
90 | SENSORS_MODULE_PARM_FORCE(chip3); \ | ||
91 | static unsigned short *forces[] = { force, \ | ||
92 | force_##chip1, \ | ||
93 | force_##chip2, \ | ||
94 | force_##chip3, \ | ||
95 | NULL }; \ | ||
96 | SENSORS_INSMOD | ||
97 | |||
98 | #define SENSORS_INSMOD_4(chip1,chip2,chip3,chip4) \ | ||
99 | enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ | ||
100 | I2C_CLIENT_MODULE_PARM(force, \ | ||
101 | "List of adapter,address pairs to boldly assume " \ | ||
102 | "to be present"); \ | ||
103 | SENSORS_MODULE_PARM_FORCE(chip1); \ | ||
104 | SENSORS_MODULE_PARM_FORCE(chip2); \ | ||
105 | SENSORS_MODULE_PARM_FORCE(chip3); \ | ||
106 | SENSORS_MODULE_PARM_FORCE(chip4); \ | ||
107 | static unsigned short *forces[] = { force, \ | ||
108 | force_##chip1, \ | ||
109 | force_##chip2, \ | ||
110 | force_##chip3, \ | ||
111 | force_##chip4, \ | ||
112 | NULL}; \ | ||
113 | SENSORS_INSMOD | ||
114 | |||
115 | #define SENSORS_INSMOD_5(chip1,chip2,chip3,chip4,chip5) \ | ||
116 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ | ||
117 | I2C_CLIENT_MODULE_PARM(force, \ | ||
118 | "List of adapter,address pairs to boldly assume " \ | ||
119 | "to be present"); \ | ||
120 | SENSORS_MODULE_PARM_FORCE(chip1); \ | ||
121 | SENSORS_MODULE_PARM_FORCE(chip2); \ | ||
122 | SENSORS_MODULE_PARM_FORCE(chip3); \ | ||
123 | SENSORS_MODULE_PARM_FORCE(chip4); \ | ||
124 | SENSORS_MODULE_PARM_FORCE(chip5); \ | ||
125 | static unsigned short *forces[] = { force, \ | ||
126 | force_##chip1, \ | ||
127 | force_##chip2, \ | ||
128 | force_##chip3, \ | ||
129 | force_##chip4, \ | ||
130 | force_##chip5, \ | ||
131 | NULL }; \ | ||
132 | SENSORS_INSMOD | ||
133 | |||
134 | #define SENSORS_INSMOD_6(chip1,chip2,chip3,chip4,chip5,chip6) \ | ||
135 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ | ||
136 | I2C_CLIENT_MODULE_PARM(force, \ | ||
137 | "List of adapter,address pairs to boldly assume " \ | ||
138 | "to be present"); \ | ||
139 | SENSORS_MODULE_PARM_FORCE(chip1); \ | ||
140 | SENSORS_MODULE_PARM_FORCE(chip2); \ | ||
141 | SENSORS_MODULE_PARM_FORCE(chip3); \ | ||
142 | SENSORS_MODULE_PARM_FORCE(chip4); \ | ||
143 | SENSORS_MODULE_PARM_FORCE(chip5); \ | ||
144 | SENSORS_MODULE_PARM_FORCE(chip6); \ | ||
145 | static unsigned short *forces[] = { force, \ | ||
146 | force_##chip1, \ | ||
147 | force_##chip2, \ | ||
148 | force_##chip3, \ | ||
149 | force_##chip4, \ | ||
150 | force_##chip5, \ | ||
151 | force_##chip6, \ | ||
152 | NULL }; \ | ||
153 | SENSORS_INSMOD | ||
154 | |||
155 | #define SENSORS_INSMOD_7(chip1,chip2,chip3,chip4,chip5,chip6,chip7) \ | ||
156 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, chip7 }; \ | ||
157 | I2C_CLIENT_MODULE_PARM(force, \ | ||
158 | "List of adapter,address pairs to boldly assume " \ | ||
159 | "to be present"); \ | ||
160 | SENSORS_MODULE_PARM_FORCE(chip1); \ | ||
161 | SENSORS_MODULE_PARM_FORCE(chip2); \ | ||
162 | SENSORS_MODULE_PARM_FORCE(chip3); \ | ||
163 | SENSORS_MODULE_PARM_FORCE(chip4); \ | ||
164 | SENSORS_MODULE_PARM_FORCE(chip5); \ | ||
165 | SENSORS_MODULE_PARM_FORCE(chip6); \ | ||
166 | SENSORS_MODULE_PARM_FORCE(chip7); \ | ||
167 | static unsigned short *forces[] = { force, \ | ||
168 | force_##chip1, \ | ||
169 | force_##chip2, \ | ||
170 | force_##chip3, \ | ||
171 | force_##chip4, \ | ||
172 | force_##chip5, \ | ||
173 | force_##chip6, \ | ||
174 | force_##chip7, \ | ||
175 | NULL }; \ | ||
176 | SENSORS_INSMOD | ||
177 | |||
178 | #define SENSORS_INSMOD_8(chip1,chip2,chip3,chip4,chip5,chip6,chip7,chip8) \ | ||
179 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8 }; \ | ||
180 | I2C_CLIENT_MODULE_PARM(force, \ | ||
181 | "List of adapter,address pairs to boldly assume " \ | ||
182 | "to be present"); \ | ||
183 | SENSORS_MODULE_PARM_FORCE(chip1); \ | ||
184 | SENSORS_MODULE_PARM_FORCE(chip2); \ | ||
185 | SENSORS_MODULE_PARM_FORCE(chip3); \ | ||
186 | SENSORS_MODULE_PARM_FORCE(chip4); \ | ||
187 | SENSORS_MODULE_PARM_FORCE(chip5); \ | ||
188 | SENSORS_MODULE_PARM_FORCE(chip6); \ | ||
189 | SENSORS_MODULE_PARM_FORCE(chip7); \ | ||
190 | SENSORS_MODULE_PARM_FORCE(chip8); \ | ||
191 | static unsigned short *forces[] = { force, \ | ||
192 | force_##chip1, \ | ||
193 | force_##chip2, \ | ||
194 | force_##chip3, \ | ||
195 | force_##chip4, \ | ||
196 | force_##chip5, \ | ||
197 | force_##chip6, \ | ||
198 | force_##chip7, \ | ||
199 | force_##chip8, \ | ||
200 | NULL }; \ | ||
201 | SENSORS_INSMOD | ||
202 | |||
203 | #endif /* def _LINUX_I2C_SENSOR_H */ | ||
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 9419bc5584ad..3ad3969b6f0d 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -565,24 +565,148 @@ union i2c_smbus_data { | |||
565 | module_param_array(var, short, &var##_num, 0); \ | 565 | module_param_array(var, short, &var##_num, 0); \ |
566 | MODULE_PARM_DESC(var,desc) | 566 | MODULE_PARM_DESC(var,desc) |
567 | 567 | ||
568 | /* This is the one you want to use in your own modules */ | 568 | #define I2C_CLIENT_MODULE_PARM_FORCE(name) \ |
569 | I2C_CLIENT_MODULE_PARM(force_##name, \ | ||
570 | "List of adapter,address pairs which are " \ | ||
571 | "unquestionably assumed to contain a `" \ | ||
572 | # name "' chip") | ||
573 | |||
574 | |||
575 | #define I2C_CLIENT_INSMOD_COMMON \ | ||
576 | I2C_CLIENT_MODULE_PARM(probe, "List of adapter,address pairs to scan " \ | ||
577 | "additionally"); \ | ||
578 | I2C_CLIENT_MODULE_PARM(ignore, "List of adapter,address pairs not to " \ | ||
579 | "scan"); \ | ||
580 | static struct i2c_client_address_data addr_data = { \ | ||
581 | .normal_i2c = normal_i2c, \ | ||
582 | .probe = probe, \ | ||
583 | .ignore = ignore, \ | ||
584 | .forces = forces, \ | ||
585 | } | ||
586 | |||
587 | /* These are the ones you want to use in your own drivers. Pick the one | ||
588 | which matches the number of devices the driver differenciates between. */ | ||
569 | #define I2C_CLIENT_INSMOD \ | 589 | #define I2C_CLIENT_INSMOD \ |
570 | I2C_CLIENT_MODULE_PARM(probe, \ | ||
571 | "List of adapter,address pairs to scan additionally"); \ | ||
572 | I2C_CLIENT_MODULE_PARM(ignore, \ | ||
573 | "List of adapter,address pairs not to scan"); \ | ||
574 | I2C_CLIENT_MODULE_PARM(force, \ | 590 | I2C_CLIENT_MODULE_PARM(force, \ |
575 | "List of adapter,address pairs to boldly assume " \ | 591 | "List of adapter,address pairs to boldly assume " \ |
576 | "to be present"); \ | 592 | "to be present"); \ |
577 | static unsigned short *addr_forces[] = { \ | 593 | static unsigned short *forces[] = { \ |
578 | force, \ | 594 | force, \ |
579 | NULL \ | 595 | NULL \ |
580 | }; \ | 596 | }; \ |
581 | static struct i2c_client_address_data addr_data = { \ | 597 | I2C_CLIENT_INSMOD_COMMON |
582 | .normal_i2c = normal_i2c, \ | 598 | |
583 | .probe = probe, \ | 599 | #define I2C_CLIENT_INSMOD_1(chip1) \ |
584 | .ignore = ignore, \ | 600 | enum chips { any_chip, chip1 }; \ |
585 | .forces = addr_forces, \ | 601 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ |
586 | } | 602 | "boldly assume to be present"); \ |
603 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
604 | static unsigned short *forces[] = { force, force_##chip1, NULL }; \ | ||
605 | I2C_CLIENT_INSMOD_COMMON | ||
606 | |||
607 | #define I2C_CLIENT_INSMOD_2(chip1, chip2) \ | ||
608 | enum chips { any_chip, chip1, chip2 }; \ | ||
609 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | ||
610 | "boldly assume to be present"); \ | ||
611 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
612 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
613 | static unsigned short *forces[] = { force, force_##chip1, \ | ||
614 | force_##chip2, NULL }; \ | ||
615 | I2C_CLIENT_INSMOD_COMMON | ||
616 | |||
617 | #define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \ | ||
618 | enum chips { any_chip, chip1, chip2, chip3 }; \ | ||
619 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | ||
620 | "boldly assume to be present"); \ | ||
621 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
622 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
623 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
624 | static unsigned short *forces[] = { force, force_##chip1, \ | ||
625 | force_##chip2, force_##chip3, \ | ||
626 | NULL }; \ | ||
627 | I2C_CLIENT_INSMOD_COMMON | ||
628 | |||
629 | #define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \ | ||
630 | enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ | ||
631 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | ||
632 | "boldly assume to be present"); \ | ||
633 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
634 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
635 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
636 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
637 | static unsigned short *forces[] = { force, force_##chip1, \ | ||
638 | force_##chip2, force_##chip3, \ | ||
639 | force_##chip4, NULL}; \ | ||
640 | I2C_CLIENT_INSMOD_COMMON | ||
641 | |||
642 | #define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \ | ||
643 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ | ||
644 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | ||
645 | "boldly assume to be present"); \ | ||
646 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
647 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
648 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
649 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
650 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | ||
651 | static unsigned short *forces[] = { force, force_##chip1, \ | ||
652 | force_##chip2, force_##chip3, \ | ||
653 | force_##chip4, force_##chip5, \ | ||
654 | NULL }; \ | ||
655 | I2C_CLIENT_INSMOD_COMMON | ||
656 | |||
657 | #define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \ | ||
658 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ | ||
659 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | ||
660 | "boldly assume to be present"); \ | ||
661 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
662 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
663 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
664 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
665 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | ||
666 | I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ | ||
667 | static unsigned short *forces[] = { force, force_##chip1, \ | ||
668 | force_##chip2, force_##chip3, \ | ||
669 | force_##chip4, force_##chip5, \ | ||
670 | force_##chip6, NULL }; \ | ||
671 | I2C_CLIENT_INSMOD_COMMON | ||
672 | |||
673 | #define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \ | ||
674 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ | ||
675 | chip7 }; \ | ||
676 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | ||
677 | "boldly assume to be present"); \ | ||
678 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
679 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
680 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
681 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
682 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | ||
683 | I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ | ||
684 | I2C_CLIENT_MODULE_PARM_FORCE(chip7); \ | ||
685 | static unsigned short *forces[] = { force, force_##chip1, \ | ||
686 | force_##chip2, force_##chip3, \ | ||
687 | force_##chip4, force_##chip5, \ | ||
688 | force_##chip6, force_##chip7, \ | ||
689 | NULL }; \ | ||
690 | I2C_CLIENT_INSMOD_COMMON | ||
691 | |||
692 | #define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \ | ||
693 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ | ||
694 | chip7, chip8 }; \ | ||
695 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | ||
696 | "boldly assume to be present"); \ | ||
697 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
698 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
699 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
700 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
701 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | ||
702 | I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ | ||
703 | I2C_CLIENT_MODULE_PARM_FORCE(chip7); \ | ||
704 | I2C_CLIENT_MODULE_PARM_FORCE(chip8); \ | ||
705 | static unsigned short *forces[] = { force, force_##chip1, \ | ||
706 | force_##chip2, force_##chip3, \ | ||
707 | force_##chip4, force_##chip5, \ | ||
708 | force_##chip6, force_##chip7, \ | ||
709 | force_##chip8, NULL }; \ | ||
710 | I2C_CLIENT_INSMOD_COMMON | ||
587 | 711 | ||
588 | #endif /* _LINUX_I2C_H */ | 712 | #endif /* _LINUX_I2C_H */ |