Rev 5056 | Rev 6082 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5056 | Rev 5270 | ||
---|---|---|---|
Line 29... | Line 29... | ||
29 | #include |
29 | #include |
30 | #ifdef __KERNEL__ |
30 | #ifdef __KERNEL__ |
31 | #include |
31 | #include |
32 | #include |
32 | #include |
33 | #include |
33 | #include |
- | 34 | #include |
|
- | 35 | #include |
|
- | 36 | #include |
|
Line 34... | Line 37... | ||
34 | 37 | ||
35 | extern struct bus_type i2c_bus_type; |
38 | extern struct bus_type i2c_bus_type; |
Line 36... | Line 39... | ||
36 | extern struct device_type i2c_adapter_type; |
39 | extern struct device_type i2c_adapter_type; |
Line 137... | Line 140... | ||
137 | * @adapter: manages the bus segment hosting this I2C device |
140 | * @adapter: manages the bus segment hosting this I2C device |
138 | * @dev: Driver model device node for the slave. |
141 | * @dev: Driver model device node for the slave. |
139 | * @irq: indicates the IRQ generated by this device (if any) |
142 | * @irq: indicates the IRQ generated by this device (if any) |
140 | * @detected: member of an i2c_driver.clients list or i2c-core's |
143 | * @detected: member of an i2c_driver.clients list or i2c-core's |
141 | * userspace_devices list |
144 | * userspace_devices list |
- | 145 | * @slave_cb: Callback when I2C slave mode of an adapter is used. The adapter |
|
- | 146 | * calls it to pass on slave events to the slave driver. |
|
142 | * |
147 | * |
143 | * An i2c_client identifies a single device (i.e. chip) connected to an |
148 | * An i2c_client identifies a single device (i.e. chip) connected to an |
144 | * i2c bus. The behaviour exposed to Linux is defined by the driver |
149 | * i2c bus. The behaviour exposed to Linux is defined by the driver |
145 | * managing the device. |
150 | * managing the device. |
146 | */ |
151 | */ |
Line 158... | Line 163... | ||
158 | #define to_i2c_client(d) container_of(d, struct i2c_client, dev) |
163 | #define to_i2c_client(d) container_of(d, struct i2c_client, dev) |
Line 159... | Line 164... | ||
159 | 164 | ||
160 | extern struct i2c_client *i2c_verify_client(struct device *dev); |
165 | extern struct i2c_client *i2c_verify_client(struct device *dev); |
Line -... | Line 166... | ||
- | 166 | extern struct i2c_adapter *i2c_verify_adapter(struct device *dev); |
|
- | 167 | ||
- | 168 | enum i2c_slave_event { |
|
- | 169 | I2C_SLAVE_REQ_READ_START, |
|
- | 170 | I2C_SLAVE_REQ_READ_END, |
|
- | 171 | I2C_SLAVE_REQ_WRITE_START, |
|
- | 172 | I2C_SLAVE_REQ_WRITE_END, |
|
161 | extern struct i2c_adapter *i2c_verify_adapter(struct device *dev); |
173 | I2C_SLAVE_STOP, |
162 | 174 | }; |
|
163 | /** |
175 | /** |
164 | * struct i2c_board_info - template for device creation |
176 | * struct i2c_board_info - template for device creation |
165 | * @type: chip type, to initialize i2c_client.name |
177 | * @type: chip type, to initialize i2c_client.name |
Line 208... | Line 220... | ||
208 | * i2c_algorithm is the interface to a class of hardware solutions which can |
220 | * i2c_algorithm is the interface to a class of hardware solutions which can |
209 | * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584 |
221 | * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584 |
210 | * to name two of the most common. |
222 | * to name two of the most common. |
211 | * |
223 | * |
212 | * The return codes from the @master_xfer field should indicate the type of |
224 | * The return codes from the @master_xfer field should indicate the type of |
213 | * error code that occured during the transfer, as documented in the kernel |
225 | * error code that occurred during the transfer, as documented in the kernel |
214 | * Documentation file Documentation/i2c/fault-codes. |
226 | * Documentation file Documentation/i2c/fault-codes. |
215 | */ |
227 | */ |
216 | struct i2c_algorithm { |
228 | struct i2c_algorithm { |
217 | /* If an adapter algorithm can't do I2C-level access, set master_xfer |
229 | /* If an adapter algorithm can't do I2C-level access, set master_xfer |
218 | to NULL. If an adapter algorithm can do SMBus access, set |
230 | to NULL. If an adapter algorithm can do SMBus access, set |
Line 228... | Line 240... | ||
228 | 240 | ||
229 | /* To determine what the adapter supports */ |
241 | /* To determine what the adapter supports */ |
230 | u32 (*functionality) (struct i2c_adapter *); |
242 | u32 (*functionality) (struct i2c_adapter *); |
Line -... | Line 243... | ||
- | 243 | }; |
|
- | 244 | ||
- | 245 | int i2c_recover_bus(struct i2c_adapter *adap); |
|
- | 246 | ||
- | 247 | /* Generic recovery routines */ |
|
- | 248 | int i2c_generic_gpio_recovery(struct i2c_adapter *adap); |
|
231 | }; |
249 | int i2c_generic_scl_recovery(struct i2c_adapter *adap); |
232 | 250 | ||
233 | /* |
251 | /* |
234 | * i2c_adapter is the structure used to identify a physical i2c bus along |
252 | * i2c_adapter is the structure used to identify a physical i2c bus along |
235 | * with the access algorithms necessary to access it. |
253 | * with the access algorithms necessary to access it. |