All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: <dbaryshkov@gmail.com>, <dwmw2@infradead.org>
Cc: Linux OMAP Mailing List <linux-omap@vger.kernel.org>,
	Linux ARM Kernel Mailing List 
	<linux-arm-kernel@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Russell King <linux@arm.linux.org.uk>,
	Felipe Balbi <balbi@ti.com>
Subject: [PATCH] power: twl4030_charger: clear IRQs after handling them
Date: Wed, 16 Apr 2014 10:14:59 -0500	[thread overview]
Message-ID: <1397661299-31342-1-git-send-email-balbi@ti.com> (raw)

TRM says we *must* write 1 to each bit we're handling
in order to clear the IRQ status and bring IRQ line
low. This patch implements that.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---

Russell, I don't have HW to test, but this should
solve the problem you saw when not using battery
with Zoom board. Let me know if it doesn't.

cheers

 drivers/power/twl4030_charger.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c
index f141088..b090842 100644
--- a/drivers/power/twl4030_charger.c
+++ b/drivers/power/twl4030_charger.c
@@ -301,12 +301,24 @@ static irqreturn_t twl4030_bci_interrupt(int irq, void *arg)
 	ret = twl_i2c_read_u8(TWL4030_MODULE_INTERRUPTS, &irqs1,
 			      TWL4030_INTERRUPTS_BCIISR1A);
 	if (ret < 0)
-		return IRQ_HANDLED;
+		return IRQ_NONE;
+
+	/* clear IRQs early */
+	ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, irqs1,
+			TWL4030_INTERRUPTS_BCIISR1A);
+	if (ret < 0)
+		return IRQ_NONE;
 
 	ret = twl_i2c_read_u8(TWL4030_MODULE_INTERRUPTS, &irqs2,
 			      TWL4030_INTERRUPTS_BCIISR2A);
 	if (ret < 0)
-		return IRQ_HANDLED;
+		return IRQ_NONE;
+
+	/* clear IRQs early */
+	ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, irqs2,
+			      TWL4030_INTERRUPTS_BCIISR2A);
+	if (ret < 0)
+		return IRQ_NONE;
 
 	dev_dbg(bci->dev, "BCI irq %02x %02x\n", irqs2, irqs1);
 
-- 
1.9.1.286.g5172cb3


WARNING: multiple messages have this Message-ID (diff)
From: Felipe Balbi <balbi@ti.com>
To: dbaryshkov@gmail.com, dwmw2@infradead.org
Cc: Linux OMAP Mailing List <linux-omap@vger.kernel.org>,
	Linux ARM Kernel Mailing List
	<linux-arm-kernel@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Russell King <linux@arm.linux.org.uk>,
	Felipe Balbi <balbi@ti.com>
Subject: [PATCH] power: twl4030_charger: clear IRQs after handling them
Date: Wed, 16 Apr 2014 10:14:59 -0500	[thread overview]
Message-ID: <1397661299-31342-1-git-send-email-balbi@ti.com> (raw)

TRM says we *must* write 1 to each bit we're handling
in order to clear the IRQ status and bring IRQ line
low. This patch implements that.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---

Russell, I don't have HW to test, but this should
solve the problem you saw when not using battery
with Zoom board. Let me know if it doesn't.

cheers

 drivers/power/twl4030_charger.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c
index f141088..b090842 100644
--- a/drivers/power/twl4030_charger.c
+++ b/drivers/power/twl4030_charger.c
@@ -301,12 +301,24 @@ static irqreturn_t twl4030_bci_interrupt(int irq, void *arg)
 	ret = twl_i2c_read_u8(TWL4030_MODULE_INTERRUPTS, &irqs1,
 			      TWL4030_INTERRUPTS_BCIISR1A);
 	if (ret < 0)
-		return IRQ_HANDLED;
+		return IRQ_NONE;
+
+	/* clear IRQs early */
+	ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, irqs1,
+			TWL4030_INTERRUPTS_BCIISR1A);
+	if (ret < 0)
+		return IRQ_NONE;
 
 	ret = twl_i2c_read_u8(TWL4030_MODULE_INTERRUPTS, &irqs2,
 			      TWL4030_INTERRUPTS_BCIISR2A);
 	if (ret < 0)
-		return IRQ_HANDLED;
+		return IRQ_NONE;
+
+	/* clear IRQs early */
+	ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, irqs2,
+			      TWL4030_INTERRUPTS_BCIISR2A);
+	if (ret < 0)
+		return IRQ_NONE;
 
 	dev_dbg(bci->dev, "BCI irq %02x %02x\n", irqs2, irqs1);
 
-- 
1.9.1.286.g5172cb3

WARNING: multiple messages have this Message-ID (diff)
From: balbi@ti.com (Felipe Balbi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] power: twl4030_charger: clear IRQs after handling them
Date: Wed, 16 Apr 2014 10:14:59 -0500	[thread overview]
Message-ID: <1397661299-31342-1-git-send-email-balbi@ti.com> (raw)

TRM says we *must* write 1 to each bit we're handling
in order to clear the IRQ status and bring IRQ line
low. This patch implements that.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---

Russell, I don't have HW to test, but this should
solve the problem you saw when not using battery
with Zoom board. Let me know if it doesn't.

cheers

 drivers/power/twl4030_charger.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c
index f141088..b090842 100644
--- a/drivers/power/twl4030_charger.c
+++ b/drivers/power/twl4030_charger.c
@@ -301,12 +301,24 @@ static irqreturn_t twl4030_bci_interrupt(int irq, void *arg)
 	ret = twl_i2c_read_u8(TWL4030_MODULE_INTERRUPTS, &irqs1,
 			      TWL4030_INTERRUPTS_BCIISR1A);
 	if (ret < 0)
-		return IRQ_HANDLED;
+		return IRQ_NONE;
+
+	/* clear IRQs early */
+	ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, irqs1,
+			TWL4030_INTERRUPTS_BCIISR1A);
+	if (ret < 0)
+		return IRQ_NONE;
 
 	ret = twl_i2c_read_u8(TWL4030_MODULE_INTERRUPTS, &irqs2,
 			      TWL4030_INTERRUPTS_BCIISR2A);
 	if (ret < 0)
-		return IRQ_HANDLED;
+		return IRQ_NONE;
+
+	/* clear IRQs early */
+	ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, irqs2,
+			      TWL4030_INTERRUPTS_BCIISR2A);
+	if (ret < 0)
+		return IRQ_NONE;
 
 	dev_dbg(bci->dev, "BCI irq %02x %02x\n", irqs2, irqs1);
 
-- 
1.9.1.286.g5172cb3

             reply	other threads:[~2014-04-16 15:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16 15:14 Felipe Balbi [this message]
2014-04-16 15:14 ` [PATCH] power: twl4030_charger: clear IRQs after handling them Felipe Balbi
2014-04-16 15:14 ` Felipe Balbi
2014-04-16 16:35 ` Tony Lindgren
2014-04-16 16:35   ` Tony Lindgren
2014-04-16 16:35   ` Tony Lindgren
2014-04-25 20:58   ` Nishanth Menon
2014-04-25 20:58     ` Nishanth Menon
2014-04-25 20:58     ` Nishanth Menon
2014-04-25 21:00     ` Felipe Balbi
2014-04-25 21:00       ` Felipe Balbi
2014-04-25 21:00       ` Felipe Balbi
2014-05-07  0:24       ` Nishanth Menon
2014-05-07  0:24         ` Nishanth Menon
2014-05-07  0:24         ` Nishanth Menon
2014-05-09  1:03         ` Tony Lindgren
2014-05-09  1:03           ` Tony Lindgren
2014-05-09  1:03           ` Tony Lindgren
2014-05-09 12:39           ` Nishanth Menon
2014-05-09 12:39             ` Nishanth Menon
2014-05-09 12:39             ` Nishanth Menon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1397661299-31342-1-git-send-email-balbi@ti.com \
    --to=balbi@ti.com \
    --cc=dbaryshkov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.