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

Commit 0a6d1573 authored by Anson Jacob's avatar Anson Jacob Committed by Amit Pundir
Browse files

usb: gadget: f_audio_source: Fixed USB Audio Class Interface Descriptor



Fixed Android Issue #56549.

When both Vendor Class and Audio Class are activated for AOA 2.0,
the baInterfaceNr of the AudioControl Interface Descriptor points
to wrong interface numbers. They should be pointing to
Audio Control Device and Audio Streaming interfaces.

Replaced baInterfaceNr with the correct value.

Change-Id: Iaa083f3d97c1f0fc9481bf87852b2b51278a6351
Signed-off-by: default avatarAnson Jacob <ansonkuzhumbil@gmail.com>
parent 48d391de
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -580,12 +580,18 @@ audio_bind(struct usb_configuration *c, struct usb_function *f)
		goto fail;
		goto fail;
	ac_interface_desc.bInterfaceNumber = status;
	ac_interface_desc.bInterfaceNumber = status;


	/* AUDIO_AC_INTERFACE */
	ac_header_desc.baInterfaceNr[0] = status;

	status = usb_interface_id(c, f);
	status = usb_interface_id(c, f);
	if (status < 0)
	if (status < 0)
		goto fail;
		goto fail;
	as_interface_alt_0_desc.bInterfaceNumber = status;
	as_interface_alt_0_desc.bInterfaceNumber = status;
	as_interface_alt_1_desc.bInterfaceNumber = status;
	as_interface_alt_1_desc.bInterfaceNumber = status;


	/* AUDIO_AS_INTERFACE */
	ac_header_desc.baInterfaceNr[1] = status;

	status = -ENODEV;
	status = -ENODEV;


	/* allocate our endpoint */
	/* allocate our endpoint */