Re: [PATCH 3/3] gpio: brcmstb: allow parent_irq to wake
From: Florian Fainelli <florian.fainelli@broadcom.com>
Date: 2026-01-22 19:24:46
Also in:
linux-gpio, lkml
On 1/21/2026 11:42 PM, Andy Shevchenko wrote:
On Thu, Jan 22, 2026 at 3:06 AM Florian Fainelli [off-list ref] wrote:quoted
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.quoted
Signed-off-by: Doug Berger <opendmb@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.
quoted
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>...quoted
+ 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.
quoted
+ priv->suspended = false; + pm_wakeup_event(&priv->pdev->dev, 0); + }...quoted
static void brcmstb_gpio_shutdown(struct platform_device *pdev) { + struct brcmstb_gpio_priv *priv = dev_get_drvdata(&pdev->dev);quoted
+ /* disable interrupts */A useless comment.
Indeed.
quoted
+ 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); }...quoted
static const struct dev_pm_ops brcmstb_gpio_pm_ops = {quoted
+ .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