Rev 5270 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5270 | Rev 6082 | ||
---|---|---|---|
Line 24... | Line 24... | ||
24 | /* With some changes from Kyösti Mälkki |
24 | /* With some changes from Kyösti Mälkki |
25 | Frodo Looijaard |
25 | Frodo Looijaard |
26 | #ifndef _LINUX_I2C_H |
26 | #ifndef _LINUX_I2C_H |
27 | #define _LINUX_I2C_H |
27 | #define _LINUX_I2C_H |
Line 28... | Line -... | ||
28 | - | ||
29 | #include |
- | |
30 | #ifdef __KERNEL__ |
- | |
31 | #include |
- | |
32 | #include |
28 | |
- | 29 | #include |
|
33 | #include |
30 | #include |
34 | #include |
31 | #include |
35 | #include |
32 | #include |
Line 36... | Line 33... | ||
36 | #include |
33 | #include |
Line 59... | Line 56... | ||
59 | * @class: What kind of i2c device we instantiate (for detect) |
56 | * @class: What kind of i2c device we instantiate (for detect) |
60 | * @attach_adapter: Callback for bus addition (deprecated) |
57 | * @attach_adapter: Callback for bus addition (deprecated) |
61 | * @probe: Callback for device binding |
58 | * @probe: Callback for device binding |
62 | * @remove: Callback for device unbinding |
59 | * @remove: Callback for device unbinding |
63 | * @shutdown: Callback for device shutdown |
60 | * @shutdown: Callback for device shutdown |
64 | * @suspend: Callback for device suspend |
- | |
65 | * @resume: Callback for device resume |
- | |
66 | * @alert: Alert callback, for example for the SMBus alert protocol |
61 | * @alert: Alert callback, for example for the SMBus alert protocol |
67 | * @command: Callback for bus-wide signaling (optional) |
62 | * @command: Callback for bus-wide signaling (optional) |
68 | * @driver: Device driver model driver |
63 | * @driver: Device driver model driver |
69 | * @id_table: List of I2C devices supported by this driver |
64 | * @id_table: List of I2C devices supported by this driver |
70 | * @detect: Callback for device detection |
65 | * @detect: Callback for device detection |
Line 103... | Line 98... | ||
103 | int (*probe)(struct i2c_client *, const struct i2c_device_id *); |
98 | int (*probe)(struct i2c_client *, const struct i2c_device_id *); |
104 | int (*remove)(struct i2c_client *); |
99 | int (*remove)(struct i2c_client *); |
Line 105... | Line 100... | ||
105 | 100 | ||
106 | /* driver model interfaces that don't relate to enumeration */ |
101 | /* driver model interfaces that don't relate to enumeration */ |
107 | void (*shutdown)(struct i2c_client *); |
- | |
108 | // int (*suspend)(struct i2c_client *, pm_message_t mesg); |
- | |
Line 109... | Line 102... | ||
109 | int (*resume)(struct i2c_client *); |
102 | void (*shutdown)(struct i2c_client *); |
110 | 103 | ||
111 | /* Alert callback, for example for the SMBus alert protocol. |
104 | /* Alert callback, for example for the SMBus alert protocol. |
112 | * The format and meaning of the data value depends on the protocol. |
105 | * The format and meaning of the data value depends on the protocol. |
Line 164... | Line 157... | ||
164 | 157 | ||
165 | extern struct i2c_client *i2c_verify_client(struct device *dev); |
158 | extern struct i2c_client *i2c_verify_client(struct device *dev); |
Line 166... | Line 159... | ||
166 | extern struct i2c_adapter *i2c_verify_adapter(struct device *dev); |
159 | extern struct i2c_adapter *i2c_verify_adapter(struct device *dev); |
167 | 160 | ||
168 | enum i2c_slave_event { |
161 | enum i2c_slave_event { |
169 | I2C_SLAVE_REQ_READ_START, |
162 | I2C_SLAVE_READ_REQUESTED, |
170 | I2C_SLAVE_REQ_READ_END, |
163 | I2C_SLAVE_WRITE_REQUESTED, |
171 | I2C_SLAVE_REQ_WRITE_START, |
164 | I2C_SLAVE_READ_PROCESSED, |
172 | I2C_SLAVE_REQ_WRITE_END, |
165 | I2C_SLAVE_WRITE_RECEIVED, |
173 | I2C_SLAVE_STOP, |
166 | I2C_SLAVE_STOP, |
174 | }; |
167 | }; |
175 | /** |
168 | /** |
176 | * struct i2c_board_info - template for device creation |
169 | * struct i2c_board_info - template for device creation |
177 | * @type: chip type, to initialize i2c_client.name |
170 | * @type: chip type, to initialize i2c_client.name |
178 | * @flags: to initialize i2c_client.flags |
171 | * @flags: to initialize i2c_client.flags |
179 | * @addr: stored in i2c_client.addr |
172 | * @addr: stored in i2c_client.addr |
180 | * @platform_data: stored in i2c_client.dev.platform_data |
173 | * @platform_data: stored in i2c_client.dev.platform_data |
181 | * @archdata: copied into i2c_client.dev.archdata |
174 | * @archdata: copied into i2c_client.dev.archdata |
182 | * @of_node: pointer to OpenFirmware device node |
175 | * @of_node: pointer to OpenFirmware device node |
183 | * @acpi_node: ACPI device node |
176 | * @fwnode: device node supplied by the platform firmware |
184 | * @irq: stored in i2c_client.irq |
177 | * @irq: stored in i2c_client.irq |
185 | * |
178 | * |
186 | * I2C doesn't actually support hardware probing, although controllers and |
179 | * I2C doesn't actually support hardware probing, although controllers and |
Line 304... | Line 297... | ||
304 | /* Construct an I2C_CLIENT_END-terminated array of i2c addresses */ |
297 | /* Construct an I2C_CLIENT_END-terminated array of i2c addresses */ |
305 | #define I2C_ADDRS(addr, addrs...) \ |
298 | #define I2C_ADDRS(addr, addrs...) \ |
306 | ((const unsigned short []){ addr, ## addrs, I2C_CLIENT_END }) |
299 | ((const unsigned short []){ addr, ## addrs, I2C_CLIENT_END }) |
Line 307... | Line -... | ||
307 | - | ||
- | 300 | ||
Line 308... | Line 301... | ||
308 | 301 | ||
309 | #endif /* __KERNEL__ */ |
302 | |
310 | 303 | ||
311 | /** |
304 | /** |