Hello,
Our AM335x is connected via i2c (bus 0) to audio codec. Occiasionally a i2c bus hang occurs like in the
Ti i2c tips is mentioned.
http://processors.wiki.ti.com/index.php/I2C_Tips#External_Slave_Device_Hanging_the_Bus_by_Holding_SDA_Low
This problem is only solved after power down / up. Rebooting linux does not resolve the problem.
A bus timout occurs in: drivers/i2c/busses/i2c-omap.c, function omap_i2c_wait_for_bb().
I do not have experience with i2c drivers so I am asking on some advice.
When that timeout is detected I want to toggle SCL via gpio to let the i2c slave device make the SDA line high.
Currently at the place of the timeout I change the i2c pins sda/scl to gpio, then I toggle scl by gpio_direction_output( ).
But then Kernel panic occerred.
My question: is there some example code or how/where to change the ic2 pins to gpio <--> i2c mode.
I can use gpio on i2c pins according our HW engineer.
Thanks in advance for your info.
Kind Regards
Teun Grinwis