summaryrefslogtreecommitdiff
path: root/baseboard/trogdor/usb_pd_policy.c
diff options
context:
space:
mode:
Diffstat (limited to 'baseboard/trogdor/usb_pd_policy.c')
-rw-r--r--baseboard/trogdor/usb_pd_policy.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/baseboard/trogdor/usb_pd_policy.c b/baseboard/trogdor/usb_pd_policy.c
index 56ca4514d5..7954d0a352 100644
--- a/baseboard/trogdor/usb_pd_policy.c
+++ b/baseboard/trogdor/usb_pd_policy.c
@@ -1,4 +1,4 @@
-/* Copyright 2019 The Chromium OS Authors. All rights reserved.
+/* Copyright 2019 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -12,8 +12,8 @@
#include "usbc_ppc.h"
#include "util.h"
-#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args)
-#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args)
+#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ##args)
+#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ##args)
int pd_check_vconn_swap(int port)
{
@@ -23,10 +23,10 @@ int pd_check_vconn_swap(int port)
static uint8_t vbus_en[CONFIG_USB_PD_PORT_MAX_COUNT];
#if CONFIG_USB_PD_PORT_MAX_COUNT == 1
-static uint8_t vbus_rp[CONFIG_USB_PD_PORT_MAX_COUNT] = {TYPEC_RP_1A5};
+static uint8_t vbus_rp[CONFIG_USB_PD_PORT_MAX_COUNT] = { TYPEC_RP_1A5 };
#else
-static uint8_t vbus_rp[CONFIG_USB_PD_PORT_MAX_COUNT] = {TYPEC_RP_1A5,
- TYPEC_RP_1A5};
+static uint8_t vbus_rp[CONFIG_USB_PD_PORT_MAX_COUNT] = { TYPEC_RP_1A5,
+ TYPEC_RP_1A5 };
#endif
static void board_vbus_update_source_current(int port)
@@ -107,11 +107,11 @@ __override int svdm_dp_config(int port, uint32_t *payload)
* (3) plug a monitor to the port-1 dongle.
*/
- 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 */
+ 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 */
return 2;
};
@@ -187,8 +187,7 @@ __override int svdm_dp_attention(int port, uint32_t *payload)
* because of the board USB-C topology (limited to 2
* lanes DP).
*/
- usb_mux_set(port, USB_PD_MUX_DOCK,
- USB_SWITCH_CONNECT,
+ usb_mux_set(port, USB_PD_MUX_DOCK, USB_SWITCH_CONNECT,
polarity_rm_dts(pd_get_polarity(port)));
} else {
/* Disconnect the DP port selection mux. */
@@ -200,13 +199,11 @@ __override int svdm_dp_attention(int port, uint32_t *payload)
ppc_set_sbu(port, 0);
/* Disconnect the DP but keep the USB SS lines in TCPC chip. */
- usb_mux_set(port, USB_PD_MUX_USB_ENABLED,
- USB_SWITCH_CONNECT,
+ usb_mux_set(port, USB_PD_MUX_USB_ENABLED, USB_SWITCH_CONNECT,
polarity_rm_dts(pd_get_polarity(port)));
}
- if (chipset_in_state(CHIPSET_STATE_ANY_SUSPEND) &&
- (irq || lvl))
+ if (chipset_in_state(CHIPSET_STATE_ANY_SUSPEND) && (irq || lvl))
/*
* Wake up the AP. IRQ or level high indicates a DP sink is now
* present.
@@ -233,8 +230,8 @@ __override int svdm_dp_attention(int port, uint32_t *payload)
CPRINTS("C%d: Recv IRQ. HPD->1", port);
/* Set the minimum time delay (2ms) for the next HPD IRQ */
- svdm_hpd_deadline[port] = get_time().val +
- HPD_USTREAM_DEBOUNCE_LVL;
+ svdm_hpd_deadline[port] =
+ get_time().val + HPD_USTREAM_DEBOUNCE_LVL;
} else if (irq & !lvl) {
CPRINTF("ERR:HPD:IRQ&LOW\n");
return 0;
@@ -242,8 +239,8 @@ __override int svdm_dp_attention(int port, uint32_t *payload)
CPRINTS("C%d: Recv lvl. HPD->%d", port, lvl);
gpio_set_level(hpd, lvl);
/* Set the minimum time delay (2ms) for the next HPD IRQ */
- svdm_hpd_deadline[port] = get_time().val +
- HPD_USTREAM_DEBOUNCE_LVL;
+ svdm_hpd_deadline[port] =
+ get_time().val + HPD_USTREAM_DEBOUNCE_LVL;
}
return 1;
@@ -259,7 +256,7 @@ __override void svdm_exit_dp_mode(int port)
/* Signal AP for the HPD low event */
usb_mux_hpd_update(port, USB_PD_MUX_HPD_LVL_DEASSERTED |
- USB_PD_MUX_HPD_IRQ_DEASSERTED);
+ USB_PD_MUX_HPD_IRQ_DEASSERTED);
CPRINTS("C%d: DP exit. HPD->0", port);
gpio_set_level(GPIO_DP_HOT_PLUG_DET, 0);
}