]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: configfs: OS Extended Compatibility descriptors support
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Thu, 8 May 2014 12:06:26 +0000 (14:06 +0200)
committerFelipe Balbi <balbi@ti.com>
Wed, 14 May 2014 14:39:25 +0000 (09:39 -0500)
commit54b5cda1d17f5508a311616088be7d39494cafa8
tree83405fcd69a4ae077c3364f584ab90b1314449a3
parent2f74e57b2ab2309682eca41d4510e3fb88101a40
usb: gadget: configfs: OS Extended Compatibility descriptors support

Add handling of OS Extended Compatibility descriptors from configfs interface.
Hosts which expect the "OS Descriptors" ask only for configurations @ index 0,
but linux-based USB devices can provide more than one configuration.
This patch adds marking one of gadget's configurations the configuration
to be reported at index 0, regardless of the actual sequence of usb_add_config
invocations used for adding the configurations. The configuration is selected
by creating a symbolic link pointing to it from the "os_desc" directory
located at the top of a gadget's directory hierarchy.

One kind of "OS Descriptors" are "Extended Compatibility Descriptors",
which need to be specified per interface. This patch adds interface.<n>
directory in function's configfs directory to represent each interface
defined by the function. Each interface's directory contains two attributes:
"compatible_id" and "sub_compatible_id", which represent 8-byte
strings to be reported to the host as the "Compatible ID" and "Sub Compatible
ID".

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Documentation/ABI/testing/configfs-usb-gadget
drivers/usb/gadget/configfs.c
drivers/usb/gadget/configfs.h
include/linux/usb/composite.h