summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@google.com>2017-04-19 13:08:36 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-05-11 09:40:31 -0700
commit1c929523a2f8077c25cf650ddff983aea4e8ef10 (patch)
tree688ec8050e146f9290872a693fdb8974387aec83 /board
parentfc562bbf9bbe418a6e5995c13c004cdf5e111ce7 (diff)
downloadchrome-ec-1c929523a2f8077c25cf650ddff983aea4e8ef10.tar.gz
poppy: source 3A on one port
Add a new source policy to provide 3A if there is only one port used as a source. Also ensure that the load switch on VBUS when sourcing power is properly configured to limit the current to 1.5A or 3.0A depending on the case. BRANCH=none BUG=b:35585396 BUG=b:35577509 TEST=On soraka (rev1), connect any USB device on port 0. On port 1 attach C-C cable to MacBook Pro. MacBook Pro charges at ~1.5A. Disconnect USB device on port 0, MacBook Pro charges at 3A. TEST=On soraka (rev1), connect USB key on port 0, see it enumerating, plug another USB key on port 1, it enumerates too, and the device on port 0 does NOT disconnect/re-enumerate. TEST=Repeat 2 tests above, but starting with port 1. Change-Id: I48e744c8edec89bc0a53b54c47f666ad53e47551 Reviewed-on: https://chromium-review.googlesource.com/481563 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/poppy/usb_pd_policy.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/board/poppy/usb_pd_policy.c b/board/poppy/usb_pd_policy.c
index 3e39ac8269..085b86e738 100644
--- a/board/poppy/usb_pd_policy.c
+++ b/board/poppy/usb_pd_policy.c
@@ -110,9 +110,13 @@ int pd_set_power_supply_ready(int port)
/* Disable charging */
gpio_set_level(port ? GPIO_USB_C1_CHARGE_L :
GPIO_USB_C0_CHARGE_L, 1);
+
+ /* Ensure we advertise the proper available current quota */
+ charge_manager_source_port(port, 1);
+
/* Provide VBUS */
- gpio_set_level(port ? GPIO_USB_C1_5V_EN :
- GPIO_USB_C0_5V_EN, 1);
+ vbus_en[port] = 1;
+ board_vbus_update_source_current(port);
/* notify host of power info change */
pd_send_host_event(PD_EVENT_POWER_CHANGE);
@@ -123,8 +127,11 @@ int pd_set_power_supply_ready(int port)
void pd_power_supply_reset(int port)
{
/* Disable VBUS */
- gpio_set_level(port ? GPIO_USB_C1_5V_EN :
- GPIO_USB_C0_5V_EN, 0);
+ vbus_en[port] = 0;
+ board_vbus_update_source_current(port);
+
+ /* Give back the current quota we are no longer using */
+ charge_manager_source_port(port, 0);
/* notify host of power info change */
pd_send_host_event(PD_EVENT_POWER_CHANGE);