summaryrefslogtreecommitdiff
path: root/board/dingdong
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/dingdong
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/dingdong')
-rw-r--r--board/dingdong/board.h1
-rw-r--r--board/dingdong/usb_pd_policy.c10
2 files changed, 6 insertions, 5 deletions
diff --git a/board/dingdong/board.h b/board/dingdong/board.h
index c814b6f48d..814df199bc 100644
--- a/board/dingdong/board.h
+++ b/board/dingdong/board.h
@@ -21,6 +21,7 @@
#define CONFIG_HW_CRC
#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/dingdong/usb_pd_policy.c b/board/dingdong/usb_pd_policy.c
index 2e18792733..5894427ca8 100644
--- a/board/dingdong/usb_pd_policy.c
+++ b/board/dingdong/usb_pd_policy.c
@@ -13,6 +13,7 @@
#include "task.h"
#include "timer.h"
#include "util.h"
+#include "usb.h"
#include "usb_pd.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;
@@ -187,11 +186,12 @@ static int svdm_enter_mode(int port, uint32_t *payload)
(PD_VDO_OPOS(payload[0]) != OPOS))
return 0; /* will generate 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;
}