All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] i2c-designware: always clear interrupts before enabling them
@ 2013-05-13 10:54 ` Mika Westerberg
  0 siblings, 0 replies; 6+ messages in thread
From: Mika Westerberg @ 2013-05-13 10:54 UTC (permalink / raw)
  To: linux-i2c; +Cc: Wolfram Sang, Mika Westerberg, linux-kernel

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>
---
 drivers/i2c/busses/i2c-designware-core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index 21fbb34..7a89ca5 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)
 	/* Enable the adapter */
 	__i2c_dw_enable(dev, true);
 
-	/* Enable interrupts */
+	/* Clear and enable interrupts */
+	i2c_dw_clear_int(dev);
 	dw_writel(dev, DW_IC_INTR_DEFAULT_MASK, DW_IC_INTR_MASK);
 }
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 1/2] i2c-designware: always clear interrupts before enabling them
@ 2013-05-13 10:54 ` Mika Westerberg
  0 siblings, 0 replies; 6+ messages in thread
From: Mika Westerberg @ 2013-05-13 10:54 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: Wolfram Sang, Mika Westerberg, linux-kernel-u79uwXL29TY76Z2rM5mHXA

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-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
 drivers/i2c/busses/i2c-designware-core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index 21fbb34..7a89ca5 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)
 	/* Enable the adapter */
 	__i2c_dw_enable(dev, true);
 
-	/* Enable interrupts */
+	/* Clear and enable interrupts */
+	i2c_dw_clear_int(dev);
 	dw_writel(dev, DW_IC_INTR_DEFAULT_MASK, DW_IC_INTR_MASK);
 }
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] i2c-designware: add Intel BayTrail ACPI ID
  2013-05-13 10:54 ` Mika Westerberg
  (?)
@ 2013-05-13 10:54 ` Mika Westerberg
  2013-05-17  8:31   ` Wolfram Sang
  -1 siblings, 1 reply; 6+ messages in thread
From: Mika Westerberg @ 2013-05-13 10:54 UTC (permalink / raw)
  To: linux-i2c; +Cc: Wolfram Sang, Mika Westerberg, linux-kernel

This is the same controller as on Intel Lynxpoint but the ACPI ID is
different (8086F41). Add support for this.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/i2c/busses/i2c-designware-platdrv.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 8ec9133..35b70a1 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -69,6 +69,7 @@ static int dw_i2c_acpi_configure(struct platform_device *pdev)
 static const struct acpi_device_id dw_i2c_acpi_match[] = {
 	{ "INT33C2", 0 },
 	{ "INT33C3", 0 },
+	{ "80860F41", 0 },
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, dw_i2c_acpi_match);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] i2c-designware: always clear interrupts before enabling them
@ 2013-05-17  8:31   ` Wolfram Sang
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2013-05-17  8:31 UTC (permalink / raw)
  To: Mika Westerberg; +Cc: linux-i2c, linux-kernel

On Mon, May 13, 2013 at 01:54:30PM +0300, Mika Westerberg wrote:
> 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>

Applied to for-current, thanks! Added stable, too.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] i2c-designware: always clear interrupts before enabling them
@ 2013-05-17  8:31   ` Wolfram Sang
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2013-05-17  8:31 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Mon, May 13, 2013 at 01:54:30PM +0300, Mika Westerberg wrote:
> 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-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>

Applied to for-current, thanks! Added stable, too.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] i2c-designware: add Intel BayTrail ACPI ID
  2013-05-13 10:54 ` [PATCH 2/2] i2c-designware: add Intel BayTrail ACPI ID Mika Westerberg
@ 2013-05-17  8:31   ` Wolfram Sang
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2013-05-17  8:31 UTC (permalink / raw)
  To: Mika Westerberg; +Cc: linux-i2c, linux-kernel

On Mon, May 13, 2013 at 01:54:31PM +0300, Mika Westerberg wrote:
> This is the same controller as on Intel Lynxpoint but the ACPI ID is
> different (8086F41). Add support for this.
> 
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Applied to for-current, thanks!


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-05-17  8:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-13 10:54 [PATCH 1/2] i2c-designware: always clear interrupts before enabling them Mika Westerberg
2013-05-13 10:54 ` Mika Westerberg
2013-05-13 10:54 ` [PATCH 2/2] i2c-designware: add Intel BayTrail ACPI ID Mika Westerberg
2013-05-17  8:31   ` Wolfram Sang
2013-05-17  8:31 ` [PATCH 1/2] i2c-designware: always clear interrupts before enabling them Wolfram Sang
2013-05-17  8:31   ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.