summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorDavid Jander <david@xxxxxxxxxxx>2011-12-06 12:56:12 +0100
committerJohn Weber <rjohnweber@gmail.com>2013-07-28 23:44:59 -0500
commit29c8561c8d6d248f2b6726384815a136c2fbd859 (patch)
treee0feb3181d675b109e16e97433f90899c2e1fae7 /arch
parent5ff30ca8128bb3840350e5902ac68246fbc2aa21 (diff)
[RFC PATCH] i2c-imx.c: Add support for I2C bus fault recovery
In the event that a I2C bus is disturbed, for instance by a slave missing a clock pulse, it is desirable to have a way to get the bus back working other than by power-cycling the whole system. This patch makes it possible to to have a special function in board support code issue an I2C reset, since the IMX peripheral is not capable of doing this, and it needs to be done by bit-banging the corresponding pins in GPIO mode. The reset function needs to check if the bus is hung by checking the state of SDA and issue a reset by pulsing SCL a few times as long as SDA is low. Signed-off-by: David Jander <david@xxxxxxxxxxx> Conflicts: drivers/i2c/busses/i2c-imx.c (cherry picked from commit c1c409c8e9f96e1bd16717733c7456497b42d558)
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/plat-mxc/include/mach/i2c.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/include/mach/i2c.h b/arch/arm/plat-mxc/include/mach/i2c.h
index 4a5dc5c6d8e8..7ed4f64c86a2 100644
--- a/arch/arm/plat-mxc/include/mach/i2c.h
+++ b/arch/arm/plat-mxc/include/mach/i2c.h
@@ -13,12 +13,14 @@
* struct imxi2c_platform_data - structure of platform data for MXC I2C driver
* @init: Initialise gpio's and other board specific things
* @exit: Free everything initialised by @init
+ * @reset: Issue I2C reset if needed (toggle SCL via GPIO access)
* @bitrate: Bus speed measured in Hz
*
**/
struct imxi2c_platform_data {
int (*init)(struct device *dev);
void (*exit)(struct device *dev);
+ int (*reset)(struct device *dev);
int bitrate;
};