aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r--include/linux/i2c.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 47c2a1907372..953e71fb07b4 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -140,25 +140,30 @@ struct i2c_driver {
140}; 140};
141#define to_i2c_driver(d) container_of(d, struct i2c_driver, driver) 141#define to_i2c_driver(d) container_of(d, struct i2c_driver, driver)
142 142
143#define I2C_NAME_SIZE 50 143#define I2C_NAME_SIZE 20
144 144
145/* 145/**
146 * i2c_client identifies a single device (i.e. chip) that is connected to an 146 * struct i2c_client - represent an I2C slave device
147 * i2c bus. The behaviour is defined by the routines of the driver. This 147 * @addr: Address used on the I2C bus connected to the parent adapter.
148 * function is mainly used for lookup & other admin. functions. 148 * @name: Indicates the type of the device, usually a chip name that's
149 * generic enough to hide second-sourcing and compatible revisions.
150 * @dev: Driver model device node for the slave.
151 *
152 * An i2c_client identifies a single device (i.e. chip) connected to an
153 * i2c bus. The behaviour is defined by the routines of the driver.
149 */ 154 */
150struct i2c_client { 155struct i2c_client {
151 unsigned int flags; /* div., see below */ 156 unsigned short flags; /* div., see below */
152 unsigned short addr; /* chip address - NOTE: 7bit */ 157 unsigned short addr; /* chip address - NOTE: 7bit */
153 /* addresses are stored in the */ 158 /* addresses are stored in the */
154 /* _LOWER_ 7 bits */ 159 /* _LOWER_ 7 bits */
160 char name[I2C_NAME_SIZE];
155 struct i2c_adapter *adapter; /* the adapter we sit on */ 161 struct i2c_adapter *adapter; /* the adapter we sit on */
156 struct i2c_driver *driver; /* and our access routines */ 162 struct i2c_driver *driver; /* and our access routines */
157 int usage_count; /* How many accesses currently */ 163 int usage_count; /* How many accesses currently */
158 /* to the client */ 164 /* to the client */
159 struct device dev; /* the device structure */ 165 struct device dev; /* the device structure */
160 struct list_head list; 166 struct list_head list;
161 char name[I2C_NAME_SIZE];
162 struct completion released; 167 struct completion released;
163}; 168};
164#define to_i2c_client(d) container_of(d, struct i2c_client, dev) 169#define to_i2c_client(d) container_of(d, struct i2c_client, dev)
@@ -231,7 +236,7 @@ struct i2c_adapter {
231 int nr; 236 int nr;
232 struct list_head clients; 237 struct list_head clients;
233 struct list_head list; 238 struct list_head list;
234 char name[I2C_NAME_SIZE]; 239 char name[48];
235 struct completion dev_released; 240 struct completion dev_released;
236}; 241};
237#define dev_to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev) 242#define dev_to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev)