aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 17:48:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 17:48:31 -0400
commitb57ab7632b8fc1eef139bbbb7a89002be61f99e1 (patch)
tree19d4eeea0dbf721312c4e33a423ed29ff70aff88 /include
parentf12c03722045882a50c270f6332cf2c7b16a83d2 (diff)
parent3760f736716f74bdc62a4ba5406934338da93eb2 (diff)
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: i2c: Convert most new-style drivers to use module aliasing i2c: Add support for device alias names i2c-amd756-s4882: Fix an error path i2c: Drop unused RTC driver IDs i2c/tps65010: Add missing intialization of client data i2c-sis5595: Minor cleanups in sis5595_access i2c-piix4: Minor cleanups i2c: Spelling fix (successful) i2c-stub: No newline in parameter description
Diffstat (limited to 'include')
-rw-r--r--include/linux/i2c-id.h3
-rw-r--r--include/linux/i2c.h17
-rw-r--r--include/linux/mod_devicetable.h11
-rw-r--r--include/media/v4l2-common.h4
-rw-r--r--include/media/v4l2-i2c-drv-legacy.h2
-rw-r--r--include/media/v4l2-i2c-drv.h2
6 files changed, 24 insertions, 15 deletions
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index 32eb8bbe4831..580acc93903e 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -79,12 +79,9 @@
79#define I2C_DRIVERID_UPD64031A 79 /* upd64031a video processor */ 79#define I2C_DRIVERID_UPD64031A 79 /* upd64031a video processor */
80#define I2C_DRIVERID_SAA717X 80 /* saa717x video encoder */ 80#define I2C_DRIVERID_SAA717X 80 /* saa717x video encoder */
81#define I2C_DRIVERID_DS1672 81 /* Dallas/Maxim DS1672 RTC */ 81#define I2C_DRIVERID_DS1672 81 /* Dallas/Maxim DS1672 RTC */
82#define I2C_DRIVERID_X1205 82 /* Xicor/Intersil X1205 RTC */
83#define I2C_DRIVERID_PCF8563 83 /* Philips PCF8563 RTC */
84#define I2C_DRIVERID_BT866 85 /* Conexant bt866 video encoder */ 82#define I2C_DRIVERID_BT866 85 /* Conexant bt866 video encoder */
85#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */ 83#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */
86#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */ 84#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */
87#define I2C_DRIVERID_ISL1208 88 /* Intersil ISL1208 RTC */
88#define I2C_DRIVERID_WM8731 89 /* Wolfson WM8731 audio codec */ 85#define I2C_DRIVERID_WM8731 89 /* Wolfson WM8731 audio codec */
89#define I2C_DRIVERID_WM8750 90 /* Wolfson WM8750 audio codec */ 86#define I2C_DRIVERID_WM8750 90 /* Wolfson WM8750 audio codec */
90#define I2C_DRIVERID_WM8753 91 /* Wolfson WM8753 audio codec */ 87#define I2C_DRIVERID_WM8753 91 /* Wolfson WM8753 audio codec */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 365e0df3646b..cb63da5c2139 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -126,7 +126,7 @@ struct i2c_driver {
126 * With the driver model, device enumeration is NEVER done by drivers; 126 * With the driver model, device enumeration is NEVER done by drivers;
127 * it's done by infrastructure. (NEW STYLE DRIVERS ONLY) 127 * it's done by infrastructure. (NEW STYLE DRIVERS ONLY)
128 */ 128 */
129 int (*probe)(struct i2c_client *); 129 int (*probe)(struct i2c_client *, const struct i2c_device_id *);
130 int (*remove)(struct i2c_client *); 130 int (*remove)(struct i2c_client *);
131 131
132 /* driver model interfaces that don't relate to enumeration */ 132 /* driver model interfaces that don't relate to enumeration */
@@ -140,11 +140,10 @@ struct i2c_driver {
140 int (*command)(struct i2c_client *client,unsigned int cmd, void *arg); 140 int (*command)(struct i2c_client *client,unsigned int cmd, void *arg);
141 141
142 struct device_driver driver; 142 struct device_driver driver;
143 const struct i2c_device_id *id_table;
143}; 144};
144#define to_i2c_driver(d) container_of(d, struct i2c_driver, driver) 145#define to_i2c_driver(d) container_of(d, struct i2c_driver, driver)
145 146
146#define I2C_NAME_SIZE 20
147
148/** 147/**
149 * struct i2c_client - represent an I2C slave device 148 * struct i2c_client - represent an I2C slave device
150 * @flags: I2C_CLIENT_TEN indicates the device uses a ten bit chip address; 149 * @flags: I2C_CLIENT_TEN indicates the device uses a ten bit chip address;
@@ -230,17 +229,17 @@ struct i2c_board_info {
230}; 229};
231 230
232/** 231/**
233 * I2C_BOARD_INFO - macro used to list an i2c device and its driver 232 * I2C_BOARD_INFO - macro used to list an i2c device and its address
234 * @driver: identifies the driver to use with the device 233 * @dev_type: identifies the device type
235 * @dev_addr: the device's address on the bus. 234 * @dev_addr: the device's address on the bus.
236 * 235 *
237 * This macro initializes essential fields of a struct i2c_board_info, 236 * This macro initializes essential fields of a struct i2c_board_info,
238 * declaring what has been provided on a particular board. Optional 237 * declaring what has been provided on a particular board. Optional
239 * fields (such as the chip type, its associated irq, or device-specific 238 * fields (such as associated irq, or device-specific platform_data)
240 * platform_data) are provided using conventional syntax. 239 * are provided using conventional syntax.
241 */ 240 */
242#define I2C_BOARD_INFO(driver,dev_addr) \ 241#define I2C_BOARD_INFO(dev_type,dev_addr) \
243 .driver_name = (driver), .addr = (dev_addr) 242 .type = (dev_type), .addr = (dev_addr)
244 243
245 244
246/* Add-on boards should register/unregister their devices; e.g. a board 245/* Add-on boards should register/unregister their devices; e.g. a board
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 139d49d2f078..d73eceaa7afb 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -368,4 +368,15 @@ struct virtio_device_id {
368}; 368};
369#define VIRTIO_DEV_ANY_ID 0xffffffff 369#define VIRTIO_DEV_ANY_ID 0xffffffff
370 370
371/* i2c */
372
373#define I2C_NAME_SIZE 20
374#define I2C_MODULE_PREFIX "i2c:"
375
376struct i2c_device_id {
377 char name[I2C_NAME_SIZE];
378 kernel_ulong_t driver_data; /* Data private to the driver */
379};
380
381
371#endif /* LINUX_MOD_DEVICETABLE_H */ 382#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 316a58453134..020d05758bd8 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -107,9 +107,11 @@ int v4l2_chip_match_host(u32 id_type, u32 chip_id);
107struct i2c_driver; 107struct i2c_driver;
108struct i2c_adapter; 108struct i2c_adapter;
109struct i2c_client; 109struct i2c_client;
110struct i2c_device_id;
110 111
111int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver *driver, 112int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver *driver,
112 const char *name, int (*probe)(struct i2c_client *)); 113 const char *name,
114 int (*probe)(struct i2c_client *, const struct i2c_device_id *));
113 115
114/* ------------------------------------------------------------------------- */ 116/* ------------------------------------------------------------------------- */
115 117
diff --git a/include/media/v4l2-i2c-drv-legacy.h b/include/media/v4l2-i2c-drv-legacy.h
index e7645578fc22..347b6f8beb23 100644
--- a/include/media/v4l2-i2c-drv-legacy.h
+++ b/include/media/v4l2-i2c-drv-legacy.h
@@ -25,7 +25,7 @@ struct v4l2_i2c_driver_data {
25 const char * const name; 25 const char * const name;
26 int driverid; 26 int driverid;
27 int (*command)(struct i2c_client *client, unsigned int cmd, void *arg); 27 int (*command)(struct i2c_client *client, unsigned int cmd, void *arg);
28 int (*probe)(struct i2c_client *client); 28 int (*probe)(struct i2c_client *client, const struct i2c_device_id *id);
29 int (*remove)(struct i2c_client *client); 29 int (*remove)(struct i2c_client *client);
30 int (*suspend)(struct i2c_client *client, pm_message_t state); 30 int (*suspend)(struct i2c_client *client, pm_message_t state);
31 int (*resume)(struct i2c_client *client); 31 int (*resume)(struct i2c_client *client);
diff --git a/include/media/v4l2-i2c-drv.h b/include/media/v4l2-i2c-drv.h
index 9e4bab276915..7b6f06be7950 100644
--- a/include/media/v4l2-i2c-drv.h
+++ b/include/media/v4l2-i2c-drv.h
@@ -30,7 +30,7 @@ struct v4l2_i2c_driver_data {
30 const char * const name; 30 const char * const name;
31 int driverid; 31 int driverid;
32 int (*command)(struct i2c_client *client, unsigned int cmd, void *arg); 32 int (*command)(struct i2c_client *client, unsigned int cmd, void *arg);
33 int (*probe)(struct i2c_client *client); 33 int (*probe)(struct i2c_client *client, const struct i2c_device_id *id);
34 int (*remove)(struct i2c_client *client); 34 int (*remove)(struct i2c_client *client);
35 int (*suspend)(struct i2c_client *client, pm_message_t state); 35 int (*suspend)(struct i2c_client *client, pm_message_t state);
36 int (*resume)(struct i2c_client *client); 36 int (*resume)(struct i2c_client *client);