plankton: fix charging voltage selection

Fix for plankton v2 so that the VBUS voltage selection buttons
work properly (5V, 12V, and 20V).

BUG=none
BRANCH=none
TEST=load onto plankton v2, connect type-C to samus, and press
5V, 12V, and 20V buttons. read adc on samus side to verify it
is getting the proper voltage.

Change-Id: I5004675bf658834219c295292c669182af7d8393
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/217258
Reviewed-by: Vic Yang <victoryang@chromium.org>
This commit is contained in:
Alec Berg
2014-09-10 02:15:19 -07:00
committed by chrome-internal-fetch
parent b16cda06a8
commit 491eb1e5f2
2 changed files with 5 additions and 2 deletions

View File

@@ -42,14 +42,17 @@ static void set_usbc_action(enum usbc_action act)
case USBC_ACT_5V_TO_DUT:
board_set_source_cap(SRC_CAP_5V);
pd_set_dual_role(PD_DRP_FORCE_SOURCE);
pd_soft_reset();
break;
case USBC_ACT_12V_TO_DUT:
board_set_source_cap(SRC_CAP_12V);
pd_set_dual_role(PD_DRP_FORCE_SOURCE);
pd_soft_reset();
break;
case USBC_ACT_20V_TO_DUT:
board_set_source_cap(SRC_CAP_20V);
pd_set_dual_role(PD_DRP_FORCE_SOURCE);
pd_soft_reset();
break;
case USBC_ACT_DEVICE:
pd_set_dual_role(PD_DRP_FORCE_SINK);

View File

@@ -127,8 +127,8 @@ int pd_set_power_supply_ready(int port)
{
/* Output the correct voltage */
gpio_set_level(GPIO_VBUS_CHARGER_EN, 1);
gpio_set_level(GPIO_USBC_VSEL_0, requested_voltage_idx >= 1);
gpio_set_level(GPIO_USBC_VSEL_1, requested_voltage_idx >= 2);
gpio_set_level(GPIO_USBC_VSEL_0, requested_voltage_idx >= 2);
gpio_set_level(GPIO_USBC_VSEL_1, requested_voltage_idx >= 3);
return EC_SUCCESS;
}