diff mbox

[PATCHv2,1/4] spmi: pmic-arb: add support for irq_get_irqchip_state

Message ID 1438278837-29967-2-git-send-email-bjorn.andersson@sonymobile.com (mailing list archive)
State Accepted, archived
Delegated to: Andy Gross
Headers show

Commit Message

Bjorn Andersson July 30, 2015, 5:53 p.m. UTC
From: Courtney Cavin <courtney.cavin@sonymobile.com>

Reviewed-by: Andy Gross <agross@codeaurora.org>
Signed-off-by: Courtney Cavin <courtney.cavin@sonymobile.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
---

Changes since v1:
- Corrected authorship

 drivers/spmi/spmi-pmic-arb.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Comments

Tim Bird Aug. 4, 2015, 11:02 p.m. UTC | #1
On Sun, Jul 26, 2015 at 10:34 PM, Andy Gross <agross@codeaurora.org> wrote:
> On Thu, Jun 18, 2015 at 02:13:42PM -0700, Bjorn Andersson wrote:
>> Signed-off-by: Courtney Cavin <courtney.cavin@sonymobile.com>
>> Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
>> ---
>
> Looks good.
>
> Greg, can you pick this up?
>
> Reviewed-by: Andy Gross <agross@codeaurora.org>

I gave this (v2) a test with the USB driver, and it works great.  I'd
like to see this patch of the series go in soon, even if the rest of
the charger driver gets stalled for some reason.  This enables much
simpler ID pin handling for host mode for the USB driver.

FWIW...

Tested-by: Tim Bird <tim.bird@sonymobile.com>

 -- Tim Bird
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andy Gross Aug. 5, 2015, 4:12 p.m. UTC | #2
On Thu, Jul 30, 2015 at 10:53:54AM -0700, Bjorn Andersson wrote:
> From: Courtney Cavin <courtney.cavin@sonymobile.com>
> 
> Reviewed-by: Andy Gross <agross@codeaurora.org>
> Signed-off-by: Courtney Cavin <courtney.cavin@sonymobile.com>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
> ---
> 
> Changes since v1:
> - Corrected authorship
> 
>  drivers/spmi/spmi-pmic-arb.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)

Greg, can you pick this patch up?

Thanks!
diff mbox

Patch

diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
index d7119db49cfe..a4d8c043a710 100644
--- a/drivers/spmi/spmi-pmic-arb.c
+++ b/drivers/spmi/spmi-pmic-arb.c
@@ -575,6 +575,22 @@  static int qpnpint_irq_set_type(struct irq_data *d, unsigned int flow_type)
 	return 0;
 }
 
+static int qpnpint_get_irqchip_state(struct irq_data *d,
+				     enum irqchip_irq_state which,
+				     bool *state)
+{
+	u8 irq = d->hwirq >> 8;
+	u8 status = 0;
+
+	if (which != IRQCHIP_STATE_LINE_LEVEL)
+		return -EINVAL;
+
+	qpnpint_spmi_read(d, QPNPINT_REG_RT_STS, &status, 1);
+	*state = !!(status & BIT(irq));
+
+	return 0;
+}
+
 static struct irq_chip pmic_arb_irqchip = {
 	.name		= "pmic_arb",
 	.irq_enable	= qpnpint_irq_enable,
@@ -582,6 +598,7 @@  static struct irq_chip pmic_arb_irqchip = {
 	.irq_mask	= qpnpint_irq_mask,
 	.irq_unmask	= qpnpint_irq_unmask,
 	.irq_set_type	= qpnpint_irq_set_type,
+	.irq_get_irqchip_state	= qpnpint_get_irqchip_state,
 	.flags		= IRQCHIP_MASK_ON_SUSPEND
 			| IRQCHIP_SKIP_SET_WAKE,
 };