/* bus recovery specific initialization */ /*初始化sda、scl,通常这两个引脚会复用gpio引脚*/ if (adap->bus_recovery_info) { struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; if (!bri->recover_bus) { dev_err(&adap->dev, "No recover_bus() found, not using recovery\n")...
/* bus recovery specific initialization */ /*初始化sda、scl,通常这两个引脚会复用gpio引脚*/ if (adap-》bus_recovery_info) { struct i2c_bus_recovery_info *bri = adap-》bus_recovery_info; if (!bri-》recover_bus) { dev_err(&adap-》dev, “No recover_bus() found, not using recovery ...
structi2c_bus_recovery_info*bri=adap->bus_recovery_info; if(!bri->recover_bus) { dev_err(&adap->dev,"No recover_bus() found, not using recovery\n"); adap->bus_recovery_info =NULL; gotoexit_recovery; } /* Generic GPIO recovery */ if(bri->recover_bus == i2c_generic_gpio_recover...
612 int (*recover_bus)(struct i2c_adapter *adap); /* recovery的主函数,可以是驱动自己定义的,也可以用genetic的函数:i2c_generic_scl_recovery */ 613 614 int (*get_scl)(struct i2c_adapter *adap); /* 获得当前SCL线的电平状态,如果使用generic scl recovery,这个方法必须要指定 */ 615 void (*...
/* bus recovery specific initialization */ /*初始化sda、scl,通常这两个引脚会复用gpio引脚*/ if (adap->bus_recovery_info) { struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; if (!bri->recover_bus) { dev_err(&adap->dev, "No recover_bus() found, not using recovery ")...
To complement the above: the I2C communication works fine, as well as the called I2C_scan. It is only after a reset that SDA might hang low and that I can't recover fully from an SDA line stuck low by software. I get the line high again but cannot get I2C working again without pul...
gpio_direction_output(I2C_BUS_CLK, 0); } i2c_err("try to recover i2c bus, retry times are %d\n",counter); if (counter < 10) { udelay(5); gpio_direction_output(I2C_BUS_DATA, 0); udelay(5); gpio_direction_output(I2C_BUS_CLK, 1); ...
#endif /* bus recovery specific initialization */ /*初始化sda、scl,通常这两个引脚会复用gpio引脚*/ if (adap->bus_recovery_info) { struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; if (!bri->recover_bus) { dev_err(&adap->dev, "No recover_bus() found, not using recove...
bus_for_each_drv:匹配机制。遍历整个driver链表,进行i2c_client与i2c_driver的匹配工作 代码语言:javascript 代码运行次数:0 复制 Cloud Studio代码运行 intbus_for_each_drv(struct bus_type*bus,struct device_driver*start,void*data,int(*fn)(struct device_driver*,void*)){while((drv=next_driver(&i))...
(I2C_BUS_CLK, 1); udelay(5); gpio_direction_output(I2C_BUS_DATA, 1); msleep(10); } else { i2c_err("try to recover i2c busfailed!\n"); } } gpio_free(I2C_BUS_DATA); gpio_free(I2C_BUS_CLK); return0; } Write功能的实际实现原理如图3所示: (1)设置GPIO的相关引脚为IIC输出; (2...