Revert "Revert "display: enable auto sleep for suspend mode"" 75/74475/2
authortaeyoung <ty317.kim@samsung.com>
Tue, 14 Jun 2016 09:41:37 +0000 (18:41 +0900)
committerTaeyoung Kim <ty317.kim@samsung.com>
Wed, 15 Jun 2016 06:17:10 +0000 (23:17 -0700)
This reverts commit 4b3b175c394d45a3273ce00815cd1c4a61d81a7a.

Change-Id: I71d510ba06548ab32d849d46e1e6291b39000d09
Signed-off-by: taeyoung <ty317.kim@samsung.com>
src/display/core.c
src/display/device-interface.c
src/display/device-interface.h

index 9d56fd5..0a0d09e 100644 (file)
@@ -2158,6 +2158,11 @@ static void display_init(void *data)
                if (display_conf.input_support)
                        if (CHECK_OPS(keyfilter_ops, init))
                                keyfilter_ops->init();
+
+               if (power_ops.get_power_lock_support &&
+                       power_ops.get_power_lock_support() &&
+                       power_ops.enable_autosleep)
+                       power_ops.enable_autosleep();
        }
 }
 
index 542c5f3..5ce9885 100644 (file)
@@ -48,6 +48,7 @@
 #define LCD_PHASED_CHANGE_STEP         5
 #define LCD_PHASED_DELAY               35000 /* microsecond */
 
+#define POWER_AUTOSLEEP_PATH    "/sys/power/autosleep"
 #define POWER_LOCK_PATH         "/sys/power/wake_lock"
 #define POWER_UNLOCK_PATH       "/sys/power/wake_unlock"
 #define POWER_WAKEUP_PATH       "/sys/power/wakeup_count"
@@ -160,6 +161,12 @@ static int system_suspend(void)
        return 0;
 }
 
+static int system_enable_autosleep(void)
+{
+       _I("system autosleep enabled");
+       return sys_set_str(POWER_AUTOSLEEP_PATH, "mem");
+}
+
 static int system_power_lock(void)
 {
        _I("system power lock");
@@ -520,6 +527,7 @@ static void _init_ops(void)
        backlight_ops.get_brightness = get_brightness;
 
        power_ops.suspend = system_suspend;
+       power_ops.enable_autosleep = system_enable_autosleep;
        power_ops.power_lock = system_power_lock;
        power_ops.power_unlock = system_power_unlock;
        power_ops.get_power_lock_support = system_get_power_lock_support;
index 2185898..07153ac 100644 (file)
@@ -78,6 +78,7 @@ struct _backlight_ops {
 
 struct _power_ops {
        int (*suspend)(void);
+       int (*enable_autosleep)(void);
        int (*power_lock)(void);
        int (*power_unlock)(void);
        int (*get_power_lock_support)(void);