common/battery.c: Format with clang-format
BRANCH=none
TEST=none
@@ -77,7 +77,12 @@ static int check_print_error(int rv)
static void print_battery_status(void)
{
- static const char * const st[] = {"EMPTY", "FULL", "DCHG", "INIT",};
+ static const char *const st[] = {
+ "EMPTY",
+ "FULL",
+ "DCHG",
+ "INIT",
+ };
static const char *const al[] = { "RT", "RC", "--", "TD",
"OT", "--", "TC", "OC" };
@@ -138,10 +143,8 @@ static void print_battery_params(void)
ccprintf("%08x\n", batt->flags);
print_item_name("Temp:");
- ccprintf("0x%04x = %.1d K (%.1d C)\n",
- batt->temperature,
- batt->temperature,
- batt->temperature - 2731);
+ ccprintf("0x%04x = %.1d K (%.1d C)\n", batt->temperature,
+ batt->temperature, batt->temperature - 2731);
print_item_name("V:");
ccprintf("0x%04x = %d mV\n", batt->voltage, batt->voltage);
@@ -289,8 +292,7 @@ static int command_battery(int argc, char **argv)
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(battery, command_battery,
- "<repeat_count> <sleep_ms>",
+DECLARE_CONSOLE_COMMAND(battery, command_battery, "<repeat_count> <sleep_ms>",
"Print battery info");
#ifdef CONFIG_BATTERY_CUT_OFF
@@ -384,8 +386,7 @@ static int command_cutoff(int argc, char **argv)
return EC_ERROR_UNKNOWN;
}
-DECLARE_CONSOLE_COMMAND(cutoff, command_cutoff,
- "[at-shutdown]",
+DECLARE_CONSOLE_COMMAND(cutoff, command_cutoff, "[at-shutdown]",
"Cut off the battery output");
#else
int battery_is_cut_off(void)
@@ -488,11 +489,9 @@ host_command_battery_vendor_param(struct host_cmd_handler_args *args)
return rv;
}
DECLARE_HOST_COMMAND(EC_CMD_BATTERY_VENDOR_PARAM,
- host_command_battery_vendor_param,
- EC_VER_MASK(0));
+ host_command_battery_vendor_param, EC_VER_MASK(0));
#endif /* CONFIG_BATTERY_VENDOR_PARAM */
-
void battery_compensate_params(struct batt_params *batt)
{
int numer, denom;
@@ -602,7 +601,8 @@ __overridable enum battery_disconnect_state battery_get_disconnect_state(void)
* Returns true if input voltage should be reduced (chipset is in S5/G3) and
* battery is full, otherwise returns false
*/
-static bool board_wants_reduced_input_voltage(void) {
+static bool board_wants_reduced_input_voltage(void)
+{
struct batt_params batt;
/* Chipset not in S5/G3, so we don't want to reduce voltage */
@@ -656,8 +656,7 @@ static void reduce_input_voltage_when_full(void)
if (pd_get_max_voltage() != max_pd_voltage_mv)
pd_set_external_voltage_limit(port, max_pd_voltage_mv);
}
-DECLARE_HOOK(HOOK_AC_CHANGE, reduce_input_voltage_when_full,
- HOOK_PRIO_DEFAULT);
+DECLARE_HOOK(HOOK_AC_CHANGE, reduce_input_voltage_when_full, HOOK_PRIO_DEFAULT);
DECLARE_HOOK(HOOK_BATTERY_SOC_CHANGE, reduce_input_voltage_when_full,
HOOK_PRIO_DEFAULT);
DECLARE_HOOK(HOOK_CHIPSET_STARTUP, reduce_input_voltage_when_full,
