Rev 1123 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1123 | Rev 1125 | ||
---|---|---|---|
Line 191... | Line 191... | ||
191 | u8 checksum; |
191 | u8 checksum; |
192 | } __attribute__((packed)); |
192 | } __attribute__((packed)); |
Line 193... | Line 193... | ||
193 | 193 | ||
Line 194... | Line -... | ||
194 | #define EDID_PRODUCT_ID(e) ((e)->prod_code[0] | ((e)->prod_code[1] << 8)) |
- | |
195 | - | ||
196 | #define KOBJ_NAME_LEN 20 |
- | |
197 | - | ||
198 | #define I2C_NAME_SIZE 20 |
- | |
199 | - | ||
200 | - | ||
201 | /* --- Defines for bit-adapters --------------------------------------- */ |
- | |
202 | /* |
- | |
203 | * This struct contains the hw-dependent functions of bit-style adapters to |
- | |
204 | * manipulate the line states, and to init any hw-specific features. This is |
- | |
205 | * only used if you have more than one hw-type of adapter running. |
- | |
206 | */ |
- | |
207 | struct i2c_algo_bit_data { |
- | |
208 | void *data; /* private data for lowlevel routines */ |
- | |
209 | void (*setsda) (void *data, int state); |
- | |
210 | void (*setscl) (void *data, int state); |
- | |
211 | int (*getsda) (void *data); |
- | |
212 | int (*getscl) (void *data); |
- | |
213 | - | ||
214 | /* local settings */ |
- | |
215 | int udelay; /* half clock cycle time in us, |
- | |
216 | minimum 2 us for fast-mode I2C, |
- | |
217 | minimum 5 us for standard-mode I2C and SMBus, |
- | |
218 | maximum 50 us for SMBus */ |
- | |
219 | int timeout; /* in jiffies */ |
- | |
220 | }; |
- | |
221 | - | ||
222 | struct i2c_client; |
- | |
223 | /* |
- | |
224 | * i2c_adapter is the structure used to identify a physical i2c bus along |
- | |
225 | * with the access algorithms necessary to access it. |
- | |
226 | */ |
- | |
227 | struct i2c_adapter { |
- | |
228 | // struct module *owner; |
- | |
229 | unsigned int id; |
- | |
230 | unsigned int class; |
- | |
231 | // const struct i2c_algorithm *algo; /* the algorithm to access the bus */ |
- | |
232 | void *algo_data; |
- | |
233 | - | ||
234 | /* --- administration stuff. */ |
- | |
235 | int (*client_register)(struct i2c_client *); |
- | |
236 | int (*client_unregister)(struct i2c_client *); |
- | |
237 | - | ||
238 | /* data fields that are valid for all devices */ |
- | |
239 | u8 level; /* nesting level for lockdep */ |
- | |
240 | // struct mutex bus_lock; |
- | |
241 | // struct mutex clist_lock; |
- | |
242 | - | ||
243 | int timeout; |
- | |
244 | int retries; |
- | |
245 | // struct device dev; /* the adapter device */ |
- | |
246 | - | ||
247 | int nr; |
- | |
248 | struct list_head clients; /* DEPRECATED */ |
- | |
249 | char name[48]; |
- | |
250 | // struct completion dev_released; |
- | |
251 | }; |
- | |
252 | #define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev) |
- | |
253 | - | ||
254 | struct i2c_client { |
- | |
255 | unsigned short flags; /* div., see below */ |
- | |
256 | unsigned short addr; /* chip address - NOTE: 7bit */ |
- | |
257 | /* addresses are stored in the */ |
- | |
258 | /* _LOWER_ 7 bits */ |
- | |
259 | char name[I2C_NAME_SIZE]; |
- | |
260 | struct i2c_adapter *adapter; /* the adapter we sit on */ |
- | |
261 | // struct i2c_driver *driver; /* and our access routines */ |
- | |
262 | // struct device dev; /* the device structure */ |
- | |
263 | int irq; /* irq issued by device (or -1) */ |
- | |
264 | char driver_name[KOBJ_NAME_LEN]; |
- | |
265 | struct list_head list; /* DEPRECATED */ |
- | |
266 | // struct completion released; |
- | |
267 | }; |
- | |
268 | #define to_i2c_client(d) container_of(d, struct i2c_client, dev) |
- | |
269 | - | ||
270 | int i2c_bit_add_bus(struct i2c_adapter *); |
- | |
271 | int i2c_bit_add_numbered_bus(struct i2c_adapter *); |
- | |
272 | - | ||
273 | - | ||
274 | struct i2c_msg { |
- | |
275 | u16 addr; /* slave address */ |
- | |
276 | u16 flags; |
- | |
277 | #define I2C_M_TEN 0x0010 /* this is a ten bit chip address */ |
- | |
278 | #define I2C_M_RD 0x0001 /* read data, from slave to master */ |
- | |
279 | #define I2C_M_NOSTART 0x4000 /* if I2C_FUNC_PROTOCOL_MANGLING */ |
- | |
280 | #define I2C_M_REV_DIR_ADDR 0x2000 /* if I2C_FUNC_PROTOCOL_MANGLING */ |
- | |
281 | #define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */ |
- | |
282 | #define I2C_M_NO_RD_ACK 0x0800 /* if I2C_FUNC_PROTOCOL_MANGLING */ |
- | |
283 | #define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */ |
- | |
284 | u16 len; /* msg length */ |
- | |
Line 285... | Line 194... | ||
285 | u8 *buf; /* pointer to msg data */ |
194 | #define EDID_PRODUCT_ID(e) ((e)->prod_code[0] | ((e)->prod_code[1] << 8)) |