summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2014-11-19 15:58:30 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-11-20 02:55:41 +0000
commitb3bf2a61a385bf9aee3b231b1a0051d9ea349811 (patch)
tree5cad03b32da38ea1140253fc3b1724026e20c2d7 /test
parentd5803a02693f72a80da64193a729a71ac585df6b (diff)
downloadchrome-ec-b3bf2a61a385bf9aee3b231b1a0051d9ea349811.tar.gz
charge_manager: Add PD_CHARGE_PORT_OVERRIDE host command
Add host command to set charge port override. BUG=chrome-os-partner:32003 BRANCH=Samus TEST=Manual on Samus. Insert PD charger in port1 and BC1.2 charger in port0. ./ectool --name=cros_pd chargeoverride 0 --> Charges from port 0 ./ectool --name=cros_pd chargeoverride off --> Charges from port 1 ./ectool --name=cros_pd chargeoverride dontcharge --> No charge port ./ectool --name=cros_pd chargeoverride 1 --> Charges from port 1 ./ectool --name=cros_pd chargeoverride 2 --> Correctly returns error Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: Ib35f797a4a24e96fd2e3c008ace3fd6291b89d25 Reviewed-on: https://chromium-review.googlesource.com/230910 Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/charge_manager.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/charge_manager.c b/test/charge_manager.c
index 52f6552da5..6c05d8e0b6 100644
--- a/test/charge_manager.c
+++ b/test/charge_manager.c
@@ -6,8 +6,11 @@
*/
#include "charge_manager.h"
+#include "common.h"
+#include "ec_commands.h"
#include "test_util.h"
#include "timer.h"
+#include "usb_pd.h"
#include "usb_pd_config.h"
#include "util.h"
@@ -75,6 +78,11 @@ int pd_get_partner_dualrole_capable(int port)
return dual_role_capable[port];
}
+int pd_get_role(int port)
+{
+ return PD_ROLE_SINK;
+}
+
static void wait_for_charge_manager_refresh(void)
{
msleep(CHARGE_MANAGER_SLEEP_MS);