PM_SUSPEND: suspend: set wakeup reason to stick mem [2/2]
authorHong Guo <hong.guo@amlogic.com>
Fri, 23 Nov 2018 02:34:07 +0000 (10:34 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Mon, 26 Nov 2018 04:09:47 +0000 (20:09 -0800)
PD#SWPL-2287

Problem:
set wakeup reason to stick mem

Solution:
set wakeup reason to stick mem

Verify:
gxl,test pass

Change-Id: Iff6f1824ea4ac9ec12b8295d4283992fdac03b14
Signed-off-by: Hong Guo <hong.guo@amlogic.com>
drivers/amlogic/pm/gx_pm.c

index d012ff1..8228001 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/amlogic/pm.h>
 #include <linux/kobject.h>
 #include <../kernel/power/power.h>
+#include <linux/amlogic/scpi_protocol.h>
 
 typedef unsigned long (psci_fn)(unsigned long, unsigned long,
                                unsigned long, unsigned long);
@@ -157,6 +158,8 @@ ssize_t suspend_reason_show(struct device *dev, struct device_attribute *attr,
 {
        unsigned int len;
 
+       if (scpi_get_wakeup_reason(&suspend_reason))
+               return -EPERM;
        len = sprintf(buf, "%d\n", suspend_reason);
 
        return len;