firmware: imx: scu-irq: support identifying SCU wakeup source from sysfs
authorRanjani Vaidyanathan <ranjani.vaidyanathan@nxp.com>
Mon, 7 Aug 2023 12:14:32 +0000 (20:14 +0800)
committerShawn Guo <shawnguo@kernel.org>
Fri, 11 Aug 2023 14:14:10 +0000 (22:14 +0800)
commitc081197a33a2813881b534c44666024c97fb025d
tree89e83b4a70546a5d8c301eaaf549603e5a643330
parent6c59ce485fd0015db160b913903c5f1e8c586d38
firmware: imx: scu-irq: support identifying SCU wakeup source from sysfs

Record SCU wakeup interrupt in /sys/power/pm_wakeup_irq
The user can further identify the exact wakeup source by using the
following interface:
cat /sys/firmware/scu_wakeup_source/wakeup_src

The above will print the wake groups and the irqs that could have
contributed to waking up the kernel. For example if ON/OFF button was the
wakeup source:
cat /sys/firmware/scu_wakeup_source/wakeup_src
Wakeup source group = 3, irq = 0x1

The user can refer to the SCFW API documentation to identify all the
wake groups and irqs.

Signed-off-by: Ranjani Vaidyanathan <ranjani.vaidyanathan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
drivers/firmware/imx/imx-scu-irq.c