summaryrefslogtreecommitdiff
path: root/board/flapjack
diff options
context:
space:
mode:
Diffstat (limited to 'board/flapjack')
-rw-r--r--board/flapjack/usb_pd_policy.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/board/flapjack/usb_pd_policy.c b/board/flapjack/usb_pd_policy.c
index d47ac5860c..738e10f421 100644
--- a/board/flapjack/usb_pd_policy.c
+++ b/board/flapjack/usb_pd_policy.c
@@ -75,12 +75,6 @@ void pd_power_supply_reset(int port)
/* ----------------- Vendor Defined Messages ------------------ */
#ifdef CONFIG_USB_PD_ALT_MODE_DFP
-/*
- * timestamp of the next possible toggle to ensure the 2-ms spacing
- * between IRQ_HPD.
- */
-static uint64_t hpd_deadline[CONFIG_USB_PD_PORT_MAX_COUNT];
-
__override void svdm_dp_post_config(int port)
{
const struct usb_mux * const mux = &usb_muxes[port];
@@ -94,7 +88,7 @@ __override void svdm_dp_post_config(int port)
gpio_set_level(GPIO_USB_C0_DP_POLARITY, pd_get_polarity(port));
/* set the minimum time delay (2ms) for the next HPD IRQ */
- hpd_deadline[port] = get_time().val + HPD_USTREAM_DEBOUNCE_LVL;
+ svdm_hpd_deadline[port] = get_time().val + HPD_USTREAM_DEBOUNCE_LVL;
mux->hpd_update(port, 1, 0);
}
@@ -122,8 +116,8 @@ __override int svdm_dp_attention(int port, uint32_t *payload)
if (irq & cur_lvl) {
uint64_t now = get_time().val;
/* wait for the minimum spacing between IRQ_HPD if needed */
- if (now < hpd_deadline[port])
- usleep(hpd_deadline[port] - now);
+ if (now < svdm_hpd_deadline[port])
+ usleep(svdm_hpd_deadline[port] - now);
/* generate IRQ_HPD pulse */
gpio_set_level(GPIO_USB_C0_HPD_OD, 0);
@@ -134,7 +128,8 @@ __override int svdm_dp_attention(int port, uint32_t *payload)
gpio_set_level(GPIO_USB_C0_DP_POLARITY, pd_get_polarity(port));
/* set the minimum time delay (2ms) for the next HPD IRQ */
- hpd_deadline[port] = get_time().val + HPD_USTREAM_DEBOUNCE_LVL;
+ svdm_hpd_deadline[port] = get_time().val +
+ HPD_USTREAM_DEBOUNCE_LVL;
} else if (irq & !cur_lvl) {
CPRINTF("ERR:HPD:IRQ&LOW\n");
return 0; /* nak */
@@ -143,7 +138,8 @@ __override int svdm_dp_attention(int port, uint32_t *payload)
gpio_set_level(GPIO_USB_C0_DP_OE_L, !lvl);
gpio_set_level(GPIO_USB_C0_DP_POLARITY, pd_get_polarity(port));
/* set the minimum time delay (2ms) for the next HPD IRQ */
- hpd_deadline[port] = get_time().val + HPD_USTREAM_DEBOUNCE_LVL;
+ svdm_hpd_deadline[port] = get_time().val +
+ HPD_USTREAM_DEBOUNCE_LVL;
}
/* ack */