This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

i2c bus recovery with Linux DaVinci driver (i2c-davinci.c) - OMAP L138

Other Parts Discussed in Thread: OMAP-L138, DA8XX, OMAPL138

We have found the i2c-davinci driver in our Linux Kernel to lack proper bus recovery (i2c_recover_bus()) when an I2C device would lock the bus (holding SDA low). We are using the OMAP-L138. The function generic_i2c_clock_pulse() (in drivers/i2c/busses/i2c-davinci.c) does not recover the bus for us. This is probably due to it not having  control access of the SCL/SDA pins.

I have been doing some searching at I seems that Ben Gardiner has made a patch for using the ICPFUNC feature in the OMAP and that he has submitted his patches to lkml.org / patchwork.kernel.org ?.
One is found here ([4/6] i2c-davinci: use the DA8xx's ICPFUNC to toggle I2C as gpio)  https://patchwork.kernel.org/patch/688771/ 

I have tried the above patch and it works great on our board, and it seems to be implemented in the proper way (according to some application notes I have found online, not just clocking 9 times). I am just wondering why his patches have not found its way to the DaVinci GIT Linux Kernel?

Many thanks,

Mads

  • Hi Mads,

    Thanks for writing to us.

    Could you please share the PSP release version which you are referring.

    Those patches are may not be validated by TI. We will work with our PSP development team to resolve this.

  • Hi Rajasekaran,

    Thank you for looking into this.

    Well I was just web browsing the DaVinci Linux GIT (latest git version) directly - http://gitorious.org/linux-davinci/linux-davinci/blobs/master/drivers/i2c/busses/i2c-davinci.c

    I can't remember which version we are running, but both ours and the latest Git version of the i2c-davinci.c driver lacks (in my oppinion) a proper bus recovery for the OMAP-L138.

    I also cannot see how the driver can access the SCL/SDA pins as GPIO while they are configured (pinmuxed) for i2c operation? (not even sure that they are available as GPIO for the OMAPL138, except when using the ICPFUNC functionality of the i2c controller?)

    Best wishes,

    Mads

  • Hi again,

    I have read the above thread, Ben Gardiner is also appearing on the thread and I guess this is from when he started working on the patch that uses the proposed solution to access the SCL/SDA pins for bus recovery.

    But the fix didn't make it to the DaVinci GIT. 

    According to Ben Gardiner the patches didn't make it to the mainline because the maintainers wanted him to implement bus recovery as a genetic service for all controllers, which he probably didn't have time to do. This however does not make the fix less important.

    I guess our current problems are hardware related (we are current debugging this, since we are not seeing the error on all our boards). But the only way for us to recover (when not using the patch) is to do a complete powercycle, a reboot of the target does not fix this issue since our i2c devices are not reset at reboot. 

    Best regards,

    Mads