display: Move force_brightness getter and setter from plugin to core display module
[platform/core/system/deviced.git] / plugins / iot-headed / display / device-interface.c
index 05bd53b..949ad58 100644 (file)
@@ -68,7 +68,6 @@
 #define FREEZER_VITAL_WAKEUP_CGROUP "/sys/fs/cgroup/freezer/vital_wakeup/freezer.state"
 
 static struct _backlight_ops backlight_ops;
-static int force_brightness;
 static bool display_dev_available = false;
 static const struct display_config *display_conf;
 
@@ -162,22 +161,13 @@ static void change_brightness(int start, int end, int step)
        }
 }
 
-static int set_force_brightness(int level)
-{
-       if (level < 0 ||  level > PM_MAX_BRIGHTNESS)
-               return -EINVAL;
-
-       force_brightness = level;
-
-       return 0;
-}
-
 static int set_brightness(int val)
 {
        int max, ret;
-       int default_brightness = 0;
+       int default_brightness = 0, force_brightness = 0;
 
        display_backlight_get_default_brightness(&default_brightness);
+       display_backlight_get_force_brightness(&force_brightness);
 
        if (!display_dev_available) {
                _E("There is no display device.");
@@ -286,7 +276,6 @@ static void restore_brightness_func(void)
 
 static struct _backlight_ops backlight_ops = {
        .get_lcd_power = dpms_get_cached_state,
-       .set_force_brightness = set_force_brightness,
        .set_brightness = set_brightness,
        .get_brightness = get_brightness,
        .restore_brightness_func = restore_brightness_func,