aboutsummaryrefslogtreecommitdiff
path: root/include/linux/platform_data/i2c-davinci.h
diff options
context:
space:
mode:
authorGrygorii Strashko2015-04-06 15:38:41 +0300
committerWolfram Sang2015-04-10 17:57:28 +0200
commit7ef97e9a312c359a2b32a7b5d918c60f238b69b2 (patch)
treeb0d9ee4ee17e5f7cbc99431701eb519aba7dc986 /include/linux/platform_data/i2c-davinci.h
parent2e65676f710e8feb9f76a7beee649b0e5ff95ca3 (diff)
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>
Diffstat (limited to 'include/linux/platform_data/i2c-davinci.h')
-rw-r--r--include/linux/platform_data/i2c-davinci.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/platform_data/i2c-davinci.h b/include/linux/platform_data/i2c-davinci.h
index 2312d197dfb7..89fd34727a24 100644
--- a/include/linux/platform_data/i2c-davinci.h
+++ b/include/linux/platform_data/i2c-davinci.h
@@ -18,6 +18,7 @@ struct davinci_i2c_platform_data {
unsigned int bus_delay; /* post-transaction delay (usec) */
unsigned int sda_pin; /* GPIO pin ID to use for SDA */
unsigned int scl_pin; /* GPIO pin ID to use for SCL */
+ bool has_pfunc; /*chip has a ICPFUNC register */
};
/* for board setup code */