aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2013-05-12 20:54:30 -0400
committerWolfram Sang <wsa@the-dreams.de>2013-05-17 04:33:36 -0400
commit2a2d95e9d6d29e726cc294b65391917ed2e32bf4 (patch)
tree9552a4071ced670790ffc5986e168485bb380ecb
parente6f34cea56f5b95498070eaa9f4aa3ba4a9e4f62 (diff)
i2c: designware: always clear interrupts before enabling them
If the I2C bus is put to a low power state by an ACPI method it might pull the SDA line low (as its power is removed). Once the bus is put to full power state again, the SDA line is pulled back to high. This transition looks like a STOP condition from the controller point-of-view which sets STOP detected bit in its status register causing the driver to fail subsequent transfers. Fix this by always clearing all interrupts before we start a transfer. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
-rw-r--r--drivers/i2c/busses/i2c-designware-core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index 1f06c8e9934c..c41ca6354fc5 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -383,7 +383,8 @@ static void i2c_dw_xfer_init(struct dw_i2c_dev *dev)
383 /* Enable the adapter */ 383 /* Enable the adapter */
384 __i2c_dw_enable(dev, true); 384 __i2c_dw_enable(dev, true);
385 385
386 /* Enable interrupts */ 386 /* Clear and enable interrupts */
387 i2c_dw_clear_int(dev);
387 dw_writel(dev, DW_IC_INTR_DEFAULT_MASK, DW_IC_INTR_MASK); 388 dw_writel(dev, DW_IC_INTR_DEFAULT_MASK, DW_IC_INTR_MASK);
388} 389}
389 390