summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2016-10-26 13:58:25 +0200
committerchrome-bot <chrome-bot@chromium.org>2016-10-31 03:27:49 -0700
commitcf7ff32b92275f9d4cce4bc3bcaa7d8890b0cb2e (patch)
tree37b80e9f034a01ef8c2a38901500266273a9db92 /include
parent34066e92a92b6ff0f1b4b311b46d13b6a4ab45e3 (diff)
downloadchrome-ec-cf7ff32b92275f9d4cce4bc3bcaa7d8890b0cb2e.tar.gz
kevin: set accurate current limit on USB load switch
When sourcing current on the type-C port, set the OCP limit on the VBUS load switch according to current dynamic capability. (3.0A when only one port is a power source, 1.5A else) Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=gru BUG=chrome-os-partner:56110 TEST=manual: connect Caroline to Kevin with Twinkie in between, ask Caroline to sink current through the UI. without anything else connected on Kevin, see 3A flowing when measuring with Twinkie ('tw vbus'), plug a dangling C-to-A receptacle dongle on the other Kevin port and see 1.5A flowing through Twinkie. Force the input current limit on Caroline to 3.0A and see Kevin cutting VBUS. Change-Id: Ib879b1ed720b20aa702c5f3643948ba0575d1193 Reviewed-on: https://chromium-review.googlesource.com/403869 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/charge_manager.h8
-rw-r--r--include/usb_pd.h8
2 files changed, 16 insertions, 0 deletions
diff --git a/include/charge_manager.h b/include/charge_manager.h
index 51007f3d7b..939471163b 100644
--- a/include/charge_manager.h
+++ b/include/charge_manager.h
@@ -120,4 +120,12 @@ int board_set_active_charge_port(int charge_port);
*/
void board_set_charge_limit(int port, int supplier, int charge_ma, int max_ma);
+/*
+ * Get whether the port is sourcing power on VBUS.
+ *
+ * @param port PD port.
+ * @return VBUS power state.
+ */
+int board_vbus_source_enabled(int port);
+
#endif /* __CROS_EC_CHARGE_MANAGER_H */
diff --git a/include/usb_pd.h b/include/usb_pd.h
index c588596e4c..a6be237102 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -1002,6 +1002,14 @@ void typec_set_input_current_limit(int port, uint32_t max_ma,
uint32_t supply_voltage);
/**
+ * Set the type-C current limit when sourcing current..
+ *
+ * @param port USB-C port number
+ * @param rp One of enum tcpc_rp_value (eg TYPEC_RP_3A0) defining the limit.
+ */
+void typec_set_source_current_limit(int port, int rp);
+
+/**
* Verify board specific health status : current, voltages...
*
* @return EC_SUCCESS if the board is good, <0 else.