* [PATCH] pinctrl: qcom: Add irq_get/set_irqchip_state() for msm gpio irqchip
@ 2026-04-24 6:31 Sneh Mankad
2026-04-28 9:58 ` Linus Walleij
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Sneh Mankad @ 2026-04-24 6:31 UTC (permalink / raw)
To: Bjorn Andersson, Linus Walleij
Cc: linux-arm-msm, linux-gpio, linux-kernel, Maulik Shah, Sneh Mankad
From: Maulik Shah <maulik.shah@oss.qualcomm.com>
MPM irqchip monitors the interrupts during SoC sleep state and after wakeup
replays the edge interrupt by making it pending at respective irqchip by
invoking irq_set_irqchip_state() API. The msm gpio irqchip however do not
implement this function making it impossible to replay the gpio interrupt
on any MPM irqchip based SoC.
Add the missing irq_get/set_irqchip_state() APIs. Implement only
IRQCHIP_STATE_PENDING case which MPM irqchip uses.
Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
Signed-off-by: Sneh Mankad <sneh.mankad@oss.qualcomm.com>
---
drivers/pinctrl/qcom/pinctrl-msm.c | 39 ++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index 45b3a2763eb85405fecdd4770ba3d4ab684563f0..925fca82252413d8e21fb47a0cc3a9ade7d5fe67 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -1305,6 +1305,43 @@ static int msm_gpio_irq_set_affinity(struct irq_data *d,
return -EINVAL;
}
+static int msm_gpio_irq_set_irqchip_state(struct irq_data *d,
+ enum irqchip_irq_state which, bool val)
+{
+ struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
+ struct msm_pinctrl *pctrl = gpiochip_get_data(gc);
+ const struct msm_pingroup *g = &pctrl->soc->groups[d->hwirq];
+
+ if (which != IRQCHIP_STATE_PENDING)
+ return -EINVAL;
+
+ if (test_bit(d->hwirq, pctrl->skip_wake_irqs))
+ return -EINVAL;
+
+ msm_writel_intr_status(val, pctrl, g);
+
+ return 0;
+}
+
+static int msm_gpio_irq_get_irqchip_state(struct irq_data *d,
+ enum irqchip_irq_state which, bool *val)
+{
+ struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
+ struct msm_pinctrl *pctrl = gpiochip_get_data(gc);
+ const struct msm_pingroup *g = &pctrl->soc->groups[d->hwirq];
+
+ if (which != IRQCHIP_STATE_PENDING)
+ return -EINVAL;
+
+ if (test_bit(d->hwirq, pctrl->skip_wake_irqs))
+ return -EINVAL;
+
+ g = &pctrl->soc->groups[d->hwirq];
+ *val = msm_readl_intr_status(pctrl, g);
+
+ return 0;
+}
+
static int msm_gpio_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu_info)
{
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
@@ -1393,6 +1430,8 @@ static const struct irq_chip msm_gpio_irq_chip = {
.irq_request_resources = msm_gpio_irq_reqres,
.irq_release_resources = msm_gpio_irq_relres,
.irq_set_affinity = msm_gpio_irq_set_affinity,
+ .irq_set_irqchip_state = msm_gpio_irq_set_irqchip_state,
+ .irq_get_irqchip_state = msm_gpio_irq_get_irqchip_state,
.irq_set_vcpu_affinity = msm_gpio_irq_set_vcpu_affinity,
.flags = (IRQCHIP_MASK_ON_SUSPEND |
IRQCHIP_SET_TYPE_MASKED |
---
base-commit: b4e07588e743c989499ca24d49e752c074924a9a
change-id: 20260424-pinctrl_irqchip_states-aae4f32f9f6e
Best regards,
--
Sneh Mankad <sneh.mankad@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] pinctrl: qcom: Add irq_get/set_irqchip_state() for msm gpio irqchip
2026-04-24 6:31 [PATCH] pinctrl: qcom: Add irq_get/set_irqchip_state() for msm gpio irqchip Sneh Mankad
@ 2026-04-28 9:58 ` Linus Walleij
2026-07-16 11:10 ` Navya Malempati
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2026-04-28 9:58 UTC (permalink / raw)
To: Sneh Mankad
Cc: Bjorn Andersson, linux-arm-msm, linux-gpio, linux-kernel, Maulik Shah
On Fri, Apr 24, 2026 at 8:31 AM Sneh Mankad
<sneh.mankad@oss.qualcomm.com> wrote:
> From: Maulik Shah <maulik.shah@oss.qualcomm.com>
>
> MPM irqchip monitors the interrupts during SoC sleep state and after wakeup
> replays the edge interrupt by making it pending at respective irqchip by
> invoking irq_set_irqchip_state() API. The msm gpio irqchip however do not
> implement this function making it impossible to replay the gpio interrupt
> on any MPM irqchip based SoC.
>
> Add the missing irq_get/set_irqchip_state() APIs. Implement only
> IRQCHIP_STATE_PENDING case which MPM irqchip uses.
>
> Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
> Signed-off-by: Sneh Mankad <sneh.mankad@oss.qualcomm.com>
That looks smart and also super dangerous so I need more Qualcomm
maintainers to review this and ACK/Test it before I dare to merge it.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] pinctrl: qcom: Add irq_get/set_irqchip_state() for msm gpio irqchip
2026-04-24 6:31 [PATCH] pinctrl: qcom: Add irq_get/set_irqchip_state() for msm gpio irqchip Sneh Mankad
2026-04-28 9:58 ` Linus Walleij
@ 2026-07-16 11:10 ` Navya Malempati
2026-07-24 22:00 ` Linus Walleij
2026-07-27 14:24 ` Bartosz Golaszewski
3 siblings, 0 replies; 5+ messages in thread
From: Navya Malempati @ 2026-07-16 11:10 UTC (permalink / raw)
To: Sneh Mankad, Bjorn Andersson, Linus Walleij
Cc: linux-arm-msm, linux-gpio, linux-kernel, Maulik Shah
On 4/24/2026 12:01 PM, Sneh Mankad wrote:
> From: Maulik Shah <maulik.shah@oss.qualcomm.com>
>
> MPM irqchip monitors the interrupts during SoC sleep state and after wakeup
> replays the edge interrupt by making it pending at respective irqchip by
> invoking irq_set_irqchip_state() API. The msm gpio irqchip however do not
> implement this function making it impossible to replay the gpio interrupt
> on any MPM irqchip based SoC.
>
> Add the missing irq_get/set_irqchip_state() APIs. Implement only
> IRQCHIP_STATE_PENDING case which MPM irqchip uses.
>
> Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
> Signed-off-by: Sneh Mankad <sneh.mankad@oss.qualcomm.com>
Reviewed-by: Navya Malempati <navya.malempati@oss.qualcomm.com>
Thanks,
Navya
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] pinctrl: qcom: Add irq_get/set_irqchip_state() for msm gpio irqchip
2026-04-24 6:31 [PATCH] pinctrl: qcom: Add irq_get/set_irqchip_state() for msm gpio irqchip Sneh Mankad
2026-04-28 9:58 ` Linus Walleij
2026-07-16 11:10 ` Navya Malempati
@ 2026-07-24 22:00 ` Linus Walleij
2026-07-27 14:24 ` Bartosz Golaszewski
3 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2026-07-24 22:00 UTC (permalink / raw)
To: Sneh Mankad, Bartosz Golaszewski
Cc: Bjorn Andersson, linux-arm-msm, linux-gpio, linux-kernel, Maulik Shah
On Fri, Apr 24, 2026 at 8:31 AM Sneh Mankad
<sneh.mankad@oss.qualcomm.com> wrote:
> From: Maulik Shah <maulik.shah@oss.qualcomm.com>
>
> MPM irqchip monitors the interrupts during SoC sleep state and after wakeup
> replays the edge interrupt by making it pending at respective irqchip by
> invoking irq_set_irqchip_state() API. The msm gpio irqchip however do not
> implement this function making it impossible to replay the gpio interrupt
> on any MPM irqchip based SoC.
>
> Add the missing irq_get/set_irqchip_state() APIs. Implement only
> IRQCHIP_STATE_PENDING case which MPM irqchip uses.
>
> Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
> Signed-off-by: Sneh Mankad <sneh.mankad@oss.qualcomm.com>
This needs to be queued by Bartosz now that he's maintaining
Qcom pinctrl.
FWIW
Acked-by: Linus Walleij <linusw@kernel.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] pinctrl: qcom: Add irq_get/set_irqchip_state() for msm gpio irqchip
2026-04-24 6:31 [PATCH] pinctrl: qcom: Add irq_get/set_irqchip_state() for msm gpio irqchip Sneh Mankad
` (2 preceding siblings ...)
2026-07-24 22:00 ` Linus Walleij
@ 2026-07-27 14:24 ` Bartosz Golaszewski
3 siblings, 0 replies; 5+ messages in thread
From: Bartosz Golaszewski @ 2026-07-27 14:24 UTC (permalink / raw)
To: Bjorn Andersson, Linus Walleij, Sneh Mankad
Cc: Bartosz Golaszewski, linux-arm-msm, linux-gpio, linux-kernel,
Maulik Shah
On Fri, 24 Apr 2026 12:01:24 +0530, Sneh Mankad wrote:
> MPM irqchip monitors the interrupts during SoC sleep state and after wakeup
> replays the edge interrupt by making it pending at respective irqchip by
> invoking irq_set_irqchip_state() API. The msm gpio irqchip however do not
> implement this function making it impossible to replay the gpio interrupt
> on any MPM irqchip based SoC.
>
> Add the missing irq_get/set_irqchip_state() APIs. Implement only
> IRQCHIP_STATE_PENDING case which MPM irqchip uses.
>
> [...]
Applied, thanks!
[1/1] pinctrl: qcom: Add irq_get/set_irqchip_state() for msm gpio irqchip
https://git.kernel.org/brgl/c/1860fb0be224dec0e4d170f46d1cbbc77e25e09e
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-07-27 14:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-24 6:31 [PATCH] pinctrl: qcom: Add irq_get/set_irqchip_state() for msm gpio irqchip Sneh Mankad
2026-04-28 9:58 ` Linus Walleij
2026-07-16 11:10 ` Navya Malempati
2026-07-24 22:00 ` Linus Walleij
2026-07-27 14:24 ` Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®