From patchwork Mon Dec 24 02:36:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liangshengjun X-Patchwork-Id: 10742021 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 80EBC13A4 for ; Mon, 24 Dec 2018 02:36:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CBC728829 for ; Mon, 24 Dec 2018 02:36:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E08C28A3E; Mon, 24 Dec 2018 02:36:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CB5F28829 for ; Mon, 24 Dec 2018 02:36:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726651AbeLXCgi convert rfc822-to-8bit (ORCPT ); Sun, 23 Dec 2018 21:36:38 -0500 Received: from szxga03-in.huawei.com ([45.249.212.189]:6522 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726361AbeLXCgi (ORCPT ); Sun, 23 Dec 2018 21:36:38 -0500 Received: from DGGEMM405-HUB.china.huawei.com (unknown [172.30.72.53]) by Forcepoint Email with ESMTP id 18168DC5299C0; Mon, 24 Dec 2018 10:36:35 +0800 (CST) Received: from DGGEMM510-MBS.china.huawei.com ([169.254.11.150]) by DGGEMM405-HUB.china.huawei.com ([10.3.20.213]) with mapi id 14.03.0415.000; Mon, 24 Dec 2018 10:36:29 +0800 From: liangshengjun To: Felipe Balbi , Greg Kroah-Hartman , Paul Elder , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Jiangheng , Caizhiyong Subject: [PATCH] usb: gadget: function: sync f_uac1 ac header baInterfaceNr Thread-Topic: [PATCH] usb: gadget: function: sync f_uac1 ac header baInterfaceNr Thread-Index: AdSXkyrMjwpwaOV2RBuDWdJqlVCCfQDnjHGQ Date: Mon, 24 Dec 2018 02:36:28 +0000 Message-ID: <84923CA334DF85428B9ADCEC0F3CE864055B6981@dggemm510-mbs.china.huawei.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.67.223.71] MIME-Version: 1.0 X-CFilter-Loop: Reflected Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/usb/gadget/function/f_uac1.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.4 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;