summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Staaf <robotboy@chromium.org>2014-10-28 10:53:14 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-10-29 18:37:48 +0000
commit4626fd37dfe05e45593bf717b71d1b99df70d75e (patch)
tree13d130e069b2a5ab6fa4fdcf2f31e2dfe0be387c
parentca74d14ea9c9aa4b6fe95998350856c096beec43 (diff)
downloadchrome-ec-4626fd37dfe05e45593bf717b71d1b99df70d75e.tar.gz
USB: Add simple serial subclass support
This uses the newly allocated simple serial SubClass and Protocol identifiers to make enumeration of serial consoles over USB easier. The simple usb serial kernel driver can select based on vid/class/subclass/protocol, making it trivial to attach to serial consoles. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Enable USB console on discovery-stm32f072 and verify that a new ttyUSB? device is discovered. Change-Id: I6d3e414a20753573c2ee90a48fb1d5dce2c3972d Reviewed-on: https://chromium-review.googlesource.com/225869 Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org>
-rw-r--r--chip/stm32/usb-stream.h4
-rw-r--r--chip/stm32/usb_console.c4
-rw-r--r--include/usb.h4
3 files changed, 8 insertions, 4 deletions
diff --git a/chip/stm32/usb-stream.h b/chip/stm32/usb-stream.h
index ae6735a281..92cfc4e60d 100644
--- a/chip/stm32/usb-stream.h
+++ b/chip/stm32/usb-stream.h
@@ -151,8 +151,8 @@ extern struct out_stream_ops const usb_stream_out_stream_ops;
.bAlternateSetting = 0, \
.bNumEndpoints = 2, \
.bInterfaceClass = USB_CLASS_VENDOR_SPEC, \
- .bInterfaceSubClass = 0, \
- .bInterfaceProtocol = 0, \
+ .bInterfaceSubClass = USB_SUBCLASS_GOOGLE_SERIAL, \
+ .bInterfaceProtocol = USB_PROTOCOL_GOOGLE_SERIAL, \
.iInterface = 0, \
}; \
const struct usb_endpoint_descriptor \
diff --git a/chip/stm32/usb_console.c b/chip/stm32/usb_console.c
index ab7244da9f..81121dfcc7 100644
--- a/chip/stm32/usb_console.c
+++ b/chip/stm32/usb_console.c
@@ -37,8 +37,8 @@ const struct usb_interface_descriptor USB_IFACE_DESC(USB_IFACE_CONSOLE) = {
.bAlternateSetting = 0,
.bNumEndpoints = 2,
.bInterfaceClass = USB_CLASS_VENDOR_SPEC,
- .bInterfaceSubClass = 0,
- .bInterfaceProtocol = 0,
+ .bInterfaceSubClass = USB_SUBCLASS_GOOGLE_SERIAL,
+ .bInterfaceProtocol = USB_PROTOCOL_GOOGLE_SERIAL,
.iInterface = 0,
};
const struct usb_endpoint_descriptor USB_EP_DESC(USB_IFACE_CONSOLE, 0) = {
diff --git a/include/usb.h b/include/usb.h
index 98e81794ab..bf2bb8fd6a 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -154,6 +154,10 @@ struct usb_endpoint_descriptor {
/* USB Vendor ID assigned to Google Inc. */
#define USB_VID_GOOGLE 0x18d1
+/* Google specific SubClass/Protocol assignments */
+#define USB_SUBCLASS_GOOGLE_SERIAL 0x50
+#define USB_PROTOCOL_GOOGLE_SERIAL 0x01
+
/* Control requests */
/* bRequestType fields */