summaryrefslogtreecommitdiff
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorHemant Kumar <hemantk@codeaurora.org>2017-06-07 18:54:42 -0700
committerHemant Kumar <hemantk@codeaurora.org>2017-06-07 19:04:31 -0700
commite5223a9107e5ee250ad67ea4cb68eac7f1365e17 (patch)
treed2a25b425455cb3a8ee55f1094fb454096738e8a /drivers/usb/core
parenteb28d0da158f7bfe2f94b3d1cb003fb7abda0c15 (diff)
usb: core: Add support to parse config summary capability descriptors
This descriptor describes the list of functions present in a given configuration. There should be one such descriptor per configuration supported by the device. The order in which these descriptors appear in the BOS descriptor reflects the order of preference of configurations as desired by the device for optimal functionality. Configuration Summary descriptors are used by Host software to decide which Configuration to set to obtain the desired functionality. Change-Id: I7ec095ce19caa690c0d3dc0fdd3add5ad37a74f3 Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/config.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 325cbc9c35d8..b1298f093f13 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -949,6 +949,14 @@ int usb_get_bos_descriptor(struct usb_device *dev)
dev->bos->ss_id =
(struct usb_ss_container_id_descriptor *)buffer;
break;
+ case USB_CAP_TYPE_CONFIG_SUMMARY:
+ /* one such desc per configuration */
+ if (!dev->bos->num_config_summary_desc)
+ dev->bos->config_summary =
+ (struct usb_config_summary_descriptor *)buffer;
+
+ dev->bos->num_config_summary_desc++;
+ break;
default:
break;
}