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)
committerLuan Yuan <luan.yuan@amlogic.com>
Tue, 27 Nov 2018 03:18:15 +0000 (11:18 +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;