summaryrefslogtreecommitdiff
path: root/board/gingerbread
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2021-06-05 22:59:05 -0700
committerCommit Bot <commit-bot@chromium.org>2021-06-16 06:56:56 +0000
commitb1af8c3689ecc265092f034d6ce8ee715d2614d8 (patch)
tree09cc72a66b8b8301e8af7b8fda16aa23e2387c80 /board/gingerbread
parentadb8ca2325f4768251d3e6584ecd7b3841419571 (diff)
downloadchrome-ec-b1af8c3689ecc265092f034d6ce8ee715d2614d8.tar.gz
gingerbread: VBUS on/off and detect for port C1
This CL adds gingerbread specific functions to control and detect VBUS for port C1. This port does not have a PPC, but port C0 does which means PPC related configs are defined. A NULL PPC driver is added so any calls into PPC functions from common code will be correctly handled by the check for NULL functions. The functions which are needed are related to controlling and dectecting VBUS presence. BUG=b:159330563 BRANCH=quiche TEST=verfied that C1 attaches as a SRC/DFP [10.367330 C1: PE_SRC_Ready] [10.368772 C1: Attempting to enter DP mode] [10.374422 C1: PE_VDM_Request_DPM] [10.401563 C1: PE_SRC_Ready] [10.408082 C1: PE_VDM_Request_DPM] [10.435540 C1: PE_SRC_Ready] [10.436511 pin_mode: 4, mf: 0, mux: 2] [10.442645 C1: PE_VDM_Request_DPM] [10.470346 C1: Entered DP mode] [10.470480 C1: PE_SRC_Ready] > > pd 1 state Port C1 CC2, Enable - Role: SRC-DFP-VC TC State: Attached.SRC, Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I3027b2904592063294f0258da5e153db15ae0d6e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2949953 Commit-Queue: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'board/gingerbread')
-rw-r--r--board/gingerbread/board.c15
-rw-r--r--board/gingerbread/board.h3
2 files changed, 10 insertions, 8 deletions
diff --git a/board/gingerbread/board.c b/board/gingerbread/board.c
index c23ace51b0..6a2ae0c683 100644
--- a/board/gingerbread/board.c
+++ b/board/gingerbread/board.c
@@ -43,6 +43,14 @@
#endif
#ifdef SECTION_IS_RW
+/*
+ * C1 port on gingerbread does not have a PPC. However, C0 port does have a PPC
+ * and therefore PPC related config options are defined. Defining a null driver
+ * here so that functions from usbc_ppc.c will correctly dereference to a NULL
+ * function pointer.
+ */
+const struct ppc_drv board_ppc_null_drv = {};
+
static int pd_dual_role_init[CONFIG_USB_PD_PORT_MAX_COUNT] = {
PD_DRP_TOGGLE_ON,
PD_DRP_FORCE_SOURCE,
@@ -187,13 +195,8 @@ struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_MAX_COUNT] = {
.i2c_addr_flags = SN5S330_ADDR0_FLAGS,
.drv = &sn5s330_drv
},
- /*
- * TODO(b/159330563): The stub driver has not yet landed (and may not
- * land) in TOT. Need to comment this out for now, until the correct
- * solution for asymmetrical port hardware exists.
- */
[USB_PD_PORT_DP] = {
- /* .drv = &ppc_stub_drv */
+ .drv = &board_ppc_null_drv
},
};
unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips);
diff --git a/board/gingerbread/board.h b/board/gingerbread/board.h
index dd8b1fd6de..f631429cdb 100644
--- a/board/gingerbread/board.h
+++ b/board/gingerbread/board.h
@@ -34,8 +34,7 @@
#define CONFIG_USB_PD_PORT_MAX_COUNT 2
#define CONFIG_USB_MUX_TUSB1064
-#define CONFIG_USBC_PPC_STUB
-#define CONFIG_USB_PD_VBUS_ALERT_TCPC
+#define BOARD_C1_NO_PPC
#define CONFIG_USB_PID 0x5049
#define CONFIG_USB_BCD_DEV 0x0001 /* v 0.01 */