common/dps.c: Format with clang-format
BRANCH=none
TEST=none
#include "util.h"
#include "usb_pe_sm.h"
-
#define K_MORE_PWR 96
#define K_LESS_PWR 93
#define K_SAMPLE 1
#define DPS_FLAG_SAMPLED BIT(3)
#define DPS_FLAG_NEED_MORE_PWR BIT(4)
-#define DPS_FLAG_STOP_EVENTS (DPS_FLAG_DISABLED | \
- DPS_FLAG_NO_SRCCAP)
+#define DPS_FLAG_STOP_EVENTS (DPS_FLAG_DISABLED | DPS_FLAG_NO_SRCCAP)
#define DPS_FLAG_ALL GENMASK(31, 0)
#define MAX_MOVING_AVG_WINDOW 5
@@ -135,8 +133,7 @@ static void dps_init(void)
CPRINTS("ERR:WIN");
}
- if (dps_config.k_less_pwr > 100 ||
- dps_config.k_more_pwr > 100 ||
+ if (dps_config.k_less_pwr > 100 || dps_config.k_more_pwr > 100 ||
dps_config.k_more_pwr <= dps_config.k_less_pwr) {
dps_config.k_less_pwr = K_LESS_PWR;
dps_config.k_more_pwr = K_MORE_PWR;
@@ -419,7 +416,6 @@ static bool has_new_power_request(struct pdo_candidate *cand)
}
}
-
/*
* if the candidate is the same as the current one, pick
* the one at active charge port.
@@ -505,8 +501,7 @@ void dps_task(void *u)
if (sample_count == dps_config.k_sample) {
dynamic_mv = curr_cand.mv;
dps_port = curr_cand.port;
- pd_dpm_request(dps_port,
- DPM_REQUEST_NEW_POWER_LEVEL);
+ pd_dpm_request(dps_port, DPM_REQUEST_NEW_POWER_LEVEL);
sample_count = 0;
flag &= ~(DPS_FLAG_SAMPLED | DPS_FLAG_NEED_MORE_PWR);
}
@@ -557,10 +552,8 @@ static int command_dps(int argc, char **argv)
"Efficient: %dmV\n"
"Batt: %dmv\n"
"PDMaxMV: %dmV\n",
- port, last_mv, last_ma,
- vbus, input_curr, input_pwr,
- get_efficient_voltage(),
- batt_mv,
+ port, last_mv, last_ma, vbus, input_curr, input_pwr,
+ get_efficient_voltage(), batt_mv,
pd_get_max_voltage());
return EC_SUCCESS;
}
@@ -657,6 +650,5 @@ static enum ec_status hc_usb_pd_dps_control(struct host_cmd_handler_args *args)
dps_enable(p->enable);
return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_CMD_USB_PD_DPS_CONTROL,
- hc_usb_pd_dps_control,
+DECLARE_HOST_COMMAND(EC_CMD_USB_PD_DPS_CONTROL, hc_usb_pd_dps_control,
EC_VER_MASK(0));
