From: Bjorn Andersson <bjorn.andersson@sonymobile.com>
To: Sagar Dharia <sdharia@codeaurora.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Gilad Avidov <gavidov@codeaurora.org>,
Wolfram Sang <wsa@the-dreams.de>
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
Courtney Cavin <courtney.cavin@sonymobile.com>
Subject: [PATCH 1/4] spmi: pmic-arb: add irq_get_irqchip_state implementation
Date: Thu, 18 Jun 2015 14:13:42 -0700 [thread overview]
Message-ID: <1434662025-9485-2-git-send-email-bjorn.andersson@sonymobile.com> (raw)
In-Reply-To: <1434662025-9485-1-git-send-email-bjorn.andersson@sonymobile.com>
Signed-off-by: Courtney Cavin <courtney.cavin@sonymobile.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
---
drivers/spmi/spmi-pmic-arb.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
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,
};
--
1.8.2.2
next prev parent reply other threads:[~2015-06-18 21:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-18 21:13 [PATCH 0/4] Qualcomm Switch-Mode Battery Charger and Boost Bjorn Andersson
2015-06-18 21:13 ` Bjorn Andersson [this message]
2015-07-27 5:34 ` [PATCH 1/4] spmi: pmic-arb: add irq_get_irqchip_state implementation Andy Gross
2015-06-18 21:13 ` [PATCH 2/4] dt-binding: power: Add Qualcomm SMBB binding Bjorn Andersson
2015-06-18 21:13 ` [PATCH 3/4] power: Add Qualcomm SMBB driver Bjorn Andersson
2015-06-19 17:01 ` Paul Bolle
2015-06-22 5:06 ` Bjorn Andersson
2015-07-25 15:42 ` Sebastian Reichel
2015-07-26 1:04 ` Bjorn Andersson
2015-07-27 14:06 ` Sebastian Reichel
2015-07-30 17:17 ` Bjorn Andersson
2015-06-18 21:13 ` [PATCH 4/4] ARM: dts: qcom-pm8941: Add charger node Bjorn Andersson
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=1434662025-9485-2-git-send-email-bjorn.andersson@sonymobile.com \
--to=bjorn.andersson@sonymobile.com \
--cc=courtney.cavin@sonymobile.com \
--cc=gavidov@codeaurora.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sdharia@codeaurora.org \
--cc=wsa@the-dreams.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox