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

Message ID 20230712034755.2676008-1-peng.fan@oss.nxp.com
State New
Headers
Series mailbox: imx: Add support for identifying SCU wakeup source from sysfs |

Commit Message

Peng Fan (OSS) July 12, 2023, 3:47 a.m. UTC
  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(-)
  

Patch

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;
 }