summaryrefslogtreecommitdiff
path: root/board/plankton
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2017-02-28 15:33:00 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-03-07 14:15:56 -0800
commitad089de4b0430e5d997b9f6d6f187daae1fb11dc (patch)
treebf6668423a37f7beba6f9c1b24765385cc6e6135 /board/plankton
parent5b8b06e976623ad52a1c4c558dfdac8b1c9d3dc7 (diff)
downloadchrome-ec-ad089de4b0430e5d997b9f6d6f187daae1fb11dc.tar.gz
pdcontrol: Suspend port individually
pdcontrol suspend command will be used to prevent tcpm from putting the chip into sleep while firmware update is taking place. Currently the command suspends or resumes port 0. This patch makes the command apply to ports individually. pd enable console command now takes a port number: pd <port> enable/disable. This patch also replaces CONFIG_USB_PD_COMM_ENABLED with _DISABLED. When it's defined, PD communication is disabled at startup. Plankton undefines CONFIG_USB_PD_COMM_ENABLED enable, intending to disable PD communication at startup. Therefore, this patch defines CONFIG_USB_PD_COMM_DISABLED in its board.h. BUG=b:35586859 BRANCH=none TEST=From AP console: localhost # /tmp/ectool pdcontrol suspend 1 [600.188013 TCPC p1 suspended!] > pd 1 state Port C1 CC1, Dis - Role: SNK-UFP State: SUSPENDED, Flags: 0x0020 localhost # /tmp/ectool pdcontrol resume 1 [678.516613 TCPC p1 resumed!] > pd 1 state Port C1 CC1, Ena - Role: SNK-UFP State: DRP_AUTO_TOGGLE, Flags: 0x0020 From ec console: > pd 1 disable Port C1 disable > pd 1 state Port C1 CC1, Dis - Role: SNK-UFP State: DRP_AUTO_TOGGLE, Flags: 0x0020 > pd 1 enable Port C1 enabled > pd 1 state Port C1 CC1, Ena - Role: SNK-UFP State: DRP_AUTO_TOGGLE, Flags: 0x0020 Change-Id: Ia0cc4904ac52adc4b89de20918968c8df78b9c80 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/447968 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/plankton')
-rw-r--r--board/plankton/board.c6
-rw-r--r--board/plankton/board.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/board/plankton/board.c b/board/plankton/board.c
index 5bc6b776a3..b725989047 100644
--- a/board/plankton/board.c
+++ b/board/plankton/board.c
@@ -203,14 +203,14 @@ static void detect_cc_cable(void)
TYPEC_CABLE_SINGLE_CC;
/* Flip back to original polarity and enable PD comms */
set_active_cc(!active_cc);
- pd_comm_enable(1);
+ pd_comm_enable(0, 1);
break;
case TYPEC_CABLE_SINGLE_CC:
case TYPEC_CABLE_DOUBLE_CC:
/* Check for disconnection and disable PD comms */
if (!pd_is_connected(0)) {
cable = TYPEC_CABLE_NONE;
- pd_comm_enable(0);
+ pd_comm_enable(0, 0);
}
break;
}
@@ -269,7 +269,7 @@ static void update_usbc_dual_role(int dual_role)
/* Need to make sure both CC lines are set for SNK or SRC. */
set_active_cc(host_mode);
/* Ensure that PD communication is enabled. */
- pd_comm_enable(1);
+ pd_comm_enable(0, 1);
} else {
drp_enable = 0;
/*
diff --git a/board/plankton/board.h b/board/plankton/board.h
index 994fb98c76..590c6ef7f3 100644
--- a/board/plankton/board.h
+++ b/board/plankton/board.h
@@ -19,7 +19,7 @@
#define CONFIG_STM_HWTIMER32
#define CONFIG_USB_POWER_DELIVERY
#define CONFIG_USB_PD_ALT_MODE
-#undef CONFIG_USB_PD_COMM_ENABLED
+#define CONFIG_USB_PD_COMM_DISABLED
#define CONFIG_USB_PD_CUSTOM_VDM
#define CONFIG_USB_PD_DUAL_ROLE
#define CONFIG_USB_PD_DYNAMIC_SRC_CAP