plankton: modify request_voltage after redundant 5V-PDO removal

After removing redundant 5V source PDO for plankton, the index of
request_voltage need to minus 1.

BUG=chrome-os-partner:33737
BRANCH=samus
TEST=make BOARD=plankton, and test 5V/12V/20V buttons on plankton
board

Change-Id: I82f3f8ef72ce54221fb31027b10ff428f2440c9f
Reviewed-on: https://chromium-review.googlesource.com/229255
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Pin-chih Lin <johnylin@chromium.org>
Tested-by: Pin-chih Lin <johnylin@chromium.org>
This commit is contained in:
Johny Lin
2014-11-12 19:21:13 +08:00
committed by chrome-internal-fetch
parent 208f28fac1
commit f2aeae1efd

View File

@@ -33,9 +33,9 @@ const uint32_t pd_src_pdo[] = {
PDO_FIXED(20000, 3000, PDO_FIXED_EXTERNAL|PDO_FIXED_DUAL_ROLE),
};
static const int pd_src_pdo_cnts[3] = {
[SRC_CAP_5V] = 2,
[SRC_CAP_12V] = 3,
[SRC_CAP_20V] = 4,
[SRC_CAP_5V] = 1,
[SRC_CAP_12V] = 2,
[SRC_CAP_20V] = 3,
};
static int pd_src_pdo_idx;
@@ -147,8 +147,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 >= 3);
gpio_set_level(GPIO_USBC_VSEL_1, requested_voltage_idx >= 4);
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;
}