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>
This commit is contained in:
Vincent Palatin
2015-06-12 12:06:28 -07:00
committed by ChromeOS Commit Bot
parent c86743ce59
commit 1dfd58daf6
4 changed files with 9 additions and 5 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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) {

View File

@@ -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