Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38742261 authored by Hemant Kumar's avatar Hemant Kumar
Browse files

usb: core: Honor device preferred configuration



Currently driver looks for the highest revision of usb
audio class protocol version from the configuration
summary descriptors. Instead, select first device
preferred configuration not supporting full UAC 3.0 as
full UAC 3.0 is not currently supported by audio class
driver. Also, rename audio function subclass FULL_ADC_PROFILE
to FULL_ADC_3_0 as defined in spec.

Change-Id: I656e3f34e9f68530b886fd55ff2541318405fd2c
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 382f7f6b
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -57,13 +57,11 @@ static int usb_audio_max_rev_config(struct usb_host_bos *bos)
	for (desc_cnt = 0; desc_cnt < num_cfg_desc; desc_cnt++) {
		numfunc = conf_summary->bNumFunctions;
		for (func_cnt = 0; func_cnt < numfunc; func_cnt++) {
			/* look for BADD 3.0 */
			/* honor device preferred config */
			if (conf_summary->cs_info[func_cnt].bClass ==
				USB_CLASS_AUDIO &&
				conf_summary->cs_info[func_cnt].bProtocol ==
				UAC_VERSION_3 &&
				conf_summary->cs_info[func_cnt].bSubClass !=
				FULL_ADC_PROFILE)
				FULL_ADC_3_0)
				return conf_summary->bConfigurationValue;
		}
	}
+2 −1
Original line number Diff line number Diff line
@@ -50,7 +50,8 @@
#define CLUSTER_ID_MONO		0x0001
#define CLUSTER_ID_STEREO	0x0002

#define FULL_ADC_PROFILE	0x01
/* A.2 audio function subclass codes */
#define FULL_ADC_3_0		0x01

/* BADD Profile IDs */
#define PROF_GENERIC_IO		0x20
+1 −1
Original line number Diff line number Diff line
@@ -619,7 +619,7 @@ static int usb_audio_probe(struct usb_interface *intf,
	assoc = intf->intf_assoc;
	if (assoc && assoc->bFunctionClass == USB_CLASS_AUDIO &&
	    assoc->bFunctionProtocol == UAC_VERSION_3 &&
	    assoc->bFunctionSubClass == FULL_ADC_PROFILE) {
	    assoc->bFunctionSubClass == FULL_ADC_3_0) {
		dev_info(&dev->dev, "No support for full-fledged ADC 3.0 yet!!\n");
		return -EINVAL;
	}