i2c: davinci: use ICPFUNC to toggle I2C as gpio for bus recovery
Having a board where the I2C bus locks up occasionally made it clear that the bus recovery in the i2c-davinci driver will only work on some boards, because on regular boards, this will only toggle GPIO lines that aren't muxed to the actual pins. The I2C controller on SoCs like da850 (and da830), Keystone 2 has the built-in capability to bit-bang its lines by using the ICPFUNC registers of the i2c controller. Implement the suggested procedure by toggling SCL and checking SDA using the ICPFUNC registers of the I2C controller when present. Allow platforms to indicate the presence of the ICPFUNC registers with a has_pfunc platform data flag and add optional DT property "ti,has-pfunc" to indicate the same in DT. Reviewed-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: NAlexander Sverdlin <alexander.sverdlin@nokia.com> Tested-by: NMichael Lawnick <michael.lawnick@nokia.com> Signed-off-by: NBen Gardiner <bengardiner@nanometrics.ca> Signed-off-by: NMike Looijmans <milo-software@users.sourceforge.net> [grygorii.strashko@ti.com: combined patches from Ben Gardiner and Mike Looijmans and reimplemented ICPFUNC bus recovery using I2C bus recovery infrastructure] Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
Showing
想要评论请 注册 或 登录