Skip to content
Commit 5f9296ba authored by Viresh Kumar's avatar Viresh Kumar Committed by Wolfram Sang
Browse files

i2c: Add bus recovery infrastructure

Add i2c bus recovery infrastructure to i2c adapters as specified in the i2c
protocol Rev. 03 section 3.1.16 titled "Bus clear".

http://www.nxp.com/documents/user_manual/UM10204.pdf



Sometimes during operation i2c bus hangs and we need to give dummy clocks to
slave device to start the transfer again. Now we may have capability in the bus
controller to generate these clocks or platform may have gpio pins which can be
toggled to generate dummy clocks. This patch supports both.

This patch also adds in generic bus recovery routines gpio or scl line based
which can be used by bus controller. In addition controller driver may provide
its own version of the bus recovery routine.

This doesn't support multi-master recovery for now.

Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
[wsa: changed gpio type to int and minor reformatting]
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent ee5c2744
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