All of lore.kernel.org
 help / color / mirror / Atom feed
* usb: gadget: f_uac2: fix bFirstInterface in composite gadget
@ 2018-01-12 18:43 John Keeping
  2018-02-14 17:04   ` [v2] " John Keeping
  0 siblings, 1 reply; 3+ messages in thread
From: John Keeping @ 2018-01-12 18:43 UTC (permalink / raw)
  To: linux-usb; +Cc: Felipe Balbi, Greg Kroah-Hartman, John Keeping

If there are multiple functions associated with a configuration, then
the UAC2 interfaces may not start at zero.  Set the correct first
interface number in the association descriptor so that the audio
interfaces are enumerated correctly in this case.

Signed-off-by: John Keeping <john@metanate.com>
---
 drivers/usb/gadget/function/f_uac2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c
index 11fe788b4308..d2dc1f00180b 100644
--- a/drivers/usb/gadget/function/f_uac2.c
+++ b/drivers/usb/gadget/function/f_uac2.c
@@ -524,6 +524,8 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
 		dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
 		return ret;
 	}
+	iad_desc.bFirstInterface = ret;
+
 	std_ac_if_desc.bInterfaceNumber = ret;
 	uac2->ac_intf = ret;
 	uac2->ac_alt = 0;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2] usb: gadget: f_uac2: fix bFirstInterface in composite gadget
@ 2018-02-14 17:04   ` John Keeping
  0 siblings, 0 replies; 3+ messages in thread
From: John Keeping @ 2018-02-14 17:04 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, Krzysztof Opasiak,
	John Keeping

If there are multiple functions associated with a configuration, then
the UAC2 interfaces may not start at zero.  Set the correct first
interface number in the association descriptor so that the audio
interfaces are enumerated correctly in this case.

Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
---
v2:
- Add Krzysztof's reviewed-by

 drivers/usb/gadget/function/f_uac2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c
index 11fe788b4308..d2dc1f00180b 100644
--- a/drivers/usb/gadget/function/f_uac2.c
+++ b/drivers/usb/gadget/function/f_uac2.c
@@ -524,6 +524,8 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
 		dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
 		return ret;
 	}
+	iad_desc.bFirstInterface = ret;
+
 	std_ac_if_desc.bInterfaceNumber = ret;
 	uac2->ac_intf = ret;
 	uac2->ac_alt = 0;
-- 
2.16.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [v2] usb: gadget: f_uac2: fix bFirstInterface in composite gadget
@ 2018-02-14 17:04   ` John Keeping
  0 siblings, 0 replies; 3+ messages in thread
From: John Keeping @ 2018-02-14 17:04 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, Krzysztof Opasiak,
	John Keeping

If there are multiple functions associated with a configuration, then
the UAC2 interfaces may not start at zero.  Set the correct first
interface number in the association descriptor so that the audio
interfaces are enumerated correctly in this case.

Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
---
v2:
- Add Krzysztof's reviewed-by

 drivers/usb/gadget/function/f_uac2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c
index 11fe788b4308..d2dc1f00180b 100644
--- a/drivers/usb/gadget/function/f_uac2.c
+++ b/drivers/usb/gadget/function/f_uac2.c
@@ -524,6 +524,8 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
 		dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
 		return ret;
 	}
+	iad_desc.bFirstInterface = ret;
+
 	std_ac_if_desc.bInterfaceNumber = ret;
 	uac2->ac_intf = ret;
 	uac2->ac_alt = 0;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-14 17:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-12 18:43 usb: gadget: f_uac2: fix bFirstInterface in composite gadget John Keeping
2018-02-14 17:04 ` [PATCH v2] " John Keeping
2018-02-14 17:04   ` [v2] " John Keeping

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.