delayed_init_done is used from all plugins with the same logic.
This function is used to unlock INTERNAL_LOCK_BOOTING after display initialization.
Because INTERNAL_LOCK_BOOTING is caught while display is initialized.
Thus, delayed_init_done is moved to display.c
Change-Id: Id6e23dd5b10de8d20edce22715972a829c95b49e
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
[INIT_DBUS] = "d-bus init error",
};
-static int delayed_init_done(void *data)
-{
- static bool done = false;
-
- if (!data)
- return done;
-
- done = *(int*)data;
- if (!done)
- return done;
-
- _I("Booting done, release booting lock.");
- if (disp_plgn->pm_unlock_internal) {
- disp_plgn->pm_unlock_internal(INTERNAL_LOCK_BOOTING, LCD_NORMAL, PM_SLEEP_MARGIN);
- disp_plgn->pm_unlock_internal(INTERNAL_LOCK_BOOTING, LCD_OFF, PM_SLEEP_MARGIN);
- }
-
- return done;
-}
-
static void init_display_states(void *data)
{
struct display_plugin *dp = (struct display_plugin *) data;
_W("Failed to load '%s', use default value: %d",
DISPLAY_CONF_FILE, ret);
- register_notifier(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done);
register_notifier(DEVICE_NOTIFIER_APPLICATION_BACKGROUND, display_app_background);
register_notifier(DEVICE_NOTIFIER_APPLICATION_FOREGROUND, display_app_foreground);
register_notifier(DEVICE_NOTIFIER_APPLICATION_TERMINATED, display_app_terminated);
exit_sysfs();
break;
case INIT_POLL:
- unregister_notifier(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done);
unregister_notifier(DEVICE_NOTIFIER_APPLICATION_BACKGROUND, display_app_background);
unregister_notifier(DEVICE_NOTIFIER_APPLICATION_FOREGROUND, display_app_foreground);
unregister_notifier(DEVICE_NOTIFIER_APPLICATION_TERMINATED, display_app_terminated);
[INIT_DBUS] = "d-bus init error",
};
-static int delayed_init_done(void *data)
-{
- static bool done = false;
-
- if (!data)
- return done;
-
- done = *(int*)data;
- if (!done)
- return done;
-
- _I("Booting done, release booting lock.");
- if (disp_plgn->pm_unlock_internal) {
- disp_plgn->pm_unlock_internal(INTERNAL_LOCK_BOOTING, LCD_NORMAL, PM_SLEEP_MARGIN);
- disp_plgn->pm_unlock_internal(INTERNAL_LOCK_BOOTING, LCD_OFF, PM_SLEEP_MARGIN);
- }
-
- return done;
-}
-
static void init_display_states(void *data)
{
struct display_plugin *dp = (struct display_plugin *) data;
_W("Failed to load '%s', use default value: %d",
DISPLAY_CONF_FILE, ret);
- register_notifier(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done);
register_notifier(DEVICE_NOTIFIER_APPLICATION_BACKGROUND, display_app_background);
register_notifier(DEVICE_NOTIFIER_APPLICATION_FOREGROUND, display_app_foreground);
register_notifier(DEVICE_NOTIFIER_APPLICATION_TERMINATED, display_app_terminated);
exit_sysfs();
break;
case INIT_POLL:
- unregister_notifier(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done);
unregister_notifier(DEVICE_NOTIFIER_APPLICATION_BACKGROUND, display_app_background);
unregister_notifier(DEVICE_NOTIFIER_APPLICATION_FOREGROUND, display_app_foreground);
unregister_notifier(DEVICE_NOTIFIER_APPLICATION_TERMINATED, display_app_terminated);
[INIT_DBUS] = "d-bus init error",
};
-static int delayed_init_done(void *data)
-{
- static bool done = false;
-
- if (!data)
- return done;
-
- done = *(int*)data;
- if (!done)
- return done;
-
- _I("Booting done, release booting lock.");
- if (disp_plgn->pm_unlock_internal) {
- disp_plgn->pm_unlock_internal(INTERNAL_LOCK_BOOTING, LCD_NORMAL, PM_SLEEP_MARGIN);
- disp_plgn->pm_unlock_internal(INTERNAL_LOCK_BOOTING, LCD_OFF, PM_SLEEP_MARGIN);
- }
-
- return done;
-}
-
static void init_display_states(void *data)
{
struct display_plugin *dp = (struct display_plugin *) data;
_W("Failed to load '%s', use default value: %d",
DISPLAY_CONF_FILE, ret);
- register_notifier(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done);
register_notifier(DEVICE_NOTIFIER_APPLICATION_BACKGROUND, display_app_background);
register_notifier(DEVICE_NOTIFIER_APPLICATION_FOREGROUND, display_app_foreground);
register_notifier(DEVICE_NOTIFIER_APPLICATION_TERMINATED, display_app_terminated);
exit_sysfs();
break;
case INIT_POLL:
- unregister_notifier(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done);
unregister_notifier(DEVICE_NOTIFIER_APPLICATION_BACKGROUND, display_app_background);
unregister_notifier(DEVICE_NOTIFIER_APPLICATION_FOREGROUND, display_app_foreground);
unregister_notifier(DEVICE_NOTIFIER_APPLICATION_TERMINATED, display_app_terminated);
[INIT_DBUS] = "d-bus init error",
};
-static int delayed_init_done(void *data)
-{
- static bool done = false;
-
- if (!data)
- return done;
-
- done = *(int*)data;
- if (!done)
- return done;
-
- _I("Booting done, release booting lock.");
- if (disp_plgn->pm_unlock_internal) {
- disp_plgn->pm_unlock_internal(INTERNAL_LOCK_BOOTING, LCD_NORMAL, PM_SLEEP_MARGIN);
- disp_plgn->pm_unlock_internal(INTERNAL_LOCK_BOOTING, LCD_OFF, PM_SLEEP_MARGIN);
- }
-
- return done;
-}
-
static void init_display_states(void *data)
{
struct display_plugin *dp = (struct display_plugin *) data;
register_kernel_uevent_control(&sec_dsim_uevent_ops);
- register_notifier(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done);
register_notifier(DEVICE_NOTIFIER_APPLICATION_BACKGROUND, display_app_background);
register_notifier(DEVICE_NOTIFIER_APPLICATION_FOREGROUND, display_app_foreground);
register_notifier(DEVICE_NOTIFIER_APPLICATION_TERMINATED, display_app_terminated);
exit_sysfs();
break;
case INIT_POLL:
- unregister_notifier(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done);
unregister_notifier(DEVICE_NOTIFIER_APPLICATION_BACKGROUND, display_app_background);
unregister_notifier(DEVICE_NOTIFIER_APPLICATION_FOREGROUND, display_app_foreground);
unregister_notifier(DEVICE_NOTIFIER_APPLICATION_TERMINATED, display_app_terminated);
return G_SOURCE_REMOVE;
}
+static int delayed_init_done(void *data)
+{
+ static bool done = false;
+
+ if (!data)
+ return done;
+
+ done = *(int*)data;
+ if (!done)
+ return done;
+
+ _I("Booting done, release booting lock.");
+ display_plugin_pm_unlock_internal(INTERNAL_LOCK_BOOTING, LCD_NORMAL, PM_SLEEP_MARGIN);
+ display_plugin_pm_unlock_internal(INTERNAL_LOCK_BOOTING, LCD_OFF, PM_SLEEP_MARGIN);
+
+ return done;
+}
+
static int display_probe(void *data)
{
display_plugin_device_ops = find_device("display-plugin");
return;
g_unix_signal_add(SIGHUP, handle_sighup, (gpointer) SIGHUP);
+ register_notifier(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done);
display_plugin_device_ops->init(data);
register_kernel_uevent_control(&lcd_uevent_ops);
display_misc_unregister_battery_health_notifier();
unregister_notifier(DEVICE_NOTIFIER_POWER_RESUME_FROM_ECHO_MEM, power_resume_from_echomem_callback);
unregister_notifier(DEVICE_NOTIFIER_POWEROFF_TRIGGERED, poweroff_triggered_callback);
+ unregister_notifier(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done);
}
static int display_start(enum device_flags flags)