[PATCH 3/3] gpio: brcmstb: allow parent_irq to wake
Florian Fainelli
florian.fainelli at broadcom.com
Thu Jan 22 11:24:35 PST 2026
On 1/21/2026 11:42 PM, Andy Shevchenko wrote:
> On Thu, Jan 22, 2026 at 3:06 AM Florian Fainelli
> <florian.fainelli at broadcom.com> wrote:
>
>> The classic parent_wake_irq can only occur after the system has
>> been placed into a hardware managed power management state. This
>> prevents its use for waking from software managed suspend states
>> like s2idle.
>>
>> By allowing the parent_irq to be enabled for wake enabled GPIO
>> during suspend, these GPIO can now be used to wake from these
>> states. The 'suspended' boolean is introduced to support wake
>> event accounting.
>
>> Signed-off-by: Doug Berger <opendmb at gmail.com>
>> [florian: port changes after generic gpio chip conversion]
>
> Likewise in the previous patch I think this deserves the Co-developed-by tag.
OK.
>
>> Signed-off-by: Florian Fainelli <florian.fainelli at broadcom.com>
>
> ...
>
>> + if (priv->suspended && bank->wake_active & (u32)status) {
>
> Why casting?
status is an unsigned long, which is what for_each_set_bit() expects, so
it is intended here to ensure the top bits are not participating in the
comparison, I think this is just being extra explicit with intent here.
>
>> + priv->suspended = false;
>> + pm_wakeup_event(&priv->pdev->dev, 0);
>> + }
>
> ...
>
>> static void brcmstb_gpio_shutdown(struct platform_device *pdev)
>> {
>> + struct brcmstb_gpio_priv *priv = dev_get_drvdata(&pdev->dev);
>
>> + /* disable interrupts */
>
> A useless comment.
Indeed.
>
>> + if (priv->parent_irq > 0)
>> + disable_irq(priv->parent_irq);
>> +
>> /* Enable GPIO for S5 cold boot */
>> - brcmstb_gpio_quiesce(&pdev->dev, false);
>> + brcmstb_gpio_quiesce(priv, false);
>> }
>
> ...
>
>> static const struct dev_pm_ops brcmstb_gpio_pm_ops = {
>
>> + .suspend_noirq = pm_sleep_ptr(brcmstb_gpio_suspend_noirq),
>> .resume_noirq = pm_sleep_ptr(brcmstb_gpio_resume),
>
> May we use one of the PM macros for these two assignments?
Sure, can do that!
--
Florian
More information about the linux-arm-kernel
mailing list