From patchwork Wed Dec 19 12:08:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liangshengjun X-Patchwork-Id: 10737145 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 40E1C924 for ; Wed, 19 Dec 2018 12:08:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0682328708 for ; Wed, 19 Dec 2018 12:08:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED2212869D; Wed, 19 Dec 2018 12:08:37 +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 6869E284B3 for ; Wed, 19 Dec 2018 12:08:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728595AbeLSMIg convert rfc822-to-8bit (ORCPT ); Wed, 19 Dec 2018 07:08:36 -0500 Received: from szxga01-in.huawei.com ([45.249.212.187]:6919 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728559AbeLSMIf (ORCPT ); Wed, 19 Dec 2018 07:08:35 -0500 Received: from DGGEMM403-HUB.china.huawei.com (unknown [172.30.72.54]) by Forcepoint Email with ESMTP id 5A8909C4F5CA4; Wed, 19 Dec 2018 20:08:32 +0800 (CST) Received: from DGGEMM422-HUB.china.huawei.com (10.1.198.39) by DGGEMM403-HUB.china.huawei.com (10.3.20.211) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 19 Dec 2018 20:08:33 +0800 Received: from DGGEMM510-MBS.china.huawei.com ([169.254.11.150]) by dggemm422-hub.china.huawei.com ([10.1.198.39]) with mapi id 14.03.0415.000; Wed, 19 Dec 2018 20:08:32 +0800 From: liangshengjun To: "balbi@kernel.org" CC: Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" 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: AdSXkyrMjwpwaOV2RBuDWdJqlVCCfQ== Date: Wed, 19 Dec 2018 12:08:32 +0000 Message-ID: <84923CA334DF85428B9ADCEC0F3CE864055B49CC@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(+) 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;