diff options
author | Jean Delvare <khali@linux-fr.org> | 2009-06-19 10:58:18 -0400 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2009-06-19 10:58:18 -0400 |
commit | 729d6dd571464954f625e6b80950d9e4e3bd94f7 (patch) | |
tree | faf8ada32b03c8bc07e1ddb8ec0d26d6440b6d98 /include/linux/i2c.h | |
parent | 352da9820e5506e3b8496e6052a2ad9c488efae8 (diff) |
i2c: Get rid of the legacy binding model
We converted all the legacy i2c drivers so we can finally get rid of
the legacy binding model. Hooray!
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r-- | include/linux/i2c.h | 39 |
1 files changed, 10 insertions, 29 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index b3f4606afa0e..43a3545670b8 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -100,9 +100,8 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, | |||
100 | * @class: What kind of i2c device we instantiate (for detect) | 100 | * @class: What kind of i2c device we instantiate (for detect) |
101 | * @attach_adapter: Callback for bus addition (for legacy drivers) | 101 | * @attach_adapter: Callback for bus addition (for legacy drivers) |
102 | * @detach_adapter: Callback for bus removal (for legacy drivers) | 102 | * @detach_adapter: Callback for bus removal (for legacy drivers) |
103 | * @detach_client: Callback for device removal (for legacy drivers) | 103 | * @probe: Callback for device binding |
104 | * @probe: Callback for device binding (new-style drivers) | 104 | * @remove: Callback for device unbinding |
105 | * @remove: Callback for device unbinding (new-style drivers) | ||
106 | * @shutdown: Callback for device shutdown | 105 | * @shutdown: Callback for device shutdown |
107 | * @suspend: Callback for device suspend | 106 | * @suspend: Callback for device suspend |
108 | * @resume: Callback for device resume | 107 | * @resume: Callback for device resume |
@@ -137,26 +136,14 @@ struct i2c_driver { | |||
137 | int id; | 136 | int id; |
138 | unsigned int class; | 137 | unsigned int class; |
139 | 138 | ||
140 | /* Notifies the driver that a new bus has appeared. This routine | 139 | /* Notifies the driver that a new bus has appeared or is about to be |
141 | * can be used by the driver to test if the bus meets its conditions | 140 | * removed. You should avoid using this if you can, it will probably |
142 | * & seek for the presence of the chip(s) it supports. If found, it | 141 | * be removed in a near future. |
143 | * registers the client(s) that are on the bus to the i2c admin. via | ||
144 | * i2c_attach_client. (LEGACY I2C DRIVERS ONLY) | ||
145 | */ | 142 | */ |
146 | int (*attach_adapter)(struct i2c_adapter *); | 143 | int (*attach_adapter)(struct i2c_adapter *); |
147 | int (*detach_adapter)(struct i2c_adapter *); | 144 | int (*detach_adapter)(struct i2c_adapter *); |
148 | 145 | ||
149 | /* tells the driver that a client is about to be deleted & gives it | 146 | /* Standard driver model interfaces */ |
150 | * the chance to remove its private data. Also, if the client struct | ||
151 | * has been dynamically allocated by the driver in the function above, | ||
152 | * it must be freed here. (LEGACY I2C DRIVERS ONLY) | ||
153 | */ | ||
154 | int (*detach_client)(struct i2c_client *) __deprecated; | ||
155 | |||
156 | /* Standard driver model interfaces, for "new style" i2c drivers. | ||
157 | * With the driver model, device enumeration is NEVER done by drivers; | ||
158 | * it's done by infrastructure. (NEW STYLE DRIVERS ONLY) | ||
159 | */ | ||
160 | int (*probe)(struct i2c_client *, const struct i2c_device_id *); | 147 | int (*probe)(struct i2c_client *, const struct i2c_device_id *); |
161 | int (*remove)(struct i2c_client *); | 148 | int (*remove)(struct i2c_client *); |
162 | 149 | ||
@@ -248,11 +235,10 @@ static inline void i2c_set_clientdata(struct i2c_client *dev, void *data) | |||
248 | * that, such as chip type, configuration, associated IRQ, and so on. | 235 | * that, such as chip type, configuration, associated IRQ, and so on. |
249 | * | 236 | * |
250 | * i2c_board_info is used to build tables of information listing I2C devices | 237 | * i2c_board_info is used to build tables of information listing I2C devices |
251 | * that are present. This information is used to grow the driver model tree | 238 | * that are present. This information is used to grow the driver model tree. |
252 | * for "new style" I2C drivers. For mainboards this is done statically using | 239 | * For mainboards this is done statically using i2c_register_board_info(); |
253 | * i2c_register_board_info(); bus numbers identify adapters that aren't | 240 | * bus numbers identify adapters that aren't yet available. For add-on boards, |
254 | * yet available. For add-on boards, i2c_new_device() does this dynamically | 241 | * i2c_new_device() does this dynamically with the adapter already known. |
255 | * with the adapter already known. | ||
256 | */ | 242 | */ |
257 | struct i2c_board_info { | 243 | struct i2c_board_info { |
258 | char type[I2C_NAME_SIZE]; | 244 | char type[I2C_NAME_SIZE]; |
@@ -425,11 +411,6 @@ static inline int i2c_add_driver(struct i2c_driver *driver) | |||
425 | return i2c_register_driver(THIS_MODULE, driver); | 411 | return i2c_register_driver(THIS_MODULE, driver); |
426 | } | 412 | } |
427 | 413 | ||
428 | /* These are deprecated, your driver should use the standard .probe() | ||
429 | * and .remove() methods instead. */ | ||
430 | extern int __deprecated i2c_attach_client(struct i2c_client *); | ||
431 | extern int __deprecated i2c_detach_client(struct i2c_client *); | ||
432 | |||
433 | extern struct i2c_client *i2c_use_client(struct i2c_client *client); | 414 | extern struct i2c_client *i2c_use_client(struct i2c_client *client); |
434 | extern void i2c_release_client(struct i2c_client *client); | 415 | extern void i2c_release_client(struct i2c_client *client); |
435 | 416 | ||