aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c.h
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-04-03 06:29:43 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-04-03 06:29:43 -0400
commitf94f3cb37a1c4d44dd2070cc4a6165689bda9c92 (patch)
tree21bbdeacbc1b9895cf917231d1675eaaa63b9229 /include/linux/i2c.h
parente27808df97ff7b43b4927aadf410705f33313523 (diff)
parent1b4610ebf37a05a65e9f29cdf4d87c207573104d (diff)
Merge branch 'for-2.6.39' into for-2.6.40
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r--include/linux/i2c.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 903576df88dc..f1e3ff5880a9 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -29,7 +29,6 @@
29#include <linux/types.h> 29#include <linux/types.h>
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31#include <linux/module.h> 31#include <linux/module.h>
32#include <linux/i2c-id.h>
33#include <linux/mod_devicetable.h> 32#include <linux/mod_devicetable.h>
34#include <linux/device.h> /* for struct device */ 33#include <linux/device.h> /* for struct device */
35#include <linux/sched.h> /* for completion */ 34#include <linux/sched.h> /* for completion */
@@ -105,8 +104,8 @@ extern s32 i2c_smbus_write_i2c_block_data(const struct i2c_client *client,
105/** 104/**
106 * struct i2c_driver - represent an I2C device driver 105 * struct i2c_driver - represent an I2C device driver
107 * @class: What kind of i2c device we instantiate (for detect) 106 * @class: What kind of i2c device we instantiate (for detect)
108 * @attach_adapter: Callback for bus addition (for legacy drivers) 107 * @attach_adapter: Callback for bus addition (deprecated)
109 * @detach_adapter: Callback for bus removal (for legacy drivers) 108 * @detach_adapter: Callback for bus removal (deprecated)
110 * @probe: Callback for device binding 109 * @probe: Callback for device binding
111 * @remove: Callback for device unbinding 110 * @remove: Callback for device unbinding
112 * @shutdown: Callback for device shutdown 111 * @shutdown: Callback for device shutdown
@@ -144,11 +143,11 @@ struct i2c_driver {
144 unsigned int class; 143 unsigned int class;
145 144
146 /* Notifies the driver that a new bus has appeared or is about to be 145 /* Notifies the driver that a new bus has appeared or is about to be
147 * removed. You should avoid using this if you can, it will probably 146 * removed. You should avoid using this, it will be removed in a
148 * be removed in a near future. 147 * near future.
149 */ 148 */
150 int (*attach_adapter)(struct i2c_adapter *); 149 int (*attach_adapter)(struct i2c_adapter *) __deprecated;
151 int (*detach_adapter)(struct i2c_adapter *); 150 int (*detach_adapter)(struct i2c_adapter *) __deprecated;
152 151
153 /* Standard driver model interfaces */ 152 /* Standard driver model interfaces */
154 int (*probe)(struct i2c_client *, const struct i2c_device_id *); 153 int (*probe)(struct i2c_client *, const struct i2c_device_id *);
@@ -258,9 +257,7 @@ struct i2c_board_info {
258 unsigned short addr; 257 unsigned short addr;
259 void *platform_data; 258 void *platform_data;
260 struct dev_archdata *archdata; 259 struct dev_archdata *archdata;
261#ifdef CONFIG_OF
262 struct device_node *of_node; 260 struct device_node *of_node;
263#endif
264 int irq; 261 int irq;
265}; 262};
266 263
@@ -356,7 +353,6 @@ struct i2c_algorithm {
356 */ 353 */
357struct i2c_adapter { 354struct i2c_adapter {
358 struct module *owner; 355 struct module *owner;
359 unsigned int id __deprecated;
360 unsigned int class; /* classes to allow probing for */ 356 unsigned int class; /* classes to allow probing for */
361 const struct i2c_algorithm *algo; /* the algorithm to access the bus */ 357 const struct i2c_algorithm *algo; /* the algorithm to access the bus */
362 void *algo_data; 358 void *algo_data;
@@ -398,6 +394,8 @@ i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter)
398 return NULL; 394 return NULL;
399} 395}
400 396
397int i2c_for_each_dev(void *data, int (*fn)(struct device *, void *));
398
401/* Adapter locking functions, exported for shared pin cases */ 399/* Adapter locking functions, exported for shared pin cases */
402void i2c_lock_adapter(struct i2c_adapter *); 400void i2c_lock_adapter(struct i2c_adapter *);
403void i2c_unlock_adapter(struct i2c_adapter *); 401void i2c_unlock_adapter(struct i2c_adapter *);
@@ -449,7 +447,7 @@ extern void i2c_release_client(struct i2c_client *client);
449extern void i2c_clients_command(struct i2c_adapter *adap, 447extern void i2c_clients_command(struct i2c_adapter *adap,
450 unsigned int cmd, void *arg); 448 unsigned int cmd, void *arg);
451 449
452extern struct i2c_adapter *i2c_get_adapter(int id); 450extern struct i2c_adapter *i2c_get_adapter(int nr);
453extern void i2c_put_adapter(struct i2c_adapter *adap); 451extern void i2c_put_adapter(struct i2c_adapter *adap);
454 452
455 453