return &states[state];
}
-static int default_proc_change_state(unsigned int cond, pid_t pid)
-{
- enum syscommon_deviced_display_state next;
-
- next = GET_COND_STATE(cond);
- _I("Change process(%d) state to %s.", pid, states[next].name);
-
- switch (next) {
- case SYSCOMMON_DEVICED_DISPLAY_STATE_ON:
- if (display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON)
- display_panel_lcd_on_direct(DEVICED_EVENT_UNKNOWN);
- display_state_transition_update_lock_screen_timeout(LOCK_SCREEN_CONTROL_TIMEOUT);
- display_state_transition_do_proc_change_state_action(next, -1);
- break;
- case SYSCOMMON_DEVICED_DISPLAY_STATE_DIM:
- display_state_transition_do_proc_change_state_action(next, -1);
- break;
- case SYSCOMMON_DEVICED_DISPLAY_STATE_OFF:
- if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON) {
- /**
- * FIXME: need to convey reason to this point
- * from the top of this subroutine.
- */
- display_panel_lcd_off_procedure(DEVICED_EVENT_UNKNOWN);
- }
- if (set_custom_lcdon_timeout(0))
- display_state_transition_update_display_state_timeout_by_priority();
- display_state_transition_do_proc_change_state_action(next, -1);
- break;
- case SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP:
- _I("Dangerous requests.");
- /* at first LCD_OFF and then goto sleep */
- /* state transition */
- display_state_transition_do_proc_change_state_action(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, TIMEOUT_NONE);
- display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
- display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM);
- display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF);
- if (display_panel_is_lcd_on_state_broadcasted()) {
- _I("broadcast lcd off signal at non-lcd device");
- broadcast_lcd_off(SIGNAL_PRE, 0);
- broadcast_lcd_off(SIGNAL_POST, 0);
- }
- display_state_transition_do_proc_change_state_action(SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP, TIMEOUT_NONE);
- break;
-
- default:
- return -EINVAL;
- }
-
- return 0;
-}
-
static void init_display_states(void *data)
{
struct display_plugin *dp = (struct display_plugin *) data;
init_display_states(dp);
setup_display_plugin_backlight_ops(dp);
dp->default_saving_mode = NULL;
- dp->proc_change_state = default_proc_change_state;
+ dp->proc_change_state = NULL;
return 0;
}