Skip to content
Commit 7ef97e9a authored by Grygorii Strashko's avatar Grygorii Strashko Committed by Wolfram Sang
Browse files

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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: default avatarAlexander Sverdlin <alexander.sverdlin@nokia.com>
Tested-by: default avatarMichael Lawnick <michael.lawnick@nokia.com>
Signed-off-by: default avatarBen Gardiner <bengardiner@nanometrics.ca>
Signed-off-by: default avatarMike 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: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 2e65676f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment