summaryrefslogtreecommitdiff
path: root/board/hoho
diff options
context:
space:
mode:
authorTodd Broch <tbroch@chromium.org>2014-10-20 16:58:56 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-10-31 06:29:28 +0000
commitaac88442d7bbc76ec5116fdb3019af09cc522938 (patch)
tree5fb6bbe02b0b78e3837cecea41574e08382c3aee /board/hoho
parent13579c3570df0b7f3535d8c5499468761a482734 (diff)
downloadchrome-ec-aac88442d7bbc76ec5116fdb3019af09cc522938.tar.gz
pd: dingdong/hoho: inhibit USB Billboard.
USB Billboard class can be used to advertise an alternate mode capable device that hasn't entered a mode. Additionally it can remain after mode entry providing its Billboard capabilities descriptor is updated. This CL postpones enumeration which previously occurred after boot until tAMETimeout has passed and alternate mode has NOT been entered. Future CL could choose to also (re)enumerate with mode capabilities although this is not required by the USB PD specification. BRANCH=none BUG=chrome-os-partner:31192,chrome-os-partner:31193 TEST=manual, With DFP_U which does not enter mode see Billboard class enumerate else it does not. Change-Id: I59a0815cd0ea551ba9a878907c0184df4ba9480c Signed-off-by: Todd Broch <tbroch@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/224663 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/hoho')
-rw-r--r--board/hoho/board.h1
-rw-r--r--board/hoho/usb_pd_policy.c10
2 files changed, 6 insertions, 5 deletions
diff --git a/board/hoho/board.h b/board/hoho/board.h
index c341b479fe..d98ba5b135 100644
--- a/board/hoho/board.h
+++ b/board/hoho/board.h
@@ -29,6 +29,7 @@
#define CONFIG_SPI_CS_GPIO GPIO_PD_MCDP_SPI_CS_L
#define CONFIG_USB
#define CONFIG_USB_BOS
+#define CONFIG_USB_INHIBIT
#define CONFIG_USB_POWER_DELIVERY
#define CONFIG_USB_PD_ALT_MODE
#define CONFIG_USB_PD_DUAL_ROLE
diff --git a/board/hoho/usb_pd_policy.c b/board/hoho/usb_pd_policy.c
index 4eff69b49e..3da52023c3 100644
--- a/board/hoho/usb_pd_policy.c
+++ b/board/hoho/usb_pd_policy.c
@@ -12,6 +12,7 @@
#include "registers.h"
#include "task.h"
#include "timer.h"
+#include "usb.h"
#include "usb_pd.h"
#include "util.h"
#include "version.h"
@@ -145,10 +146,8 @@ const uint32_t vdo_dp_mode[MODE_CNT] = {
static int svdm_response_modes(int port, uint32_t *payload)
{
- if (PD_VDO_VID(payload[0]) != USB_SID_DISPLAYPORT) {
- /* TODO(tbroch) USB billboard enabled here then */
- return 1; /* will generate a NAK */
- }
+ if (PD_VDO_VID(payload[0]) != USB_SID_DISPLAYPORT)
+ return 0; /* nak */
memcpy(payload + 1, vdo_dp_mode, sizeof(vdo_dp_mode));
return MODE_CNT + 1;
@@ -186,11 +185,12 @@ static int svdm_enter_mode(int port, uint32_t *payload)
(PD_VDO_OPOS(payload[0]) != OPOS))
return 0; /* will generate a NAK */
+ /* TODO(tbroch) Enumerate USB BB here with updated mode choice */
alt_mode = OPOS;
return 1;
}
-int pd_alt_mode(int port)
+int pd_alt_mode(void)
{
return alt_mode;
}