From patchwork Mon May 16 06:10:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2FybCBZaW4o5q635byg5oiQKQ==?= X-Patchwork-Id: 12850277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CDC9C433EF for ; Mon, 16 May 2022 06:10:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240198AbiEPGKY (ORCPT ); Mon, 16 May 2022 02:10:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239999AbiEPGKW (ORCPT ); Mon, 16 May 2022 02:10:22 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2088.outbound.protection.outlook.com [40.107.215.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B502520F42; Sun, 15 May 2022 23:10:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BNGpDRGTTpvrAebS28lTRsFmZEm/qZH5PywSARSvU6y9/T1yGo/9704BKUZsCxdjuxSv6EWZipJS5XRlPNEEGgjvdc5BeWoqS00lMt3BJ33Wi0zdCxaz2buX4cq/rDqxE8SUP2vO2uQsBqJ99L8sEdIz85Bhsqcj8z4w8vmmkANwXsaB/IGZoObF+HsCE937YzMKymVC18mf/I88I6qbtX/Djim6wnWHcxo7AuJmJCHWSRGdS++LaC3A5ngFvSgeYzjjySeZZC0kSNC0IpRTISZVMB7Ysfu/kxTL/dHhH+2Ayt0vsGocNZAYzUvt875KHwMO0YZA6NM6raDH8uBbjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OCLQUv+Suu5llY1h/c8/kRyFEgkDEIGQYVszDzaNE1k=; b=QQBQX6K6cfFdt1IL0OdmZGN1ahjFJdGTrTcUANw5unzCcRJ+PBER2eSseTzEHYjO5AfW/f8Cj6lVWnxyJPIWfOhYKBy6eWzuFUzhPR3O7x7RbIapAGPE5yg6gUUlImA3ofzLzF3P2xoATlo4WEybE1HHu1ACp56rAWTzkfxMSs+0IwHwD64SOXxFjEVlRS0+EQNCZWIGTSHW+ZVN7iS5EcwTnRdS0ymmJJF5hJy0ds0VqYAsFPzQLCNFGZdPou6ONUWzsZIIZ78C7xxybt/R8V7nQaZQjHNh3vQAwLJkauM5J/mmW/5RSNQckIrGoeApK7Pd0GKxF57YEWJBMSl/Cw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=quectel.com; dmarc=pass action=none header.from=quectel.com; dkim=pass header.d=quectel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quectel.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OCLQUv+Suu5llY1h/c8/kRyFEgkDEIGQYVszDzaNE1k=; b=hNqcwV6v1AceY/uwZ/pHETiPYstqJjJgRV+UEf4OJBimZowbRFEvQ1hlZpssdiWFHNDJRF5AmPaS6sy9ZD0OK9cDxHwDe5I4OZOOLGblFzCdM16OlqyTD7jwW8YjOFcRmZC+dhuDe5DP+hrlpgHiQ5Uo1AY9yFPYNFimzf8lau4= Received: from TYZPR06MB4270.apcprd06.prod.outlook.com (2603:1096:400:88::6) by SEYPR06MB5109.apcprd06.prod.outlook.com (2603:1096:101:55::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.13; Mon, 16 May 2022 06:10:17 +0000 Received: from TYZPR06MB4270.apcprd06.prod.outlook.com ([fe80::c0e6:3fb5:f84f:244c]) by TYZPR06MB4270.apcprd06.prod.outlook.com ([fe80::c0e6:3fb5:f84f:244c%3]) with mapi id 15.20.5250.018; Mon, 16 May 2022 06:10:17 +0000 From: =?eucgb2312_cn?b?Q2FybCBZaW4o0vPVxbPJKQ==?= To: "johan@kernel.org" , "gregkh@linuxfoundation.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] USB: serial: option: add Quectel BG95 modem Thread-Topic: [PATCH] USB: serial: option: add Quectel BG95 modem Thread-Index: Adho65x4rxoQqYk3REyVbOIKLJYDnw== Date: Mon, 16 May 2022 06:10:17 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=quectel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 363858d5-73d9-4f5c-6f36-08da3702bfc2 x-ms-traffictypediagnostic: SEYPR06MB5109:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GeRpCXzjdFi00J8iDwG92jkplcH2/ORqX5o9Sn8ofTVYyYQnKp9B9rCm3aB8ayhywabBQi8qBSBw+zMUGMZgvwxfjpR0tV7J6AwU4RHSbwjd4KT97qf5aF42uMUPPqc2IMZMxh8cHOJp5rv0dYPUPN2mRxr/LNB8nM5mK1R5o+CYdOjWSC5XLUAqFICzFPHGDEe+B78kF3B4Dekrm7ZCNTil9xlU0emDigGq/xnYWvWw6JAcx5wj2IELt+yfFM6kHHNonPyOaVcrYmwRsuZ9smGf+9Xuov5TpHJMzHFHJftG1AAYaLfN7alH0key/ML5msdJB+Va3V9Gj9PEbewIzp9eC7s6b8iAWIZw0knpyR9ggYPyDr2kDtiIwSDA8R8qXSevC+Ne0BU4BSOwX3X1GfCG0nVsOttF/8q1jvA7HnBxmRMf3ANb1Ax8tfepZMVm/DCKrNZFYdyYP8Yn1NLBpuKAZC2IUKQeNkThhisrTDirHw15YdSs/VXyWSL0aqPqflFWyEot/l6UE7jk+Hdu7hCxZC206vUfJ1OSVgwCSVAkSlSmetaVnyrwPTF9pgVLSBEl7tb5WNcWn4U5MJ33kOQ7ZQwbyvvYH/fh97472uOObd6ZKXTXeIYLei1OdnWqtY4VL4ZYl9mnsWS91ZNHCzMiVuHp+fT3KCXvGIXv6IIBPXyrlgUzPdxYbSbBx94F0cal0ZCpy7h7VHWOy6zINw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR06MB4270.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(66556008)(316002)(66446008)(5660300002)(8936002)(110136005)(71200400001)(66476007)(122000001)(86362001)(66946007)(38100700002)(26005)(55016003)(33656002)(7696005)(6506007)(508600001)(186003)(76116006)(52536014)(64756008)(9686003)(38070700005)(2906002)(8676002)(85182001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?eucgb2312_cn?b?T0xPWEwyMTQzUlQzTFdzcVli?= =?eucgb2312_cn?b?YStRMG9uMGdoK1lMemJSWmlMUFgzaDlJMHMyUHBaemhFMjRqMXJPUzlwalpHMjYx?= =?eucgb2312_cn?b?ZTlRZURINkRVdHRhYVc3QTlHSWpjM3hoUnZZbmVLdWg4UlRIejh3UHUyYTJqdUo2?= =?eucgb2312_cn?b?QmViQUthN3ZLbG5pemg2b3R6QytsbXV5M0drSkE0NE5kOEdDQmdaQUVtQmVaYzJs?= =?eucgb2312_cn?b?QmYvRjNyVjhJRUVkSzU5OVMydDc3WHUxRWtN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FlTUJUblpOZWU3c0tEb0tsdEFZ?= =?eucgb2312_cn?b?VllKN01XZHZBbGJnbEsvMUpjODVDMkJVTDhYMlFiRmJLTFNOTjUrY3EwTnpGVFp4?= =?eucgb2312_cn?b?MHAzOFZhdnB3TGJtOVpIMktWVEhiQU9jeXlkUmtmYk5UaVA0YXc1NDhWYkNKd2l2?= =?eucgb2312_cn?b?UmxBM2kwRE1lMmVTclJkZTFhZzRqTkJQeFcvRnhhRnZBT1RPN0FZLzVtdHhIRm0y?= =?eucgb2312_cn?b?Vk84UmllenIzOFRXdUxFOTdubm16REplbnl6alA4SU9KbzB1clZJaXFiK3F3S3lS?= =?eucgb2312_cn?b?Mk9OdVB6N0VyMkt1bVNEQUMyeE96bVkycnlLbUo4MXFQNkFXaUs0SDdycCsyYllw?= =?eucgb2312_cn?b?aW4xSmNSU1JObGFsM3ZGa0l4TEpaL3I2bC9DWXlhN093dzRIRnB2cHpscHZBRTlm?= =?eucgb2312_cn?b?QVZIUT09?= MIME-Version: 1.0 X-OriginatorOrg: quectel.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB4270.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 363858d5-73d9-4f5c-6f36-08da3702bfc2 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 May 2022 06:10:17.2687 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7730d043-e129-480c-b1ba-e5b6a9f476aa X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: mEfmHPrbYFjL0B30IC8fjBKJIRTDNju6yjYgHcVJ74y+zezzlFoQRqgENWyQ80yU+y6wVCukRLwQKwKDNCKJ7g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5109 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The BG95 modem has 2 USB configurations that are configurable via the AT command AT+QCFGEXT="usbnet",["ecm"|"modem"] which make the modem enumerate with the following interfaces, respectively: "modem": Diag + GNSS + Modem + Modem "ecm" : DIAG + GNSS + Modem + ECM A detailed description of the USB configuration for each mode follows: +QCFGEXT: "usbnet","modem" ------------------------- T: Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 3 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=0700 Rev= 0.00 S: Manufacturer=Quectel, Incorporated S: Product=Quectel LPWA Module S: SerialNumber=884328a2 C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=83(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=fe Prot=ff Driver=option E: Ad=85(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +QCFGEXT: "usbnet","ecm" ----------------------- T: Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 4 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=0700 Rev= 0.00 S: Manufacturer=Quectel, Incorporated S: Product=Quectel LPWA Module S: SerialNumber=884328a2 C:* #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA A: FirstIf#= 3 IfCount= 2 Cls=02(comm.) Sub=00 Prot=00 I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=83(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether E: Ad=85(I) Atr=03(Int.) MxPS= 64 Ivl=2ms I: If#= 4 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether I:* If#= 4 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms Signed-off-by: Carl Yin --- drivers/usb/serial/option.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 152ad8826..f91b2a67d 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -256,6 +256,7 @@ static void option_instat_callback(struct urb *urb); #define QUECTEL_PRODUCT_RM500Q 0x0800 #define QUECTEL_PRODUCT_EC200S_CN 0x6002 #define QUECTEL_PRODUCT_EC200T 0x6026 +#define QUECTEL_PRODUCT_BG95 0x0700 #define CMOTECH_VENDOR_ID 0x16d8 #define CMOTECH_PRODUCT_6001 0x6001 @@ -1143,6 +1144,10 @@ static const struct usb_device_id option_ids[] = { .driver_info = ZLP }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG95, 0xff, 0xff, 0xff), + .driver_info = ZLP }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG95, 0xff, 0xfe, 0xff), + .driver_info = ZLP }, { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },