]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
i2c: davinci: use ICPFUNC to toggle I2C as gpio for bus recovery
authorGrygorii Strashko <grygorii.strashko@ti.com>
Mon, 6 Apr 2015 12:38:41 +0000 (15:38 +0300)
committerWolfram Sang <wsa@the-dreams.de>
Fri, 10 Apr 2015 15:57:28 +0000 (17:57 +0200)
commit7ef97e9a312c359a2b32a7b5d918c60f238b69b2
treeb0d9ee4ee17e5f7cbc99431701eb519aba7dc986
parent2e65676f710e8feb9f76a7beee649b0e5ff95ca3
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: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Tested-by: Michael Lawnick <michael.lawnick@nokia.com>
Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Signed-off-by: Mike 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: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Documentation/devicetree/bindings/i2c/i2c-davinci.txt
drivers/i2c/busses/i2c-davinci.c
include/linux/platform_data/i2c-davinci.h