Skip to content
Permalink
Browse files
[mce] Use datapipe_exec_full() for all datapipe actions. JB#22475
Now that the number of parameters that can be passed to datapipe_exec_full()
has been reduced, datapipe_exec_output_triggers() is not different enough
to warrant a separate function.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Sep 19, 2018
1 parent 3e9b559 commit 14d657481ec57473afdaa7544233f0b0013fdcd4
Showing with 88 additions and 89 deletions.
  1. +5 −5 event-input.c
  2. +4 −4 mce-dsme.c
  3. +1 −2 mce-io.c
  4. +2 −2 modetransition.c
  5. +12 −12 modules/battery-bme.c
  6. +12 −12 modules/battery-statefs.c
  7. +12 −12 modules/battery-upower.c
  8. +4 −4 modules/camera.c
  9. +22 −22 modules/display.c
  10. +10 −10 modules/fingerprint.c
  11. +2 −2 powerkey.c
  12. +2 −2 tklock.c
@@ -1911,7 +1911,7 @@ evin_iomon_generate_activity(struct input_event *ev, bool cooked, bool raw)
if( raw ) {
if( t_raw != t ) {
t_raw = t;
datapipe_exec_output_triggers(&user_activity_event_pipe, ev);
datapipe_exec_full(&user_activity_event_pipe, ev);
}
}

@@ -3196,10 +3196,10 @@ static guint evin_ts_grab_release_delay_setting_id = 0;
static void
evin_ts_grab_set_led_raw(bool enabled)
{
datapipe_exec_output_triggers(enabled ?
&led_pattern_activate_pipe :
&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_TOUCH_INPUT_BLOCKED);
datapipe_exec_full(enabled ?
&led_pattern_activate_pipe :
&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_TOUCH_INPUT_BLOCKED);
}

/** Handle delayed input grab led pattern activation
@@ -902,14 +902,14 @@ static void mce_dsme_datapipe_system_state_cb(gconstpointer data)
/* Handle LED patterns */
switch( system_state ) {
case MCE_SYSTEM_STATE_USER:
datapipe_exec_output_triggers(&led_pattern_activate_pipe,
MCE_LED_PATTERN_DEVICE_ON);
datapipe_exec_full(&led_pattern_activate_pipe,
MCE_LED_PATTERN_DEVICE_ON);
break;

case MCE_SYSTEM_STATE_SHUTDOWN:
case MCE_SYSTEM_STATE_REBOOT:
datapipe_exec_output_triggers(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_DEVICE_ON);
datapipe_exec_full(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_DEVICE_ON);
break;

default:
@@ -174,8 +174,7 @@ static void io_detect_resume(void)
skip / 1000, skip % 1000);

// notify in case some timers need re-evaluating
datapipe_exec_output_triggers(&resume_detected_event_pipe,
&prev);
datapipe_exec_full(&resume_detected_event_pipe, &prev);

EXIT:
return;
@@ -114,8 +114,8 @@ static void system_state_trigger(gconstpointer data)
case MCE_SYSTEM_STATE_BOOT:
case MCE_SYSTEM_STATE_UNDEF:
case MCE_SYSTEM_STATE_ACTDEAD:
datapipe_exec_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_DEVICE_ON);
datapipe_exec_output_triggers(&led_pattern_activate_pipe, MCE_LED_PATTERN_POWER_OFF);
datapipe_exec_full(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_DEVICE_ON);
datapipe_exec_full(&led_pattern_activate_pipe, MCE_LED_PATTERN_POWER_OFF);
break;

default:
@@ -60,8 +60,8 @@ static gboolean battery_full_dbus_cb(DBusMessage *const msg)
mce_log(LL_DEBUG,
"Received battery full signal");

datapipe_exec_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_CHARGING);
datapipe_exec_output_triggers(&led_pattern_activate_pipe, MCE_LED_PATTERN_BATTERY_FULL);
datapipe_exec_full(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_CHARGING);
datapipe_exec_full(&led_pattern_activate_pipe, MCE_LED_PATTERN_BATTERY_FULL);

datapipe_exec_full(&battery_status_pipe,
GINT_TO_POINTER(BATTERY_STATUS_FULL));
@@ -87,7 +87,7 @@ static gboolean battery_ok_dbus_cb(DBusMessage *const msg)
mce_log(LL_DEBUG,
"Received battery ok signal");

// datapipe_exec_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW);
// datapipe_exec_full(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW);

datapipe_exec_full(&battery_status_pipe,
GINT_TO_POINTER(BATTERY_STATUS_OK));
@@ -113,7 +113,7 @@ static gboolean battery_low_dbus_cb(DBusMessage *const msg)
mce_log(LL_DEBUG,
"Received battery low signal");

// datapipe_exec_output_triggers(&led_pattern_activate_pipe, MCE_LED_PATTERN_BATTERY_LOW);
// datapipe_exec_full(&led_pattern_activate_pipe, MCE_LED_PATTERN_BATTERY_LOW);

datapipe_exec_full(&battery_status_pipe,
GINT_TO_POINTER(BATTERY_STATUS_LOW));
@@ -257,10 +257,10 @@ static gboolean charger_charging_on_dbus_cb(DBusMessage *const msg)
}

/* In case these are active; there's no harm to call them anyway */
datapipe_exec_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_FULL);
// datapipe_exec_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW);
datapipe_exec_full(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_FULL);
// datapipe_exec_full(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW);

datapipe_exec_output_triggers(&led_pattern_activate_pipe, MCE_LED_PATTERN_BATTERY_CHARGING);
datapipe_exec_full(&led_pattern_activate_pipe, MCE_LED_PATTERN_BATTERY_CHARGING);

status = TRUE;

@@ -291,7 +291,7 @@ static gboolean charger_charging_off_dbus_cb(DBusMessage *const msg)
}

/* In case these are active; there's no harm to call them anyway */
datapipe_exec_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_CHARGING);
datapipe_exec_full(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_CHARGING);

status = TRUE;

@@ -322,8 +322,8 @@ static gboolean charger_charging_failed_dbus_cb(DBusMessage *const msg)
}

/* In case these are active; there's no harm to call them anyway */
datapipe_exec_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_FULL);
datapipe_exec_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_CHARGING);
datapipe_exec_full(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_FULL);
datapipe_exec_full(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_CHARGING);

/* Generate activity */
datapipe_exec_full(&inactivity_event_pipe, GINT_TO_POINTER(FALSE));
@@ -385,8 +385,8 @@ static gboolean charger_disconnected_dbus_cb(DBusMessage *const msg)
}

/* In case these are active; there's no harm to call them anyway */
datapipe_exec_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_FULL);
datapipe_exec_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_CHARGING);
datapipe_exec_full(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_FULL);
datapipe_exec_full(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_CHARGING);

if (cached_charger_connected != 0) {
/* Generate activity */
@@ -729,12 +729,12 @@ mcebat_update_cb(gpointer user_data)

/* Charging led pattern */
if( mcebat.charger == CHARGER_STATE_ON ) {
datapipe_exec_output_triggers(&led_pattern_activate_pipe,
MCE_LED_PATTERN_BATTERY_CHARGING);
datapipe_exec_full(&led_pattern_activate_pipe,
MCE_LED_PATTERN_BATTERY_CHARGING);
}
else {
datapipe_exec_output_triggers(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_BATTERY_CHARGING);
datapipe_exec_full(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_BATTERY_CHARGING);
}

/* Generate activity */
@@ -748,24 +748,24 @@ mcebat_update_cb(gpointer user_data)

/* Battery full led pattern */
if( mcebat.status == BATTERY_STATUS_FULL ) {
datapipe_exec_output_triggers(&led_pattern_activate_pipe,
MCE_LED_PATTERN_BATTERY_FULL);
datapipe_exec_full(&led_pattern_activate_pipe,
MCE_LED_PATTERN_BATTERY_FULL);
}
else {
datapipe_exec_output_triggers(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_BATTERY_FULL);
datapipe_exec_full(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_BATTERY_FULL);
}

#if SUPPORT_BATTERY_LOW_LED_PATTERN
/* Battery low led pattern */
if( mcebat.status == BATTERY_STATUS_LOW ||
mcebat.status == BATTERY_STATUS_EMPTY ) {
datapipe_exec_output_triggers(&led_pattern_activate_pipe,
MCE_LED_PATTERN_BATTERY_LOW);
datapipe_exec_full(&led_pattern_activate_pipe,
MCE_LED_PATTERN_BATTERY_LOW);
}
else {
datapipe_exec_output_triggers(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_BATTERY_LOW);
datapipe_exec_full(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_BATTERY_LOW);
}
#endif /* SUPPORT_BATTERY_LOW_LED_PATTERN */

@@ -700,12 +700,12 @@ mcebat_update_cb(gpointer user_data)

/* Charging led pattern */
if( mcebat.charger == CHARGER_STATE_ON ) {
datapipe_exec_output_triggers(&led_pattern_activate_pipe,
MCE_LED_PATTERN_BATTERY_CHARGING);
datapipe_exec_full(&led_pattern_activate_pipe,
MCE_LED_PATTERN_BATTERY_CHARGING);
}
else {
datapipe_exec_output_triggers(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_BATTERY_CHARGING);
datapipe_exec_full(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_BATTERY_CHARGING);
}

/* Generate activity */
@@ -717,24 +717,24 @@ mcebat_update_cb(gpointer user_data)

/* Battery full led pattern */
if( mcebat.status == BATTERY_STATUS_FULL ) {
datapipe_exec_output_triggers(&led_pattern_activate_pipe,
MCE_LED_PATTERN_BATTERY_FULL);
datapipe_exec_full(&led_pattern_activate_pipe,
MCE_LED_PATTERN_BATTERY_FULL);
}
else {
datapipe_exec_output_triggers(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_BATTERY_FULL);
datapipe_exec_full(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_BATTERY_FULL);
}

#if SUPPORT_BATTERY_LOW_LED_PATTERN
/* Battery low led pattern */
if( mcebat.status == BATTERY_STATUS_LOW ||
mcebat.status == BATTERY_STATUS_EMPTY ) {
datapipe_exec_output_triggers(&led_pattern_activate_pipe,
MCE_LED_PATTERN_BATTERY_LOW);
datapipe_exec_full(&led_pattern_activate_pipe,
MCE_LED_PATTERN_BATTERY_LOW);
}
else {
datapipe_exec_output_triggers(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_BATTERY_LOW);
datapipe_exec_full(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_BATTERY_LOW);
}
#endif /* SUPPORT_BATTERY_LOW_LED_PATTERN */

@@ -98,11 +98,11 @@ static gboolean camera_active_state_iomon_input_cb(mce_io_mon_t *iomon, gpointer
(void)bytes_read;

if (!strncmp(data, MCE_CAMERA_ACTIVE, strlen(MCE_CAMERA_ACTIVE))) {
datapipe_exec_output_triggers(&led_pattern_activate_pipe,
MCE_LED_PATTERN_CAMERA);
datapipe_exec_full(&led_pattern_activate_pipe,
MCE_LED_PATTERN_CAMERA);
} else {
datapipe_exec_output_triggers(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_CAMERA);
datapipe_exec_full(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_CAMERA);
}

return FALSE;
@@ -3229,10 +3229,10 @@ static void mdy_brightness_set_dim_level(void)
* FIXME: When ui side dimming is working, the led pattern
* hack should be removed altogether.
*/
datapipe_exec_output_triggers(compositor_fade_level > 0 ?
&led_pattern_activate_pipe :
&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_DISPLAY_DIMMED);
datapipe_exec_full(compositor_fade_level > 0 ?
&led_pattern_activate_pipe :
&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_DISPLAY_DIMMED);

/* Update ui side fader opacity value */
mdy_ui_dimming_set_level(compositor_fade_level);
@@ -3559,10 +3559,10 @@ static void mdy_poweron_led_rethink(void)
mce_log(LL_DEBUG, "%s MCE_LED_PATTERN_POWER_ON",
want_led ? "activate" : "deactivate");

datapipe_exec_output_triggers(want_led ?
&led_pattern_activate_pipe :
&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_POWER_ON);
datapipe_exec_full(want_led ?
&led_pattern_activate_pipe :
&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_POWER_ON);
}

/** Timer id for delayed POWER_ON led state evaluation */
@@ -5681,10 +5681,10 @@ static void compositor_led_set_active(compositor_led_t led, bool active)
active ? "activate" : "deactivate",
compositor_led_pattern[led]);

datapipe_exec_output_triggers((compositor_led_active[led] = active) ?
&led_pattern_activate_pipe :
&led_pattern_deactivate_pipe,
compositor_led_pattern[led]);
datapipe_exec_full((compositor_led_active[led] = active) ?
&led_pattern_activate_pipe :
&led_pattern_deactivate_pipe,
compositor_led_pattern[led]);
EXIT:
return;
}
@@ -7346,15 +7346,15 @@ static void mdy_fbsusp_led_set(mdy_fbsusp_led_state_t req)
break;
}

datapipe_exec_output_triggers(blanking ?
&led_pattern_activate_pipe :
&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_DISPLAY_SUSPEND_FAILED);
datapipe_exec_full(blanking ?
&led_pattern_activate_pipe :
&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_DISPLAY_SUSPEND_FAILED);

datapipe_exec_output_triggers(unblanking ?
&led_pattern_activate_pipe :
&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_DISPLAY_RESUME_FAILED);
datapipe_exec_full(unblanking ?
&led_pattern_activate_pipe :
&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_DISPLAY_RESUME_FAILED);
}

/** Timer id for fbdev suspend/resume is taking too long */
@@ -9680,8 +9680,8 @@ static gboolean mdy_dbus_handle_desktop_started_sig(DBusMessage *const msg)
mce_log(LL_NOTICE, "Received desktop startup notification");

mce_log(LL_DEBUG, "deactivate MCE_LED_PATTERN_POWER_ON");
datapipe_exec_output_triggers(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_POWER_ON);
datapipe_exec_full(&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_POWER_ON);

mce_rem_submode_int32(MCE_SUBMODE_BOOTUP);

@@ -1189,10 +1189,10 @@ fingerprint_led_scanning_activate(bool activate)
{
static bool activated = false;
if( activated != activate ) {
datapipe_exec_output_triggers((activated = activate) ?
&led_pattern_activate_pipe :
&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_SCANNING_FINGERPRINT);
datapipe_exec_full((activated = activate) ?
&led_pattern_activate_pipe :
&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_SCANNING_FINGERPRINT);
}
}

@@ -1209,10 +1209,10 @@ fingerprint_led_acquired_activate(bool activate)
{
static bool activated = false;
if( activated != activate ) {
datapipe_exec_output_triggers((activated = activate) ?
&led_pattern_activate_pipe :
&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_FINGERPRINT_ACQUIRED);
datapipe_exec_full((activated = activate) ?
&led_pattern_activate_pipe :
&led_pattern_deactivate_pipe,
MCE_LED_PATTERN_FINGERPRINT_ACQUIRED);
}
}

@@ -2611,8 +2611,8 @@ fpwakeup_trigger(void)
mce_log(LL_CRUCIAL, "fingerprint wakeup triggered");

/* (Mis)use haptic feedback associated with device unlocking */
datapipe_exec_output_triggers(&ngfd_event_request_pipe,
"unlock_device");
datapipe_exec_full(&ngfd_event_request_pipe,
"unlock_device");

/* Make sure we unblank / exit from lpm */
mce_datapipe_request_display_state(MCE_DISPLAY_ON);
@@ -1246,8 +1246,8 @@ pwrkey_actions_do_long_press(void)
case MCE_SYSTEM_STATE_ACTDEAD:
/* Activate power on led pattern and power up to user mode*/
mce_log(LL_DEBUG, "activate MCE_LED_PATTERN_POWER_ON");
datapipe_exec_output_triggers(&led_pattern_activate_pipe,
MCE_LED_PATTERN_POWER_ON);
datapipe_exec_full(&led_pattern_activate_pipe,
MCE_LED_PATTERN_POWER_ON);
mce_dsme_request_powerup();
break;

@@ -756,8 +756,8 @@ static void tklock_datapipe_devicelock_state_cb(gconstpointer data)
*/
mce_log(LL_WARN, "device got unlocked while display is off; "
"assume fingerprint authentication occurred");
datapipe_exec_output_triggers(&ngfd_event_request_pipe,
"unlock_device");
datapipe_exec_full(&ngfd_event_request_pipe,
"unlock_device");
if( proximity_sensor_actual != COVER_OPEN ) {
mce_log(LL_WARN, "unblank skipped due to proximity sensor");
break;

0 comments on commit 14d6574

Please sign in to comment.