Skip to content

Commit

Permalink
Activate power on pattern when ACT_DEAD -> USER transition starts
Browse files Browse the repository at this point in the history
The old behavior was to toggle it on/off during power key press, which
was confusing because the pattern is so similar to charging pattern.

Also remove legacy deactivation code that is either not triggered
at all or comes too early.
  • Loading branch information
spiiroin committed Jan 16, 2014
1 parent 28866d5 commit ed7779d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
4 changes: 0 additions & 4 deletions modetransition.c
Expand Up @@ -176,10 +176,6 @@ static void system_state_trigger(gconstpointer data)

switch (system_state) {
case MCE_STATE_USER:
if (old_system_state == MCE_STATE_ACTDEAD) {
execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_POWER_ON, USE_INDATA);
}

break;

case MCE_STATE_SHUTDOWN:
Expand Down
3 changes: 0 additions & 3 deletions modules/display.c
Expand Up @@ -5935,9 +5935,6 @@ static gboolean mdy_dbus_handle_desktop_started_sig(DBusMessage *const msg)

mce_log(LL_DEBUG, "Received desktop startup notification");

execute_datapipe_output_triggers(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_POWER_ON, USE_INDATA);

mce_rem_submode_int32(MCE_BOOTUP_SUBMODE);

mce_rem_submode_int32(MCE_MALF_SUBMODE);
Expand Down
13 changes: 6 additions & 7 deletions powerkey.c
Expand Up @@ -355,6 +355,11 @@ static gboolean handle_longpress(void)
break;

case MCE_STATE_ACTDEAD:
/* activate power on led pattern and power up to user mode*/
mce_log(LL_CRIT, "ENABLE MCE_LED_PATTERN_POWER_ON");
execute_datapipe_output_triggers(&led_pattern_activate_pipe,
MCE_LED_PATTERN_POWER_ON,
USE_INDATA);
request_powerup();
break;

Expand Down Expand Up @@ -565,8 +570,7 @@ static void powerkey_trigger(gconstpointer const data)
handle_shortpress();
} else if ((system_state == MCE_STATE_ACTDEAD) ||
((submode & MCE_SOFTOFF_SUBMODE) != 0)) {
/* Setup new timeout */
execute_datapipe_output_triggers(&led_pattern_activate_pipe, MCE_LED_PATTERN_POWER_ON, USE_INDATA);
/* Setup new timeout */

/* Shorter delay for startup
* than for shutdown
Expand All @@ -581,11 +585,6 @@ static void powerkey_trigger(gconstpointer const data)
/* Short key press */
if (powerkey_timeout_cb_id != 0) {
handle_shortpress();

if ((system_state == MCE_STATE_ACTDEAD) ||
((submode & MCE_SOFTOFF_SUBMODE) != 0)) {
execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_POWER_ON, USE_INDATA);
}
}
}
}
Expand Down

0 comments on commit ed7779d

Please sign in to comment.