i2c: davinci: use bus recovery infrastructure
authorGrygorii Strashko <grygorii.strashko@ti.com>
Mon, 6 Apr 2015 12:38:40 +0000 (15:38 +0300)
committerWolfram Sang <wsa@the-dreams.de>
Fri, 10 Apr 2015 15:56:27 +0000 (17:56 +0200)
commit2e65676f710e8feb9f76a7beee649b0e5ff95ca3
tree502ff002d2d97ad799d0eb443fe0c52130e36fb8
parent2b2190a375d796a5ad9ec557cb51269f36b264d4
i2c: davinci: use bus recovery infrastructure

This patch converts Davinci I2C driver to use I2C bus recovery
infrastructure, introduced by commit 5f9296ba21b3 ("i2c: Add
bus recovery infrastructure").

The i2c_bus_recovery_info is configured for Davinci I2C adapter
only in case scl_pin is provided in platform data.

As the controller must be held in reset while doing so, the
recovery routine must re-init the controller. Since this was already
being done after each call to i2c_recover_bus, move those calls into
the recovery_prepare/unprepare routines and as well.

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-davinci.c