Commit 8d252db1 authored by Xuebing Wang's avatar Xuebing Wang Committed by Felipe Balbi

usb: gadget: f_uac1: update Class-Specific AudioControl Interface Header Descriptor

Update this according to USB Audio Class 1.0 spec. This fixes the Windows 7
detection issue.

Cc: Rafael Brune <mail@rbrune.de>
Signed-off-by: default avatarXuebing Wang <xbing6@gmail.com>
Signed-off-by: default avatarFabio Estevam <festevam@gmail.com>
Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
(Fixed some code style issues)
Tested-by: default avatarPeter Chen <peter.chen@freescale.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 625763d1
...@@ -31,7 +31,7 @@ static int generic_get_cmd(struct usb_audio_control *con, u8 cmd); ...@@ -31,7 +31,7 @@ static int generic_get_cmd(struct usb_audio_control *con, u8 cmd);
*/ */
#define F_AUDIO_AC_INTERFACE 0 #define F_AUDIO_AC_INTERFACE 0
#define F_AUDIO_AS_INTERFACE 1 #define F_AUDIO_AS_INTERFACE 1
#define F_AUDIO_NUM_INTERFACES 2 #define F_AUDIO_NUM_INTERFACES 1
/* B.3.1 Standard AC Interface Descriptor */ /* B.3.1 Standard AC Interface Descriptor */
static struct usb_interface_descriptor ac_interface_desc = { static struct usb_interface_descriptor ac_interface_desc = {
...@@ -42,14 +42,18 @@ static struct usb_interface_descriptor ac_interface_desc = { ...@@ -42,14 +42,18 @@ static struct usb_interface_descriptor ac_interface_desc = {
.bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
}; };
DECLARE_UAC_AC_HEADER_DESCRIPTOR(2); /*
* The number of AudioStreaming and MIDIStreaming interfaces
* in the Audio Interface Collection
*/
DECLARE_UAC_AC_HEADER_DESCRIPTOR(1);
#define UAC_DT_AC_HEADER_LENGTH UAC_DT_AC_HEADER_SIZE(F_AUDIO_NUM_INTERFACES) #define UAC_DT_AC_HEADER_LENGTH UAC_DT_AC_HEADER_SIZE(F_AUDIO_NUM_INTERFACES)
/* 1 input terminal, 1 output terminal and 1 feature unit */ /* 1 input terminal, 1 output terminal and 1 feature unit */
#define UAC_DT_TOTAL_LENGTH (UAC_DT_AC_HEADER_LENGTH + UAC_DT_INPUT_TERMINAL_SIZE \ #define UAC_DT_TOTAL_LENGTH (UAC_DT_AC_HEADER_LENGTH + UAC_DT_INPUT_TERMINAL_SIZE \
+ UAC_DT_OUTPUT_TERMINAL_SIZE + UAC_DT_FEATURE_UNIT_SIZE(0)) + UAC_DT_OUTPUT_TERMINAL_SIZE + UAC_DT_FEATURE_UNIT_SIZE(0))
/* B.3.2 Class-Specific AC Interface Descriptor */ /* B.3.2 Class-Specific AC Interface Descriptor */
static struct uac1_ac_header_descriptor_2 ac_header_desc = { static struct uac1_ac_header_descriptor_1 ac_header_desc = {
.bLength = UAC_DT_AC_HEADER_LENGTH, .bLength = UAC_DT_AC_HEADER_LENGTH,
.bDescriptorType = USB_DT_CS_INTERFACE, .bDescriptorType = USB_DT_CS_INTERFACE,
.bDescriptorSubtype = UAC_HEADER, .bDescriptorSubtype = UAC_HEADER,
...@@ -57,8 +61,8 @@ static struct uac1_ac_header_descriptor_2 ac_header_desc = { ...@@ -57,8 +61,8 @@ static struct uac1_ac_header_descriptor_2 ac_header_desc = {
.wTotalLength = __constant_cpu_to_le16(UAC_DT_TOTAL_LENGTH), .wTotalLength = __constant_cpu_to_le16(UAC_DT_TOTAL_LENGTH),
.bInCollection = F_AUDIO_NUM_INTERFACES, .bInCollection = F_AUDIO_NUM_INTERFACES,
.baInterfaceNr = { .baInterfaceNr = {
[0] = F_AUDIO_AC_INTERFACE, /* Interface number of the first AudioStream interface */
[1] = F_AUDIO_AS_INTERFACE, [0] = 1,
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment