board/lantis/led.c: Format with clang-format
BRANCH=none
TEST=none
#define POWER_LED_ON 0
#define POWER_LED_OFF 1
-const enum ec_led_id supported_led_ids[] = {
- EC_LED_ID_LEFT_LED,
+const enum ec_led_id supported_led_ids[] = { EC_LED_ID_LEFT_LED,
EC_LED_ID_RIGHT_LED,
- EC_LED_ID_POWER_LED
-};
+ EC_LED_ID_POWER_LED };
const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids);
@@ -34,10 +32,7 @@ enum led_color {
LED_COLOR_COUNT /* Number of colors, not a color itself */
};
-enum led_port {
- LEFT_PORT = 0,
- RIGHT_PORT
-};
+enum led_port { LEFT_PORT = 0, RIGHT_PORT };
static int led_set_color_battery(int port, enum led_color color)
{
@@ -182,13 +177,14 @@ static void led_set_battery(void)
if (get_cbi_fw_config_tablet_mode() == TABLET_MODE_ABSENT) {
if (chipset_in_state(CHIPSET_STATE_ANY_SUSPEND) &&
charge_get_state() != PWR_STATE_CHARGE) {
-
power_ticks++;
led_set_color_battery(RIGHT_PORT, power_ticks & 0x2 ?
- LED_WHITE : LED_OFF);
+ LED_WHITE :
+ LED_OFF);
led_set_color_battery(LEFT_PORT, power_ticks & 0x2 ?
- LED_WHITE : LED_OFF);
+ LED_WHITE :
+ LED_OFF);
return;
}
}
@@ -212,22 +208,25 @@ static void led_set_battery(void)
*/
if (charge_get_percent() < 10) {
if (is_led_old_policy()) {
- led_set_color_battery(
- RIGHT_PORT, (battery_ticks & 0x2) ?
- LED_WHITE : LED_OFF);
+ led_set_color_battery(RIGHT_PORT,
+ (battery_ticks & 0x2) ?
+ LED_WHITE :
+ LED_OFF);
} else {
if (led_auto_control_is_enabled(
EC_LED_ID_RIGHT_LED))
led_set_color_battery(
RIGHT_PORT,
(battery_ticks & 0x2) ?
- LED_AMBER : LED_OFF);
+ LED_AMBER :
+ LED_OFF);
if (led_auto_control_is_enabled(
EC_LED_ID_LEFT_LED))
led_set_color_battery(
LEFT_PORT,
(battery_ticks & 0x2) ?
- LED_AMBER : LED_OFF);
+ LED_AMBER :
+ LED_OFF);
}
} else {
set_active_port_color(LED_OFF);
@@ -266,8 +265,7 @@ static void led_set_power(void)
if (chipset_in_state(CHIPSET_STATE_ON))
led_set_color_power(LED_WHITE);
else if (chipset_in_state(CHIPSET_STATE_ANY_SUSPEND))
- led_set_color_power(
- (power_tick & 0x2) ? LED_WHITE : LED_OFF);
+ led_set_color_power((power_tick & 0x2) ? LED_WHITE : LED_OFF);
else
led_set_color_power(LED_OFF);
}
