[PATCH] mailbox: imx: Add support for identifying SCU wakeup source from sysfs

Peng Fan (OSS) posted 1 patch 2 years, 7 months ago
drivers/mailbox/imx-mailbox.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
[PATCH] mailbox: imx: Add support for identifying SCU wakeup source from sysfs
Posted by Peng Fan (OSS) 2 years, 7 months ago
From: Peng Fan <peng.fan@nxp.com>

Record SCU wakeup interrupt in /sys/power/pm_wakeup_irq by using
pm_system_wakeup_irq

Signed-off-by: Ranjani Vaidyanathan <ranjani.vaidyanathan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/mailbox/imx-mailbox.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c
index 20f2ec880ad6..0719b9cfba97 100644
--- a/drivers/mailbox/imx-mailbox.c
+++ b/drivers/mailbox/imx-mailbox.c
@@ -531,8 +531,12 @@ static irqreturn_t imx_mu_isr(int irq, void *p)
 		return IRQ_NONE;
 	}
 
-	if (priv->suspend)
-		pm_system_wakeup();
+	if (priv->suspend) {
+		if (priv->dcfg->type & IMX_MU_V2_IRQ)
+			pm_system_wakeup();
+		else
+			pm_system_irq_wakeup(priv->irq[0]);
+	}
 
 	return IRQ_HANDLED;
 }
-- 
2.37.1