summaryrefslogtreecommitdiff
path: root/board/zoombini/usb_pd_policy.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/zoombini/usb_pd_policy.c')
-rw-r--r--board/zoombini/usb_pd_policy.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/board/zoombini/usb_pd_policy.c b/board/zoombini/usb_pd_policy.c
index 02e29a0736..e5c7a975f7 100644
--- a/board/zoombini/usb_pd_policy.c
+++ b/board/zoombini/usb_pd_policy.c
@@ -27,6 +27,11 @@ const uint32_t pd_src_pdo[] = {
};
const int pd_src_pdo_cnt = ARRAY_SIZE(pd_src_pdo);
+const uint32_t pd_src_pdo_max[] = {
+ PDO_FIXED(5000, 3000, PDO_FIXED_FLAGS),
+};
+const int pd_src_pdo_max_cnt = ARRAY_SIZE(pd_src_pdo_max);
+
/* TODO(aaboagye): Determine correct values. */
const uint32_t pd_snk_pdo[] = {
PDO_FIXED(5000, 500, PDO_FIXED_FLAGS),
@@ -108,6 +113,11 @@ void pd_power_supply_reset(int port)
/* Disable VBUS. */
ppc_vbus_source_enable(port, 0);
+#ifdef CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT
+ /* Give back the current quota we are no longer using */
+ charge_manager_source_port(port, 0);
+#endif /* defined(CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT) */
+
/* Notify host of power info change. */
pd_send_host_event(PD_EVENT_POWER_CHANGE);
}
@@ -129,6 +139,11 @@ int pd_set_power_supply_ready(int port)
if (rv)
return rv;
+#ifdef CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT
+ /* Ensure we advertise the proper available current quota */
+ charge_manager_source_port(port, 1);
+#endif /* defined(CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT) */
+
/* Notify host of power info change. */
pd_send_host_event(PD_EVENT_POWER_CHANGE);
@@ -140,6 +155,11 @@ void pd_transition_voltage(int idx)
/* No-operation: we are always 5V */
}
+void typec_set_source_current_limit(int p, int rp)
+{
+ ppc_set_vbus_source_current_limit(p, rp);
+}
+
/* ----------------- Vendor Defined Messages ------------------ */
const struct svdm_response svdm_rsp = {
.identity = NULL,