OSDN Git Service

i2c: imx: implement bus recovery
authorGao Pan <b54642@freescale.com>
Fri, 23 Oct 2015 12:28:54 +0000 (20:28 +0800)
committerWolfram Sang <wsa@the-dreams.de>
Fri, 23 Oct 2015 19:55:50 +0000 (21:55 +0200)
commit1c4b6c3bcf30d0804db0d0647d8ebeb862c6f7e5
treea8773ecfa4e4f91be9bb41335d8326f78390fedb
parent3861841d2205714bfabaee4efcbb5e4202884852
i2c: imx: implement bus recovery

Implement bus recovery methods for i2c-imx so we can recover from
situations where SCL/SDA are stuck low.

Once i2c bus SCL/SDA are stuck low during transfer, config the i2c
pinctrl to gpio mode by calling pinctrl sleep set function, and then
use GPIO to emulate the i2c protocol to send nine dummy clock to recover
i2c device. After recovery, set i2c pinctrl to default group setting.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Gao Pan <b54642@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Documentation/devicetree/bindings/i2c/i2c-imx.txt
drivers/i2c/busses/i2c-imx.c