diff options
author | Wai-Hong Tam <waihong@google.com> | 2019-07-23 17:24:54 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-07-23 17:30:05 +0000 |
commit | 89e348c0a13878a2d44b61621a5d69d5440b2d16 (patch) | |
tree | 2e11c181376d631212f393b46d58c2d37dc71578 | |
parent | 978add22f0c63984644653ab98630ae2931214e3 (diff) | |
download | chrome-ec-89e348c0a13878a2d44b61621a5d69d5440b2d16.tar.gz |
Revert "servo_v4: Support command to limit the max_voltage"
This reverts commit 978add22f0c63984644653ab98630ae2931214e3.
Reason for revert: This conflict hasn't resolved.
Original change's description:
> servo_v4: Support command to limit the max_voltage
>
> firmware_PDVbusRequest forces servo v4 to different max_voltage
> limits to verify the PD negotiation. Add the firmware support for it.
> The console command usbc_action is the same as Plankton. So the test
> side doesn't need any change.
>
> BRANCH=servo
> BUG=b:134700685
> TEST=Tried usbc_action command and ran firmware_PDVbusRequest passed.
>
> Change-Id: I5f05d73d9a2f92fe26514285e7c251e9fa27aba8
> Signed-off-by: Wai-Hong Tam <waihong@google.com>
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1686221
> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
> (cherry picked from commit 167648267e5307b497ca64948f3bd79ac0327eb0)
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1686281
Bug: b:134700685
Change-Id: Id11f616e4e6de5f71d70a64d89bd58fe05811e15
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1715389
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Commit-Queue: Wai-Hong Tam <waihong@google.com>
Tested-by: Wai-Hong Tam <waihong@google.com>
-rw-r--r-- | board/servo_v4/usb_pd_policy.c | 48 |
1 files changed, 1 insertions, 47 deletions
diff --git a/board/servo_v4/usb_pd_policy.c b/board/servo_v4/usb_pd_policy.c index 26c2c23d28..9a781c6534 100644 --- a/board/servo_v4/usb_pd_policy.c +++ b/board/servo_v4/usb_pd_policy.c @@ -110,15 +110,10 @@ static int cc_pull_stored = TYPEC_CC_RD; */ #define MAX_MV_RED_BLUE 9000 -static int user_limited_max_mv = 20000; - static uint32_t max_supported_voltage(void) { - int board_max_mv = board_get_version() >= BOARD_VERSION_BLACK ? + return board_get_version() >= BOARD_VERSION_BLACK ? PD_MAX_VOLTAGE_MV : MAX_MV_RED_BLUE; - - return board_max_mv < user_limited_max_mv ? board_max_mv : - user_limited_max_mv; } static int charge_port_is_active(void) @@ -207,7 +202,6 @@ static void update_ports(void) if (pd_src_voltages_mv[i] > max_supported_voltage()) break; - /* Find the 'best' PDO <= voltage */ pdo_index = pd_find_pdo_index( CHG, pd_src_voltages_mv[i], &pdo); @@ -862,43 +856,3 @@ static int cmd_fake_disconnect(int argc, char *argv[]) } DECLARE_CONSOLE_COMMAND(fakedisconnect, cmd_fake_disconnect, "<delay_ms> <duration_ms>", NULL); -<<<<<<< HEAD (baf1eb servo_v4: Remove unnecessary init for GPIO MODULE_USB_PD) -======= - -static int cmd_usbc_action(int argc, char *argv[]) -{ - if (argc != 2) - return EC_ERROR_PARAM_COUNT; - - if (!strcasecmp(argv[1], "5v")) { - do_cc(CONFIG_SRC(cc_config)); - user_limited_max_mv = 5000; - update_ports(); - } else if (!strcasecmp(argv[1], "12v")) { - do_cc(CONFIG_SRC(cc_config)); - user_limited_max_mv = 12000; - update_ports(); - } else if (!strcasecmp(argv[1], "20v")) { - do_cc(CONFIG_SRC(cc_config)); - user_limited_max_mv = 20000; - update_ports(); - } else if (!strcasecmp(argv[1], "dev")) { - /* Set the limit back to original */ - user_limited_max_mv = 20000; - do_cc(CONFIG_PDSNK(cc_config)); - } else if (!strcasecmp(argv[1], "drp")) { - /* Toggle the DRP state, compatible with Plankton. */ - do_cc(cc_config ^ CC_ENABLE_DRP); - CPRINTF("DRP = %d, host_mode = %d\n", - !!(cc_config & CC_ENABLE_DRP), - !!(cc_config & CC_ALLOW_SRC)); - } else { - return EC_ERROR_PARAM1; - } - - return EC_SUCCESS; -} -DECLARE_CONSOLE_COMMAND(usbc_action, cmd_usbc_action, - "5v|12v|20v|dev|drp", - "Set Servo v4 type-C port state"); ->>>>>>> CHANGE (f3b961 servo_v4: Support command to limit the max_voltage) |