summaryrefslogtreecommitdiff
path: root/board/pdeval-stm32f072
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2022-06-27 13:58:49 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-06-29 06:49:03 +0000
commit6ceb80f8e75d8410c00ba6645aed3d5d929e4d36 (patch)
treea1d793c2edefb423f84a8caacc05d8285a733ae9 /board/pdeval-stm32f072
parent2eb12ab2f412687cd977621b92f352fec5e3d36c (diff)
downloadchrome-ec-6ceb80f8e75d8410c00ba6645aed3d5d929e4d36.tar.gz
board/pdeval-stm32f072/usb_pd_policy.c: Format with clang-format
BUG=b:236386294 BRANCH=none TEST=none Change-Id: I37dfe31f1567bc0cf7c1d67b513b0c3d8132816e Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728819 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'board/pdeval-stm32f072')
-rw-r--r--board/pdeval-stm32f072/usb_pd_policy.c53
1 files changed, 22 insertions, 31 deletions
diff --git a/board/pdeval-stm32f072/usb_pd_policy.c b/board/pdeval-stm32f072/usb_pd_policy.c
index b7425ce66c..58bc05b990 100644
--- a/board/pdeval-stm32f072/usb_pd_policy.c
+++ b/board/pdeval-stm32f072/usb_pd_policy.c
@@ -17,18 +17,17 @@
#include "usb_pd.h"
#include "usb_pd_pdo.h"
-#define CPRINTF(format, args...) cprintf(CC_USBPD, format, ## args)
-#define CPRINTS(format, args...) cprints(CC_USBPD, format, ## args)
+#define CPRINTF(format, args...) cprintf(CC_USBPD, format, ##args)
+#define CPRINTS(format, args...) cprints(CC_USBPD, format, ##args)
/* Used to fake VBUS presence since no GPIO is available to read VBUS */
static int vbus_present;
-
#if defined(CONFIG_USB_PD_TCPM_MUX) && defined(CONFIG_USB_PD_TCPM_ANX7447)
const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
{
.usb_port = 0,
- .driver = &anx7447_usb_mux_driver,
+ .driver = &anx7447_usb_mux_driver,
},
};
#endif
@@ -81,8 +80,8 @@ void pd_power_supply_reset(int port)
void pd_set_input_current_limit(int port, uint32_t max_ma,
uint32_t supply_voltage)
{
- CPRINTS("USBPD current limit port %d max %d mA %d mV",
- port, max_ma, supply_voltage);
+ CPRINTS("USBPD current limit port %d max %d mA %d mV", port, max_ma,
+ supply_voltage);
/* do some LED coding of the power we can sink */
if (max_ma) {
if (supply_voltage > 6500)
@@ -98,8 +97,8 @@ void pd_set_input_current_limit(int port, uint32_t max_ma,
__override void typec_set_input_current_limit(int port, uint32_t max_ma,
uint32_t supply_voltage)
{
- CPRINTS("TYPEC current limit port %d max %d mA %d mV",
- port, max_ma, supply_voltage);
+ CPRINTS("TYPEC current limit port %d max %d mA %d mV", port, max_ma,
+ supply_voltage);
gpio_set_level(GPIO_LED_R, !!max_ma);
}
@@ -116,17 +115,14 @@ static int command_vbus_toggle(int argc, char **argv)
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(vbus, command_vbus_toggle,
- "",
- "Toggle VBUS detected");
+DECLARE_CONSOLE_COMMAND(vbus, command_vbus_toggle, "", "Toggle VBUS detected");
int pd_snk_is_vbus_provided(int port)
{
return vbus_present;
}
-__override int pd_check_data_swap(int port,
- enum pd_data_role data_role)
+__override int pd_check_data_swap(int port, enum pd_data_role data_role)
{
/* Always allow data swap */
return 1;
@@ -144,22 +140,18 @@ int pd_check_vconn_swap(int port)
}
#endif
-__override void pd_check_pr_role(int port,
- enum pd_power_role pr_role,
+__override void pd_check_pr_role(int port, enum pd_power_role pr_role,
int flags)
{
}
-__override void pd_check_dr_role(int port,
- enum pd_data_role dr_role,
- int flags)
+__override void pd_check_dr_role(int port, enum pd_data_role dr_role, int flags)
{
}
/* ----------------- Vendor Defined Messages ------------------ */
const uint32_t vdo_idh = VDO_IDH(1, /* data caps as USB host */
0, /* data caps as USB device */
- IDH_PTYPE_PERIPH,
- 0, /* supports alt modes */
+ IDH_PTYPE_PERIPH, 0, /* supports alt modes */
0x0000);
const uint32_t vdo_product = VDO_PRODUCT(0x0000, 0x0000);
@@ -233,11 +225,11 @@ __override int svdm_dp_config(int port, uint32_t *payload)
* board_set_usb_mux(port, USB_PD_MUX_DP_ENABLED,
* polarity_rm_dts(pd_get_polarity(port)));
*/
- payload[0] = VDO(USB_SID_DISPLAYPORT, 1,
- CMD_DP_CONFIG | VDO_OPOS(opos));
+ payload[0] =
+ VDO(USB_SID_DISPLAYPORT, 1, CMD_DP_CONFIG | VDO_OPOS(opos));
payload[1] = VDO_DP_CFG(pin_mode, /* pin mode */
- 1, /* DPv1.3 signaling */
- 2); /* UFP connected */
+ 1, /* DPv1.3 signaling */
+ 2); /* UFP connected */
return 2;
}
@@ -252,9 +244,9 @@ __override void svdm_dp_post_config(int port)
/* Note: Usage is deprecated, use usb_mux_hpd_update instead */
if (IS_ENABLED(CONFIG_USB_PD_TCPM_ANX7447))
- anx7447_tcpc_update_hpd_status(mux, USB_PD_MUX_HPD_LVL |
- USB_PD_MUX_HPD_IRQ_DEASSERTED,
- &unused);
+ anx7447_tcpc_update_hpd_status(
+ mux, USB_PD_MUX_HPD_LVL | USB_PD_MUX_HPD_IRQ_DEASSERTED,
+ &unused);
}
__override int svdm_dp_attention(int port, uint32_t *payload)
@@ -265,10 +257,9 @@ __override int svdm_dp_attention(int port, uint32_t *payload)
const struct usb_mux *mux = &usb_muxes[port];
bool unused;
- mux_state_t mux_state = (lvl ? USB_PD_MUX_HPD_LVL :
- USB_PD_MUX_HPD_LVL_DEASSERTED) |
- (irq ? USB_PD_MUX_HPD_IRQ :
- USB_PD_MUX_HPD_IRQ_DEASSERTED);
+ mux_state_t mux_state =
+ (lvl ? USB_PD_MUX_HPD_LVL : USB_PD_MUX_HPD_LVL_DEASSERTED) |
+ (irq ? USB_PD_MUX_HPD_IRQ : USB_PD_MUX_HPD_IRQ_DEASSERTED);
/* Note: Usage is deprecated, use usb_mux_hpd_update instead */
CPRINTS("Attention: 0x%x", payload[1]);