From: liangshengjun <liangshengjun@hisilicon.com>
To: Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Paul Elder <paul.elder@ideasonboard.com>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Jiangheng <jiangheng@hisilicon.com>,
Caizhiyong <caizhiyong@hisilicon.com>
Subject: [PATCH] usb: gadget: function: sync f_uac1 ac header baInterfaceNr
Date: Mon, 24 Dec 2018 02:36:28 +0000 [thread overview]
Message-ID: <84923CA334DF85428B9ADCEC0F3CE864055B6981@dggemm510-mbs.china.huawei.com> (raw)
f_uac1 audio control header descriptor default set baInterfaceNr[]={1,2}, but usb gadget make a configuration descriptor with more interfaces combination, it can not confirm f_uac1 function linked first. So always keep baInterfaceNr[]={1,2} is correct, and it is necessary to sync baInterfaceNr[] with usb_interface_id() value.
Signed-off-by: Liang Shengjun <liangshengjun@hisilicon.com>
---
drivers/usb/gadget/function/f_uac1.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c
index 28c1a78..d9aeb5c 100644
--- a/drivers/usb/gadget/function/f_uac1.c
+++ b/drivers/usb/gadget/function/f_uac1.c
@@ -581,6 +581,7 @@ static int f_audio_bind(struct usb_configuration *c, struct usb_function *f)
goto fail;
as_out_interface_alt_0_desc.bInterfaceNumber = status;
as_out_interface_alt_1_desc.bInterfaceNumber = status;
+ ac_header_desc.baInterfaceNr[0] = status;
uac1->as_out_intf = status;
uac1->as_out_alt = 0;
@@ -589,6 +590,7 @@ static int f_audio_bind(struct usb_configuration *c, struct usb_function *f)
goto fail;
as_in_interface_alt_0_desc.bInterfaceNumber = status;
as_in_interface_alt_1_desc.bInterfaceNumber = status;
+ ac_header_desc.baInterfaceNr[1] = status;
uac1->as_in_intf = status;
uac1->as_in_alt = 0;
--
2.7.4
next reply other threads:[~2018-12-24 2:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-24 2:36 liangshengjun [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-12-19 12:08 [PATCH] usb: gadget: function: sync f_uac1 ac header baInterfaceNr liangshengjun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=84923CA334DF85428B9ADCEC0F3CE864055B6981@dggemm510-mbs.china.huawei.com \
--to=liangshengjun@hisilicon.com \
--cc=balbi@kernel.org \
--cc=caizhiyong@hisilicon.com \
--cc=gregkh@linuxfoundation.org \
--cc=jiangheng@hisilicon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=paul.elder@ideasonboard.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).