Commit 5071860aba7fc69279ab822638ed2c2e4549f9fd
Committed by
Greg Kroah-Hartman
1 parent
4926c0d4de
Exists in
master
and in
7 other branches
[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (7/9)
Kill normal_isa in header files, documentation and all chip drivers, as it is no more used. normal_i2c could be renamed to normal, but I decided not to do so at the moment, so as to limit the number of changes. This might be done later as part of the i2c_probe/i2c_detect merge. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 36 changed files with 36 additions and 85 deletions Side-by-side Diff
- Documentation/i2c/porting-clients
- Documentation/i2c/writing-clients
- drivers/hwmon/adm1021.c
- drivers/hwmon/adm1025.c
- drivers/hwmon/adm1026.c
- drivers/hwmon/adm1031.c
- drivers/hwmon/adm9240.c
- drivers/hwmon/asb100.c
- drivers/hwmon/atxp1.c
- drivers/hwmon/ds1621.c
- drivers/hwmon/fscher.c
- drivers/hwmon/fscpos.c
- drivers/hwmon/gl518sm.c
- drivers/hwmon/gl520sm.c
- drivers/hwmon/it87.c
- drivers/hwmon/lm63.c
- drivers/hwmon/lm75.c
- drivers/hwmon/lm77.c
- drivers/hwmon/lm78.c
- drivers/hwmon/lm80.c
- drivers/hwmon/lm83.c
- drivers/hwmon/lm85.c
- drivers/hwmon/lm87.c
- drivers/hwmon/lm90.c
- drivers/hwmon/lm92.c
- drivers/hwmon/max1619.c
- drivers/hwmon/w83781d.c
- drivers/hwmon/w83l785ts.c
- drivers/i2c/chips/ds1337.c
- drivers/i2c/chips/eeprom.c
- drivers/i2c/chips/max6875.c
- drivers/i2c/chips/pca9539.c
- drivers/i2c/chips/pcf8574.c
- drivers/i2c/chips/pcf8591.c
- include/linux/i2c-sensor.h
- include/linux/i2c.h
Documentation/i2c/porting-clients
... | ... | @@ -29,8 +29,8 @@ |
29 | 29 | Please respect this inclusion order. Some extra headers may be |
30 | 30 | required for a given driver (e.g. "lm75.h"). |
31 | 31 | |
32 | -* [Addresses] SENSORS_I2C_END becomes I2C_CLIENT_END, SENSORS_ISA_END | |
33 | - becomes I2C_CLIENT_ISA_END. | |
32 | +* [Addresses] SENSORS_I2C_END becomes I2C_CLIENT_END, ISA addresses | |
33 | + are no more handled by the i2c core. | |
34 | 34 | |
35 | 35 | * [Client data] Get rid of sysctl_id. Try using standard names for |
36 | 36 | register values (for example, temp_os becomes temp_max). You're |
... | ... | @@ -72,7 +72,8 @@ |
72 | 72 | name string, which will be filled with a lowercase, short string |
73 | 73 | (typically the driver name, e.g. "lm75"). |
74 | 74 | In i2c-only drivers, drop the i2c_is_isa_adapter check, it's |
75 | - useless. | |
75 | + useless. Same for isa-only drivers, as the test would always be | |
76 | + true. Only hybrid drivers (which are quite rare) still need it. | |
76 | 77 | The errorN labels are reduced to the number needed. If that number |
77 | 78 | is 2 (i2c-only drivers), it is advised that the labels are named |
78 | 79 | exit and exit_free. For i2c+isa drivers, labels should be named |
Documentation/i2c/writing-clients
... | ... | @@ -195,31 +195,28 @@ |
195 | 195 | ------------------------- |
196 | 196 | |
197 | 197 | If you write a `sensors' driver, you use a slightly different interface. |
198 | -As well as I2C addresses, we have to cope with ISA addresses. Also, we | |
199 | -use a enum of chip types. Don't forget to include `sensors.h'. | |
198 | +Also, we use a enum of chip types. Don't forget to include `sensors.h'. | |
200 | 199 | |
201 | 200 | The following lists are used internally. They are all lists of integers. |
202 | 201 | |
203 | - normal_i2c: filled in by the module writer. Terminated by SENSORS_I2C_END. | |
202 | + normal_i2c: filled in by the module writer. Terminated by I2C_CLIENT_END. | |
204 | 203 | A list of I2C addresses which should normally be examined. |
205 | - normal_isa: filled in by the module writer. Terminated by SENSORS_ISA_END. | |
206 | - A list of ISA addresses which should normally be examined. | |
207 | - probe: insmod parameter. Initialize this list with SENSORS_I2C_END values. | |
208 | - A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for | |
209 | - the ISA bus, -1 for any I2C bus), the second is the address. These | |
210 | - addresses are also probed, as if they were in the 'normal' list. | |
211 | - ignore: insmod parameter. Initialize this list with SENSORS_I2C_END values. | |
212 | - A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for | |
213 | - the ISA bus, -1 for any I2C bus), the second is the I2C address. These | |
214 | - addresses are never probed. This parameter overrules 'normal' and | |
215 | - 'probe', but not the 'force' lists. | |
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. | |
216 | 213 | |
217 | 214 | Also used is a list of pointers to sensors_force_data structures: |
218 | 215 | force_data: insmod parameters. A list, ending with an element of which |
219 | 216 | the force field is NULL. |
220 | 217 | Each element contains the type of chip and a list of pairs. |
221 | - The first value is a bus number (SENSORS_ISA_BUS for the ISA bus, | |
222 | - -1 for any I2C bus), the second is the address. | |
218 | + The first value is a bus number (ANY_I2C_BUS for any I2C bus), the | |
219 | + second is the address. | |
223 | 220 | These are automatically translated to insmod variables of the form |
224 | 221 | force_foo. |
225 | 222 | |
226 | 223 | |
... | ... | @@ -227,13 +224,11 @@ |
227 | 224 | `force_CHIPNAME'. |
228 | 225 | |
229 | 226 | Fortunately, as a module writer, you just have to define the `normal_i2c' |
230 | -and `normal_isa' parameters, and define what chip names are used. | |
231 | -The complete declaration could look like this: | |
227 | +parameter, and define what chip names are used. The complete declaration | |
228 | +could look like this: | |
232 | 229 | /* Scan i2c addresses 0x37, and 0x48 to 0x4f */ |
233 | 230 | static unsigned short normal_i2c[] = { 0x37, 0x48, 0x49, 0x4a, 0x4b, 0x4c, |
234 | 231 | 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; |
235 | - /* Scan ISA address 0x290 */ | |
236 | - static unsigned int normal_isa[] = {0x0290,SENSORS_ISA_END}; | |
237 | 232 | |
238 | 233 | /* Define chips foo and bar, as well as all module parameters and things */ |
239 | 234 | SENSORS_INSMOD_2(foo,bar); |
drivers/hwmon/adm1021.c
drivers/hwmon/adm1025.c
drivers/hwmon/adm1026.c
drivers/hwmon/adm1031.c
drivers/hwmon/adm9240.c
drivers/hwmon/asb100.c
... | ... | @@ -56,9 +56,6 @@ |
56 | 56 | /* I2C addresses to scan */ |
57 | 57 | static unsigned short normal_i2c[] = { 0x2d, I2C_CLIENT_END }; |
58 | 58 | |
59 | -/* ISA addresses to scan (none) */ | |
60 | -static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END }; | |
61 | - | |
62 | 59 | /* Insmod parameters */ |
63 | 60 | SENSORS_INSMOD_1(asb100); |
64 | 61 | I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: " |
drivers/hwmon/atxp1.c
drivers/hwmon/ds1621.c
... | ... | @@ -34,7 +34,6 @@ |
34 | 34 | /* Addresses to scan */ |
35 | 35 | static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c, |
36 | 36 | 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; |
37 | -static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END }; | |
38 | 37 | |
39 | 38 | /* Insmod parameters */ |
40 | 39 | SENSORS_INSMOD_1(ds1621); |
drivers/hwmon/fscher.c
drivers/hwmon/fscpos.c
drivers/hwmon/gl518sm.c
drivers/hwmon/gl520sm.c
drivers/hwmon/it87.c
... | ... | @@ -48,7 +48,6 @@ |
48 | 48 | /* Addresses to scan */ |
49 | 49 | static unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, |
50 | 50 | 0x2e, 0x2f, I2C_CLIENT_END }; |
51 | -static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END }; | |
52 | 51 | static unsigned short isa_address = 0x290; |
53 | 52 | |
54 | 53 | /* Insmod parameters */ |
drivers/hwmon/lm63.c
drivers/hwmon/lm75.c
... | ... | @@ -32,7 +32,6 @@ |
32 | 32 | /* Addresses to scan */ |
33 | 33 | static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c, |
34 | 34 | 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; |
35 | -static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END }; | |
36 | 35 | |
37 | 36 | /* Insmod parameters */ |
38 | 37 | SENSORS_INSMOD_1(lm75); |
drivers/hwmon/lm77.c
drivers/hwmon/lm78.c
drivers/hwmon/lm80.c
... | ... | @@ -33,7 +33,6 @@ |
33 | 33 | /* Addresses to scan */ |
34 | 34 | static unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, |
35 | 35 | 0x2d, 0x2e, 0x2f, I2C_CLIENT_END }; |
36 | -static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END }; | |
37 | 36 | |
38 | 37 | /* Insmod parameters */ |
39 | 38 | SENSORS_INSMOD_1(lm80); |
drivers/hwmon/lm83.c
drivers/hwmon/lm85.c
... | ... | @@ -35,7 +35,6 @@ |
35 | 35 | |
36 | 36 | /* Addresses to scan */ |
37 | 37 | static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; |
38 | -static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END }; | |
39 | 38 | |
40 | 39 | /* Insmod parameters */ |
41 | 40 | SENSORS_INSMOD_6(lm85b, lm85c, adm1027, adt7463, emc6d100, emc6d102); |
drivers/hwmon/lm87.c
drivers/hwmon/lm90.c
drivers/hwmon/lm92.c
drivers/hwmon/max1619.c
drivers/hwmon/w83781d.c
... | ... | @@ -50,7 +50,6 @@ |
50 | 50 | static unsigned short normal_i2c[] = { 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, |
51 | 51 | 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, |
52 | 52 | 0x2c, 0x2d, 0x2e, 0x2f, I2C_CLIENT_END }; |
53 | -static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END }; | |
54 | 53 | static unsigned short isa_address = 0x290; |
55 | 54 | |
56 | 55 | /* Insmod parameters */ |
drivers/hwmon/w83l785ts.c
drivers/i2c/chips/ds1337.c
drivers/i2c/chips/eeprom.c
... | ... | @@ -38,7 +38,6 @@ |
38 | 38 | /* Addresses to scan */ |
39 | 39 | static unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54, |
40 | 40 | 0x55, 0x56, 0x57, I2C_CLIENT_END }; |
41 | -static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END }; | |
42 | 41 | |
43 | 42 | /* Insmod parameters */ |
44 | 43 | SENSORS_INSMOD_1(eeprom); |
drivers/i2c/chips/max6875.c
... | ... | @@ -36,7 +36,6 @@ |
36 | 36 | |
37 | 37 | /* Do not scan - the MAX6875 access method will write to some EEPROM chips */ |
38 | 38 | static unsigned short normal_i2c[] = {I2C_CLIENT_END}; |
39 | -static unsigned int normal_isa[] = {I2C_CLIENT_ISA_END}; | |
40 | 39 | |
41 | 40 | /* Insmod parameters */ |
42 | 41 | SENSORS_INSMOD_1(max6875); |
drivers/i2c/chips/pca9539.c
drivers/i2c/chips/pcf8574.c
... | ... | @@ -45,7 +45,6 @@ |
45 | 45 | static unsigned short normal_i2c[] = { 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, |
46 | 46 | 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, |
47 | 47 | I2C_CLIENT_END }; |
48 | -static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END }; | |
49 | 48 | |
50 | 49 | /* Insmod parameters */ |
51 | 50 | SENSORS_INSMOD_2(pcf8574, pcf8574a); |
drivers/i2c/chips/pcf8591.c
... | ... | @@ -29,7 +29,6 @@ |
29 | 29 | /* Addresses to scan */ |
30 | 30 | static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c, |
31 | 31 | 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; |
32 | -static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END }; | |
33 | 32 | |
34 | 33 | /* Insmod parameters */ |
35 | 34 | SENSORS_INSMOD_1(pcf8591); |
include/linux/i2c-sensor.h
... | ... | @@ -27,11 +27,10 @@ |
27 | 27 | that place. If a specific chip is given, the module blindly assumes this |
28 | 28 | chip type is present; if a general force (kind == 0) is given, the module |
29 | 29 | will still try to figure out what type of chip is present. This is useful |
30 | - if for some reasons the detect for SMBus or ISA address space filled | |
31 | - fails. | |
32 | - probe: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values. | |
33 | - A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for | |
34 | - the ISA bus, -1 for any I2C bus), the second is the address. | |
30 | + if for some reasons the detect for SMBus address space filled fails. | |
31 | + probe: insmod parameter. Initialize this list with I2C_CLIENT_END values. | |
32 | + A list of pairs. The first value is a bus number (ANY_I2C_BUS for any | |
33 | + I2C bus), the second is the address. | |
35 | 34 | kind: The kind of chip. 0 equals any chip. |
36 | 35 | */ |
37 | 36 | struct i2c_force_data { |
38 | 37 | |
39 | 38 | |
... | ... | @@ -40,25 +39,22 @@ |
40 | 39 | }; |
41 | 40 | |
42 | 41 | /* A structure containing the detect information. |
43 | - normal_i2c: filled in by the module writer. Terminated by I2C_CLIENT_ISA_END. | |
42 | + normal_i2c: filled in by the module writer. Terminated by I2C_CLIENT_END. | |
44 | 43 | A list of I2C addresses which should normally be examined. |
45 | - normal_isa: filled in by the module writer. Terminated by SENSORS_ISA_END. | |
46 | - A list of ISA addresses which should normally be examined. | |
47 | - probe: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values. | |
48 | - A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for | |
49 | - the ISA bus, -1 for any I2C bus), the second is the address. These | |
50 | - addresses are also probed, as if they were in the 'normal' list. | |
51 | - ignore: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values. | |
52 | - A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for | |
53 | - the ISA bus, -1 for any I2C bus), the second is the I2C address. These | |
54 | - addresses are never probed. This parameter overrules 'normal' and | |
55 | - 'probe', but not the 'force' lists. | |
44 | + probe: insmod parameter. Initialize this list with I2C_CLIENT_END values. | |
45 | + A list of pairs. The first value is a bus number (ANY_I2C_BUS for any | |
46 | + I2C bus), the second is the address. These addresses are also probed, | |
47 | + as if they were in the 'normal' list. | |
48 | + ignore: insmod parameter. Initialize this list with I2C_CLIENT_END values. | |
49 | + A list of pairs. The first value is a bus number (ANY_I2C_BUS for any | |
50 | + I2C bus), the second is the I2C address. These addresses are never | |
51 | + probed. This parameter overrules 'normal' and probe', but not the | |
52 | + 'force' lists. | |
56 | 53 | force_data: insmod parameters. A list, ending with an element of which |
57 | 54 | the force field is NULL. |
58 | 55 | */ |
59 | 56 | struct i2c_address_data { |
60 | 57 | unsigned short *normal_i2c; |
61 | - unsigned int *normal_isa; | |
62 | 58 | unsigned short *probe; |
63 | 59 | unsigned short *ignore; |
64 | 60 | struct i2c_force_data *forces; |
... | ... | @@ -78,7 +74,6 @@ |
78 | 74 | "List of adapter,address pairs not to scan"); \ |
79 | 75 | static struct i2c_address_data addr_data = { \ |
80 | 76 | .normal_i2c = normal_i2c, \ |
81 | - .normal_isa = normal_isa, \ | |
82 | 77 | .probe = probe, \ |
83 | 78 | .ignore = ignore, \ |
84 | 79 | .forces = forces, \ |
... | ... | @@ -242,8 +237,7 @@ |
242 | 237 | |
243 | 238 | /* Detect function. It iterates over all possible addresses itself. For |
244 | 239 | SMBus addresses, it will only call found_proc if some client is connected |
245 | - to the SMBus (unless a 'force' matched); for ISA detections, this is not | |
246 | - done. */ | |
240 | + to the SMBus (unless a 'force' matched). */ | |
247 | 241 | extern int i2c_detect(struct i2c_adapter *adapter, |
248 | 242 | struct i2c_address_data *address_data, |
249 | 243 | int (*found_proc) (struct i2c_adapter *, int, int)); |
include/linux/i2c.h
... | ... | @@ -150,12 +150,9 @@ |
150 | 150 | */ |
151 | 151 | struct i2c_client { |
152 | 152 | unsigned int flags; /* div., see below */ |
153 | - unsigned int addr; /* chip address - NOTE: 7bit */ | |
153 | + unsigned short addr; /* chip address - NOTE: 7bit */ | |
154 | 154 | /* addresses are stored in the */ |
155 | - /* _LOWER_ 7 bits of this char */ | |
156 | - /* addr: unsigned int to make lm_sensors i2c-isa adapter work | |
157 | - more cleanly. It does not take any more memory space, due to | |
158 | - alignment considerations */ | |
155 | + /* _LOWER_ 7 bits */ | |
159 | 156 | struct i2c_adapter *adapter; /* the adapter we sit on */ |
160 | 157 | struct i2c_driver *driver; /* and our access routines */ |
161 | 158 | int usage_count; /* How many accesses currently */ |
... | ... | @@ -309,7 +306,6 @@ |
309 | 306 | |
310 | 307 | /* Internal numbers to terminate lists */ |
311 | 308 | #define I2C_CLIENT_END 0xfffeU |
312 | -#define I2C_CLIENT_ISA_END 0xfffefffeU | |
313 | 309 | |
314 | 310 | /* The numbers to use to set I2C bus address */ |
315 | 311 | #define ANY_I2C_BUS 0xffff |