diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2015-06-12 12:06:28 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-06-13 02:53:48 +0000 |
commit | 1dfd58daf6d5a1d1452e7ce8f164b1e07c995d45 (patch) | |
tree | 02b3a55051ff4c2f10add9600e16795fc2a81a3f | |
parent | c86743ce597c4bf1274c57ef497f5723cbe538f4 (diff) | |
download | chrome-ec-1dfd58daf6d5a1d1452e7ce8f164b1e07c995d45.tar.gz |
pd: ryu: set data role to UFP with debug accessory
When a USB-PD debug accessory is plugged, set the default data role to
UFP (USB device) on Ryu.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=smaug
BUG=none
TEST=On Ryu, plug a SuzyQ and connect with ADB using a A-A cable.
Change-Id: Ifa62b097532880ab5cadb7f2ab7774eec752f1e6
Reviewed-on: https://chromium-review.googlesource.com/277276
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | board/ryu/board.h | 2 | ||||
-rw-r--r-- | board/ryu_p4p5/board.h | 2 | ||||
-rw-r--r-- | common/usb_pd_protocol.c | 7 | ||||
-rw-r--r-- | include/config.h | 3 |
4 files changed, 9 insertions, 5 deletions
diff --git a/board/ryu/board.h b/board/ryu/board.h index 72cc5f32a8..655e97a8b3 100644 --- a/board/ryu/board.h +++ b/board/ryu/board.h @@ -28,6 +28,8 @@ #define CONFIG_USB_PD_ALT_MODE #define CONFIG_USB_PD_ALT_MODE_DFP #define CONFIG_USB_PD_CUSTOM_VDM +#undef CONFIG_USB_PD_DEBUG_DR +#define CONFIG_USB_PD_DEBUG_DR PD_ROLE_UFP #define CONFIG_USB_PD_DUAL_ROLE #define CONFIG_USB_PD_FLASH_ERASE_CHECK #define CONFIG_USB_PD_INTERNAL_COMP diff --git a/board/ryu_p4p5/board.h b/board/ryu_p4p5/board.h index 93eda6f119..f57a248eba 100644 --- a/board/ryu_p4p5/board.h +++ b/board/ryu_p4p5/board.h @@ -27,6 +27,8 @@ #define CONFIG_STM_HWTIMER32 #define CONFIG_USB_CHARGER #define CONFIG_USB_POWER_DELIVERY +#undef CONFIG_USB_PD_DEBUG_DR +#define CONFIG_USB_PD_DEBUG_DR PD_ROLE_UFP #define CONFIG_USB_PD_DUAL_ROLE #define CONFIG_USB_PD_FLASH_ERASE_CHECK #define CONFIG_USB_PD_INTERNAL_COMP diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 50fb68142f..52b046328a 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -1503,11 +1503,8 @@ void pd_task(void) pd_power_supply_reset(port); #endif -#ifdef CONFIG_USBC_SS_MUX - board_set_usb_mux(port, TYPEC_MUX_USB, - USB_SWITCH_CONNECT, - pd[port].polarity); -#endif + /* Set the USB muxes and the default USB role */ + pd_set_data_role(port, CONFIG_USB_PD_DEBUG_DR); #ifdef CONFIG_CASE_CLOSED_DEBUG if (new_cc_state == PD_CC_DEBUG_ACC) { diff --git a/include/config.h b/include/config.h index 1c6c04518e..68a0ed7f59 100644 --- a/include/config.h +++ b/include/config.h @@ -1279,6 +1279,9 @@ /* Respond to custom vendor-defined messages over PD */ #undef CONFIG_USB_PD_CUSTOM_VDM +/* Default USB data role when a USB PD debug accessory is seen */ +#define CONFIG_USB_PD_DEBUG_DR PD_ROLE_DFP + /* Define if this board can act as a dual-role PD port (source and sink) */ #undef CONFIG_USB_PD_DUAL_ROLE |