aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Monakov <amonakov@ispras.ru>2018-04-28 09:56:06 -0400
committerWolfram Sang <wsa@the-dreams.de>2018-05-10 06:30:20 -0400
commit06cb616b1bca7080824acfedb3d4c898e7a64836 (patch)
tree06acef331b438d39e151dd3b2ab909bbc5c0d690
parent4c0330208f6bfe5285bae239fdb2a7ec1ce1f78d (diff)
i2c: designware: fix poll-after-enable regression
Not all revisions of DW I2C controller implement the enable status register. On platforms where that's the case (e.g. BG2CD and SPEAr ARM SoCs), waiting for enable will time out as reading the unimplemented register yields zero. It was observed that reading the IC_ENABLE_STATUS register once suffices to avoid getting it stuck on Bay Trail hardware, so replace polling with one dummy read of the register. Fixes: fba4adbbf670 ("i2c: designware: must wait for enable") Signed-off-by: Alexander Monakov <amonakov@ispras.ru> Tested-by: Ben Gardner <gardner.ben@gmail.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
-rw-r--r--drivers/i2c/busses/i2c-designware-master.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c
index fd36c39ddf4e..0cdba29ae0a9 100644
--- a/drivers/i2c/busses/i2c-designware-master.c
+++ b/drivers/i2c/busses/i2c-designware-master.c
@@ -209,7 +209,10 @@ static void i2c_dw_xfer_init(struct dw_i2c_dev *dev)
209 i2c_dw_disable_int(dev); 209 i2c_dw_disable_int(dev);
210 210
211 /* Enable the adapter */ 211 /* Enable the adapter */
212 __i2c_dw_enable_and_wait(dev, true); 212 __i2c_dw_enable(dev, true);
213
214 /* Dummy read to avoid the register getting stuck on Bay Trail */
215 dw_readl(dev, DW_IC_ENABLE_STATUS);
213 216
214 /* Clear and enable interrupts */ 217 /* Clear and enable interrupts */
215 dw_readl(dev, DW_IC_CLR_INTR); 218 dw_readl(dev, DW_IC_CLR_INTR);