summaryrefslogtreecommitdiff
path: root/board/gumboz
diff options
context:
space:
mode:
Diffstat (limited to 'board/gumboz')
-rw-r--r--board/gumboz/battery.c2
-rw-r--r--board/gumboz/board.c109
-rw-r--r--board/gumboz/board.h85
-rw-r--r--board/gumboz/build.mk2
-rw-r--r--board/gumboz/ec.tasklist2
-rw-r--r--board/gumboz/gpio.inc2
-rw-r--r--board/gumboz/led.c59
7 files changed, 118 insertions, 143 deletions
diff --git a/board/gumboz/battery.c b/board/gumboz/battery.c
index 7d1831fdbc..8b9b3ddf96 100644
--- a/board/gumboz/battery.c
+++ b/board/gumboz/battery.c
@@ -1,4 +1,4 @@
-/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+/* Copyright 2020 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
diff --git a/board/gumboz/board.c b/board/gumboz/board.c
index f90902f765..82522ada4d 100644
--- a/board/gumboz/board.c
+++ b/board/gumboz/board.c
@@ -1,4 +1,4 @@
-/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+/* Copyright 2020 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -10,7 +10,7 @@
#include "driver/accel_kionix.h"
#include "driver/accelgyro_lsm6dsm.h"
#include "driver/bc12/pi3usb9201.h"
-#include "driver/ppc/aoz1380.h"
+#include "driver/ppc/aoz1380_public.h"
#include "driver/ppc/nx20p348x.h"
#include "driver/tcpm/nct38xx.h"
#include "driver/usb_mux/amd_fp5.h"
@@ -36,8 +36,8 @@
#include "usb_pd_tcpm.h"
#include "usbc_ppc.h"
-#define CPRINTSUSB(format, args...) cprints(CC_USBCHARGE, format, ## args)
-#define CPRINTFUSB(format, args...) cprintf(CC_USBCHARGE, format, ## args)
+#define CPRINTSUSB(format, args...) cprints(CC_USBCHARGE, format, ##args)
+#define CPRINTFUSB(format, args...) cprintf(CC_USBCHARGE, format, ##args)
/* This I2C moved. Temporarily detect and support the V0 HW. */
int I2C_PORT_BATTERY = I2C_PORT_BATTERY_V1;
@@ -49,21 +49,17 @@ static struct mutex g_lid_mutex;
static struct mutex g_base_mutex;
/* sensor private data */
-static struct kionix_accel_data g_kx022_data;
+static struct kionix_accel_data g_kx022_data;
static struct lsm6dsm_data g_lsm6dsm_data = LSM6DSM_DATA;
/* Matrix to rotate accelrator into standard reference frame */
-static const mat33_fp_t lid_standard_ref = {
- { FLOAT_TO_FP(-1), 0, 0},
- { 0, FLOAT_TO_FP(-1), 0},
- { 0, 0, FLOAT_TO_FP(1)}
-};
+static const mat33_fp_t lid_standard_ref = { { FLOAT_TO_FP(-1), 0, 0 },
+ { 0, FLOAT_TO_FP(-1), 0 },
+ { 0, 0, FLOAT_TO_FP(1) } };
-static const mat33_fp_t base_standard_ref = {
- { FLOAT_TO_FP(-1), 0, 0},
- { 0, FLOAT_TO_FP(-1), 0},
- { 0, 0, FLOAT_TO_FP(1)}
-};
+static const mat33_fp_t base_standard_ref = { { FLOAT_TO_FP(-1), 0, 0 },
+ { 0, FLOAT_TO_FP(-1), 0 },
+ { 0, 0, FLOAT_TO_FP(1) } };
/* TODO(gcc >= 5.0) Remove the casts to const pointer at rot_standard_ref */
struct motion_sensor_t motion_sensors[] = {
@@ -199,33 +195,43 @@ const struct usb_mux_driver usbc0_sbu_mux_driver = {
* Since PI3USB221 is not a i2c device, .i2c_port and
* .i2c_addr_flags are not required here.
*/
-const struct usb_mux usbc0_sbu_mux = {
- .usb_port = USBC_PORT_C0,
- .driver = &usbc0_sbu_mux_driver,
+const struct usb_mux_chain usbc0_sbu_mux = {
+ .mux =
+ &(const struct usb_mux){
+ .usb_port = USBC_PORT_C0,
+ .driver = &usbc0_sbu_mux_driver,
+ },
};
-struct usb_mux usbc1_amd_fp5_usb_mux = {
- .usb_port = USBC_PORT_C1,
- .i2c_port = I2C_PORT_USB_AP_MUX,
- .i2c_addr_flags = AMD_FP5_MUX_I2C_ADDR_FLAGS,
- .driver = &amd_fp5_usb_mux_driver,
- .flags = USB_MUX_FLAG_SET_WITHOUT_FLIP,
+struct usb_mux_chain usbc1_amd_fp5_usb_mux = {
+ .mux =
+ &(const struct usb_mux){
+ .usb_port = USBC_PORT_C1,
+ .i2c_port = I2C_PORT_USB_AP_MUX,
+ .i2c_addr_flags = AMD_FP5_MUX_I2C_ADDR_FLAGS,
+ .driver = &amd_fp5_usb_mux_driver,
+ .flags = USB_MUX_FLAG_SET_WITHOUT_FLIP,
+ },
};
-struct usb_mux usb_muxes[] = {
+struct usb_mux_chain usb_muxes[] = {
[USBC_PORT_C0] = {
- .usb_port = USBC_PORT_C0,
- .i2c_port = I2C_PORT_USB_AP_MUX,
- .i2c_addr_flags = AMD_FP5_MUX_I2C_ADDR_FLAGS,
- .driver = &amd_fp5_usb_mux_driver,
- .next_mux = &usbc0_sbu_mux,
+ .mux = &(const struct usb_mux) {
+ .usb_port = USBC_PORT_C0,
+ .i2c_port = I2C_PORT_USB_AP_MUX,
+ .i2c_addr_flags = AMD_FP5_MUX_I2C_ADDR_FLAGS,
+ .driver = &amd_fp5_usb_mux_driver,
+ },
+ .next = &usbc0_sbu_mux,
},
[USBC_PORT_C1] = {
- .usb_port = USBC_PORT_C1,
- .i2c_port = I2C_PORT_TCPC1,
- .i2c_addr_flags = PS8743_I2C_ADDR1_FLAG,
- .driver = &ps8743_usb_mux_driver,
- .next_mux = &usbc1_amd_fp5_usb_mux,
+ .mux = &(const struct usb_mux) {
+ .usb_port = USBC_PORT_C1,
+ .i2c_port = I2C_PORT_TCPC1,
+ .i2c_addr_flags = PS8743_I2C_ADDR1_FLAG,
+ .driver = &ps8743_usb_mux_driver,
+ },
+ .next = &usbc1_amd_fp5_usb_mux,
}
};
BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == USBC_PORT_COUNT);
@@ -268,8 +274,7 @@ void ppc_interrupt(enum gpio_signal signal)
int board_set_active_charge_port(int port)
{
- int is_valid_port = (port >= 0 &&
- port < CONFIG_USB_PD_PORT_MAX_COUNT);
+ int is_valid_port = (port >= 0 && port < CONFIG_USB_PD_PORT_MAX_COUNT);
int i;
if (port == CHARGE_PORT_NONE) {
@@ -290,7 +295,6 @@ int board_set_active_charge_port(int port)
return EC_ERROR_INVAL;
}
-
/* Check if the port is sourcing VBUS. */
if (ppc_is_sourcing_vbus(port)) {
CPRINTFUSB("Skip enable C%d", port);
@@ -392,7 +396,6 @@ static void reset_nct38xx_port(int port)
msleep(NCT3807_RESET_POST_DELAY_MS);
}
-
void board_reset_pd_mcu(void)
{
/* Reset TCPC0 */
@@ -463,11 +466,9 @@ int board_pd_set_frs_enable(int port, int enable)
/* Use the TCPC to enable fast switch when FRS included */
if (port == USBC_PORT_C0) {
- rv = ioex_set_level(IOEX_USB_C0_TCPC_FASTSW_CTL_EN,
- !!enable);
+ rv = ioex_set_level(IOEX_USB_C0_TCPC_FASTSW_CTL_EN, !!enable);
} else {
- rv = ioex_set_level(IOEX_USB_C1_TCPC_FASTSW_CTL_EN,
- !!enable);
+ rv = ioex_set_level(IOEX_USB_C1_TCPC_FASTSW_CTL_EN, !!enable);
}
return rv;
@@ -539,14 +540,13 @@ int usb_port_enable[USBA_PORT_COUNT] = {
* The connector has 24 pins total, and there is no pin 0.
*/
const int keyboard_factory_scan_pins[][2] = {
- {0, 5}, {1, 1}, {1, 0}, {0, 6}, {0, 7},
- {1, 4}, {1, 3}, {1, 6}, {1, 7}, {3, 1},
- {2, 0}, {1, 5}, {2, 6}, {2, 7}, {2, 1},
- {2, 4}, {2, 5}, {1, 2}, {2, 3}, {2, 2},
- {3, 0}, {-1, -1}, {-1, -1}, {-1, -1},
+ { 0, 5 }, { 1, 1 }, { 1, 0 }, { 0, 6 }, { 0, 7 }, { 1, 4 },
+ { 1, 3 }, { 1, 6 }, { 1, 7 }, { 3, 1 }, { 2, 0 }, { 1, 5 },
+ { 2, 6 }, { 2, 7 }, { 2, 1 }, { 2, 4 }, { 2, 5 }, { 1, 2 },
+ { 2, 3 }, { 2, 2 }, { 3, 0 }, { -1, -1 }, { -1, -1 }, { -1, -1 },
};
const int keyboard_factory_scan_pins_used =
- ARRAY_SIZE(keyboard_factory_scan_pins);
+ ARRAY_SIZE(keyboard_factory_scan_pins);
#endif
#define CHARGING_CURRENT_500MA 500
@@ -586,12 +586,11 @@ int charger_profile_override(struct charge_state_data *curr)
if (chipset_in_state(CHIPSET_STATE_ANY_OFF))
return 0;
- curr->requested_current = (limit_charge) ? CHARGING_CURRENT_500MA
- : curr->batt.desired_current;
+ curr->requested_current = (limit_charge) ? CHARGING_CURRENT_500MA :
+ curr->batt.desired_current;
if (limit_usbc_power != limit_usbc_power_backup) {
- rp = (limit_usbc_power) ? TYPEC_RP_1A5
- : TYPEC_RP_3A0;
+ rp = (limit_usbc_power) ? TYPEC_RP_1A5 : TYPEC_RP_3A0;
ppc_set_vbus_source_current_limit(0, rp);
tcpm_select_rp_value(0, rp);
@@ -605,13 +604,13 @@ int charger_profile_override(struct charge_state_data *curr)
}
enum ec_status charger_profile_override_get_param(uint32_t param,
- uint32_t *value)
+ uint32_t *value)
{
return EC_RES_INVALID_PARAM;
}
enum ec_status charger_profile_override_set_param(uint32_t param,
- uint32_t value)
+ uint32_t value)
{
return EC_RES_INVALID_PARAM;
}
diff --git a/board/gumboz/board.h b/board/gumboz/board.h
index 42e2b23c32..b2f7682ed8 100644
--- a/board/gumboz/board.h
+++ b/board/gumboz/board.h
@@ -1,4 +1,4 @@
-/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+/* Copyright 2020 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -20,7 +20,7 @@
#define CONFIG_USB_PD_PORT_MAX_COUNT 2
#define CONFIG_USB_PORT_ENABLE_DYNAMIC
-#undef CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON
+#undef CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON
#define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON 40000
#define CONFIG_CHARGER_PROFILE_OVERRIDE
@@ -38,7 +38,7 @@
#define CONFIG_ACCELGYRO_LSM6DSM
#define CONFIG_ACCEL_LSM6DSM_INT_EVENT \
TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL)
-#define CONFIG_ACCEL_KX022 /* Lid accel */
+#define CONFIG_ACCEL_KX022 /* Lid accel */
#define CONFIG_CMD_ACCELS
#define CONFIG_CMD_ACCEL_INFO
#define CONFIG_TABLET_MODE
@@ -48,42 +48,36 @@
#define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL
#define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL
-
-
/* GPIO mapping from board specific name to EC common name. */
-#define CONFIG_BATTERY_PRESENT_GPIO GPIO_EC_BATT_PRES_ODL
-#define CONFIG_SCI_GPIO GPIO_EC_FCH_SCI_ODL
-#define GPIO_AC_PRESENT GPIO_ACOK_OD
-#define GPIO_CPU_PROCHOT GPIO_PROCHOT_ODL
-#define GPIO_EC_INT_L GPIO_EC_AP_INT_ODL
-#define GPIO_ENABLE_BACKLIGHT_L GPIO_EC_EDP_BL_DISABLE
-#define GPIO_ENTERING_RW GPIO_EC_ENTERING_RW
-#define GPIO_KBD_KSO2 GPIO_EC_KSO_02_INV
-#define GPIO_PCH_PWRBTN_L GPIO_EC_FCH_PWR_BTN_L
-#define GPIO_PCH_RSMRST_L GPIO_EC_FCH_RSMRST_L
-#define GPIO_PCH_SLP_S3_L GPIO_SLP_S3_L
-#define GPIO_PCH_SLP_S5_L GPIO_SLP_S5_L
-#define GPIO_PCH_SYS_PWROK GPIO_EC_FCH_PWROK
-#define GPIO_PCH_WAKE_L GPIO_EC_FCH_WAKE_L
-#define GPIO_POWER_BUTTON_L GPIO_EC_PWR_BTN_ODL
-#define GPIO_S0_PGOOD GPIO_S0_PWROK_OD
-#define GPIO_S5_PGOOD GPIO_EC_PWROK_OD
-#define GPIO_SYS_RESET_L GPIO_EC_SYS_RST_L
-#define GPIO_VOLUME_DOWN_L GPIO_VOLDN_BTN_ODL
-#define GPIO_VOLUME_UP_L GPIO_VOLUP_BTN_ODL
-#define GPIO_WP_L GPIO_EC_WP_L
-#define GPIO_PACKET_MODE_EN GPIO_EC_H1_PACKET_MODE
+#define CONFIG_BATTERY_PRESENT_GPIO GPIO_EC_BATT_PRES_ODL
+#define CONFIG_SCI_GPIO GPIO_EC_FCH_SCI_ODL
+#define GPIO_AC_PRESENT GPIO_ACOK_OD
+#define GPIO_CPU_PROCHOT GPIO_PROCHOT_ODL
+#define GPIO_EC_INT_L GPIO_EC_AP_INT_ODL
+#define GPIO_ENABLE_BACKLIGHT_L GPIO_EC_EDP_BL_DISABLE
+#define GPIO_ENTERING_RW GPIO_EC_ENTERING_RW
+#define GPIO_KBD_KSO2 GPIO_EC_KSO_02_INV
+#define GPIO_PCH_PWRBTN_L GPIO_EC_FCH_PWR_BTN_L
+#define GPIO_PCH_RSMRST_L GPIO_EC_FCH_RSMRST_L
+#define GPIO_PCH_SLP_S3_L GPIO_SLP_S3_L
+#define GPIO_PCH_SLP_S5_L GPIO_SLP_S5_L
+#define GPIO_PCH_SYS_PWROK GPIO_EC_FCH_PWROK
+#define GPIO_PCH_WAKE_L GPIO_EC_FCH_WAKE_L
+#define GPIO_POWER_BUTTON_L GPIO_EC_PWR_BTN_ODL
+#define GPIO_S0_PGOOD GPIO_S0_PWROK_OD
+#define GPIO_S5_PGOOD GPIO_EC_PWROK_OD
+#define GPIO_SYS_RESET_L GPIO_EC_SYS_RST_L
+#define GPIO_VOLUME_DOWN_L GPIO_VOLDN_BTN_ODL
+#define GPIO_VOLUME_UP_L GPIO_VOLUP_BTN_ODL
+#define GPIO_WP_L GPIO_EC_WP_L
+#define GPIO_PACKET_MODE_EN GPIO_EC_H1_PACKET_MODE
#ifndef __ASSEMBLER__
/* This I2C moved. Temporarily detect and support the V0 HW. */
extern int I2C_PORT_BATTERY;
-enum adc_channel {
- ADC_TEMP_SENSOR_CHARGER,
- ADC_TEMP_SENSOR_SOC,
- ADC_CH_COUNT
-};
+enum adc_channel { ADC_TEMP_SENSOR_CHARGER, ADC_TEMP_SENSOR_SOC, ADC_CH_COUNT };
enum battery_type {
BATTERY_SIMPLO_COS,
@@ -95,20 +89,11 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-enum pwm_channel {
- PWM_CH_KBLIGHT = 0,
- PWM_CH_COUNT
-};
+enum pwm_channel { PWM_CH_KBLIGHT = 0, PWM_CH_COUNT };
-enum ioex_port {
- IOEX_C0_NCT3807 = 0,
- IOEX_C1_NCT3807,
- IOEX_PORT_COUNT
-};
+enum ioex_port { IOEX_C0_NCT3807 = 0, IOEX_C1_NCT3807, IOEX_PORT_COUNT };
-#define PORT_TO_HPD(port) ((port == 0) \
- ? GPIO_USB3_C0_DP2_HPD \
- : GPIO_DP1_HPD)
+#define PORT_TO_HPD(port) ((port == 0) ? GPIO_USB3_C0_DP2_HPD : GPIO_DP1_HPD)
enum temp_sensor_id {
TEMP_SENSOR_CHARGER = 0,
@@ -117,17 +102,9 @@ enum temp_sensor_id {
TEMP_SENSOR_COUNT
};
-enum usba_port {
- USBA_PORT_A0 = 0,
- USBA_PORT_A1,
- USBA_PORT_COUNT
-};
+enum usba_port { USBA_PORT_A0 = 0, USBA_PORT_A1, USBA_PORT_COUNT };
-enum usbc_port {
- USBC_PORT_C0 = 0,
- USBC_PORT_C1,
- USBC_PORT_COUNT
-};
+enum usbc_port { USBC_PORT_C0 = 0, USBC_PORT_C1, USBC_PORT_COUNT };
/*****************************************************************************
* CBI EC FW Configuration
diff --git a/board/gumboz/build.mk b/board/gumboz/build.mk
index 1c0cbc4f63..45c71f962c 100644
--- a/board/gumboz/build.mk
+++ b/board/gumboz/build.mk
@@ -1,5 +1,5 @@
# -*- makefile -*-
-# Copyright 2020 The Chromium OS Authors. All rights reserved.
+# Copyright 2020 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
diff --git a/board/gumboz/ec.tasklist b/board/gumboz/ec.tasklist
index d9c1606eb2..abc796f74f 100644
--- a/board/gumboz/ec.tasklist
+++ b/board/gumboz/ec.tasklist
@@ -1,4 +1,4 @@
-/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+/* Copyright 2020 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
diff --git a/board/gumboz/gpio.inc b/board/gumboz/gpio.inc
index 9beaecc17a..2e7e4b78a9 100644
--- a/board/gumboz/gpio.inc
+++ b/board/gumboz/gpio.inc
@@ -1,6 +1,6 @@
/* -*- mode:c -*-
*
- * Copyright 2020 The Chromium OS Authors. All rights reserved.
+ * Copyright 2020 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
diff --git a/board/gumboz/led.c b/board/gumboz/led.c
index ac27fe3a2c..95f61494f9 100644
--- a/board/gumboz/led.c
+++ b/board/gumboz/led.c
@@ -1,4 +1,4 @@
-/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+/* Copyright 2020 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -23,11 +23,9 @@
#define LED_TICKS_PER_CYCLE 10
#define LED_ON_TICKS 5
-const enum ec_led_id supported_led_ids[] = {
- EC_LED_ID_LEFT_LED,
- EC_LED_ID_RIGHT_LED,
- EC_LED_ID_POWER_LED
-};
+const enum ec_led_id supported_led_ids[] = { EC_LED_ID_LEFT_LED,
+ EC_LED_ID_RIGHT_LED,
+ EC_LED_ID_POWER_LED };
const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids);
@@ -35,13 +33,10 @@ enum led_color {
LED_OFF = 0,
LED_AMBER,
LED_WHITE,
- LED_COLOR_COUNT /* Number of colors, not a color itself */
+ 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 void led_set_color_battery(int port, enum led_color color)
{
@@ -51,9 +46,9 @@ static void led_set_color_battery(int port, enum led_color color)
cbi_get_board_version(&board_ver);
amber_led = (port == LEFT_PORT ? GPIO_LED_CHRG_L :
- IOEX_C1_CHARGER_LED_AMBER_DB);
+ IOEX_C1_CHARGER_LED_AMBER_DB);
white_led = (port == LEFT_PORT ? GPIO_LED_FULL_L :
- IOEX_C1_CHARGER_LED_WHITE_DB);
+ IOEX_C1_CHARGER_LED_WHITE_DB);
if ((board_ver >= 2) && (port == RIGHT_PORT)) {
led_batt_on_lvl = 1;
@@ -156,16 +151,15 @@ static void set_active_port_color(enum led_color color)
if (led_auto_control_is_enabled(EC_LED_ID_RIGHT_LED))
led_set_color_battery(RIGHT_PORT,
- (port == RIGHT_PORT) ? color : LED_OFF);
+ (port == RIGHT_PORT) ? color : LED_OFF);
if (led_auto_control_is_enabled(EC_LED_ID_LEFT_LED))
led_set_color_battery(LEFT_PORT,
- (port == LEFT_PORT) ? color : LED_OFF);
+ (port == LEFT_PORT) ? color : LED_OFF);
}
static void led_set_battery(void)
{
static int battery_ticks;
- uint32_t chflags = charge_get_flags();
battery_ticks++;
@@ -177,9 +171,12 @@ static void led_set_battery(void)
case PWR_STATE_DISCHARGE:
if (led_auto_control_is_enabled(EC_LED_ID_RIGHT_LED)) {
if (charge_get_percent() < 10)
- led_set_color_battery(RIGHT_PORT,
- (battery_ticks % LED_TICKS_PER_CYCLE
- < LED_ON_TICKS) ? LED_WHITE : LED_OFF);
+ led_set_color_battery(
+ RIGHT_PORT,
+ (battery_ticks % LED_TICKS_PER_CYCLE <
+ LED_ON_TICKS) ?
+ LED_WHITE :
+ LED_OFF);
else
led_set_color_battery(RIGHT_PORT, LED_OFF);
}
@@ -188,19 +185,20 @@ static void led_set_battery(void)
led_set_color_battery(LEFT_PORT, LED_OFF);
break;
case PWR_STATE_ERROR:
- set_active_port_color((battery_ticks & 0x2) ?
- LED_WHITE : LED_OFF);
+ set_active_port_color((battery_ticks & 0x2) ? LED_WHITE :
+ LED_OFF);
break;
case PWR_STATE_CHARGE_NEAR_FULL:
set_active_port_color(LED_WHITE);
break;
case PWR_STATE_IDLE: /* External power connected in IDLE */
- if (chflags & CHARGE_FLAG_FORCE_IDLE)
- set_active_port_color((battery_ticks %
- LED_TICKS_PER_CYCLE < LED_ON_TICKS) ?
- LED_AMBER : LED_OFF);
- else
- set_active_port_color(LED_WHITE);
+ set_active_port_color(LED_WHITE);
+ break;
+ case PWR_STATE_FORCED_IDLE:
+ set_active_port_color(
+ (battery_ticks % LED_TICKS_PER_CYCLE < LED_ON_TICKS) ?
+ LED_AMBER :
+ LED_OFF);
break;
default:
/* Other states don't alter LED behavior */
@@ -217,9 +215,10 @@ 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 %
- LED_TICKS_PER_CYCLE < LED_ON_TICKS) ?
- LED_WHITE : LED_OFF);
+ led_set_color_power(
+ (power_tick % LED_TICKS_PER_CYCLE < LED_ON_TICKS) ?
+ LED_WHITE :
+ LED_OFF);
else
led_set_color_power(LED_OFF);
}