shared: Replace device_notifier_type with the libsyscommon
[platform/core/system/deviced.git] / src / touchscreen / touchscreen.c
index 9a67045..3ea40e4 100644 (file)
@@ -29,6 +29,7 @@
 #include "battery/power-supply.h"
 #include "core.h"
 #include "display-ops.h"
+#include "display-panel.h"
 #include "display-plugin.h"
 #include "display-config.h"
 #include "power/power-boot.h"
@@ -63,12 +64,7 @@ static void touchscreen_wakeup_status(keynode_t *key, void *data)
 
        g_display_plugin.config->touch_wakeup = vconf_keynode_get_bool(key);
 
-       /**
-        * FIXME: display_plugin_backlight_get_lcd_power() should be changed to
-        * dpms_get_cached_state() function.
-        * After deviding src/display module and plugin display module from build.
-       */
-       if (display_plugin_backlight_get_lcd_power() != DPMS_ON) {
+       if (display_panel_get_dpms_cached_state() != DPMS_ON) {
                if (g_display_plugin.config->touch_wakeup)
                        touchscreen_start(NORMAL_MODE);
                else
@@ -172,7 +168,8 @@ static int touchscreen_execute(void *data)
 
 static int touchscreen_start(enum device_flags flags)
 {
-       int state, ret;
+       int state = -1;
+       int ret;
 
        if (touchscreen_enable != DEVICE_OPS_STATUS_START)
                return 0;
@@ -186,13 +183,7 @@ static int touchscreen_start(enum device_flags flags)
         */
        ret = touchscreen_set_state(TOUCHSCREEN_ON);
 
-       state = -1;
-       /**
-        * FIXME: display_plugin_backlight_get_lcd_power() should be changed to
-        * dpms_get_cached_state() function.
-        * After deviding src/display module and plugin display module from build.
-       */
-       state = display_plugin_backlight_get_lcd_power();
+       state = display_panel_get_dpms_cached_state();
 
        if (state == DPMS_OFF)
                touchscreen_powersaving(POWERSAVING_ON);
@@ -342,7 +333,7 @@ static void touchscreen_init(void *data)
        if (ret < 0)
                _E("Failed to init dbus method. (%d)", ret);
 
-       register_notifier(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done);
+       syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done);
 }
 
 static const struct device_ops touchscreen_device_ops = {