summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2017-12-08 15:00:37 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-12-13 22:33:22 -0800
commit81ca8fc4b82f3648b52fdd8415f8e8af95081298 (patch)
treeda48a23ec7f32743950319afce4ffe0f7d0c9b0d /board
parent755517e2cfc213936107c60768455fd90748d75e (diff)
downloadchrome-ec-81ca8fc4b82f3648b52fdd8415f8e8af95081298.tar.gz
zoombini: meowth: Enable 3A output.
BUG=None BRANCH=None TEST=Flash zoombini; Plug in a PD sink, verify that 5V 3A source caps are sent. Plug in a second device, verify that 5V 1.5A source caps are sent. Unplug the first device and verify that 5V 3A source caps are sent. TEST=Repeat above tests for meowth. Change-Id: I0c2b6ce1d2793230f3855856c58633d8cae4b375 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/818336 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/zoombini/board.h2
-rw-r--r--board/zoombini/usb_pd_policy.c20
2 files changed, 21 insertions, 1 deletions
diff --git a/board/zoombini/board.h b/board/zoombini/board.h
index 7b66234628..0b394f014d 100644
--- a/board/zoombini/board.h
+++ b/board/zoombini/board.h
@@ -93,7 +93,7 @@
#endif /* defined(BOARD_ZOOMBINI) */
#define CONFIG_USB_PD_DUAL_ROLE
#define CONFIG_USB_PD_LOGGING
-/* TODO(aaboagye): What about CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT? */
+#define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT TYPEC_RP_3A0
#define CONFIG_USB_PD_VBUS_DETECT_TCPC
#define CONFIG_USB_PD_TCPM_PS8805
#define CONFIG_USB_PD_TCPM_TCPCI
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,