1STRUCT I2C_BUS_RECOV(9) I2C and SMBus Subsystem STRUCT I2C_BUS_RECOV(9)
2
3
4
6 struct_i2c_bus_recovery_info - I2C bus recovery information
7
9 struct i2c_bus_recovery_info {
10 int (* recover_bus) (struct i2c_adapter *);
11 int (* get_scl) (struct i2c_adapter *);
12 void (* set_scl) (struct i2c_adapter *, int val);
13 int (* get_sda) (struct i2c_adapter *);
14 void (* prepare_recovery) (struct i2c_adapter *);
15 void (* unprepare_recovery) (struct i2c_adapter *);
16 int scl_gpio;
17 int sda_gpio;
18 };
19
21 recover_bus
22 Recover routine. Either pass driver's recover_bus routine, or
23 i2c_generic_scl_recovery or i2c_generic_gpio_recovery.
24
25 get_scl
26 This gets current value of SCL line. Mandatory for generic SCL
27 recovery. Used internally for generic GPIO recovery.
28
29 set_scl
30 This sets/clears SCL line. Mandatory for generic SCL recovery. Used
31 internally for generic GPIO recovery.
32
33 get_sda
34 This gets current value of SDA line. Optional for generic SCL
35 recovery. Used internally, if sda_gpio is a valid GPIO, for generic
36 GPIO recovery.
37
38 prepare_recovery
39 This will be called before starting recovery. Platform may
40 configure padmux here for SDA/SCL line or something else they want.
41
42 unprepare_recovery
43 This will be called after completing recovery. Platform may
44 configure padmux here for SDA/SCL line or something else they want.
45
46 scl_gpio
47 gpio number of the SCL line. Only required for GPIO recovery.
48
49 sda_gpio
50 gpio number of the SDA line. Only required for GPIO recovery.
51
53Kernel Hackers Manual 3.10 June 2019 STRUCT I2C_BUS_RECOV(9)