/* 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 ...
If you think this issue should be handled differently, such as requiring the user to manually call the bus recovery function in their application, and this PR doesn't align with that, feel free to close it. In our downstream, we recover the I2C busses from the early board initialization ...
/* 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")...
gpio_request(I2C_BUS_CLK, "gpioxx"); /* try to recover I2C bus */ gpio_direction_input(I2C_BUS_DATA); if (!__gpio_get_value(I2C_BUS_DATA)) { while((!__gpio_get_value(I2C_BUS_DATA)) && ++counter < 10) { udelay(5); gpio_direction_output(I2C_BUS_CLK, 1); udelay(5); g...
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,这个方法必须要指定 */ ...
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 */ ...
/* 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...
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...