Quoting Deepak Kumar Singh (2021-08-05 09:17:33)
Some use cases require SMP2P interrupts to wake up the hostPlease elaborate on this point so we understand what sort of scenarios
from suspend.
want to wakeup from suspend.
yes, we want smp2p to be wake up capable by default.Mark smp2p interrupt as wakeup capable to abortIs smp2p supposed to wake up the device by default? If not, then this
the suspend.
Signed-off-by: Deepak Kumar Singh <deesin@xxxxxxxxxxxxxx>
---
drivers/soc/qcom/smp2p.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c
index 2df4883..f8659b0 100644
--- a/drivers/soc/qcom/smp2p.c
+++ b/drivers/soc/qcom/smp2p.c
@@ -18,6 +18,7 @@
#include <linux/soc/qcom/smem.h>
#include <linux/soc/qcom/smem_state.h>
#include <linux/spinlock.h>
+#include <linux/pm_wakeirq.h>
/*
* The Shared Memory Point to Point (SMP2P) protocol facilitates communication
@@ -538,9 +539,19 @@ static int qcom_smp2p_probe(struct platform_device *pdev)
goto unwind_interfaces;
}
+ ret = device_init_wakeup(&pdev->dev, true);
should be device_set_wakeup_capable() instead so that userspace can
decide if it wants to get the wakeup.
+ if (ret)Otherwise this looks good to me.
+ goto unwind_interfaces;
+
+ ret = dev_pm_set_wake_irq(&pdev->dev, irq);
+ if (ret)
+ goto set_wakeup_failed;
return 0;
+set_wakeup_failed:
+ device_init_wakeup(&pdev->dev, false);
+
unwind_interfaces:
list_for_each_entry(entry, &smp2p->inbound, node)
irq_domain_remove(entry->domain);