Message ID | 20221114073736.672194-1-clabbe@baylibre.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2016239wru; Sun, 13 Nov 2022 23:40:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf6sWUG6ouzRiQ3aMWqWLk+wp1kZhFHFuq+RIWES+a14+eU5F0tOkYwbM5IfCeIP16NaW5c6 X-Received: by 2002:a17:906:c048:b0:7ae:d116:fabb with SMTP id bm8-20020a170906c04800b007aed116fabbmr8226651ejb.317.1668411605796; Sun, 13 Nov 2022 23:40:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668411605; cv=none; d=google.com; s=arc-20160816; b=xlslsC3adHkaMyOatFJUaJ7bjBdWKJosUIe1FvPyBktqLbKxLb7iSDefaUEnrgQLtf QjNIaG6B1BPSTOgROVJrpSpt1Ubau4vuOP4G+5A7VpSJXxBO8AJy0tLFNcQ+/SC7DqF1 56mVf18mmbMrIFj03ZWxHw7Z+ysGQVTj45symGyh1qW0wRYK3EI18j483qt8vmoAAs/g pTGU/i9Vta9x0occq52D4tV0hFtKgwvqRNal54yOQ4GeetOM1V6Yej0YHfgUE5yn50sj aQyZnDrel8v/aotZmQWzylwLU8ETj++WZYtNDa+9paMhSbZJUats1Kp6vHW/lHPHD8/c 1wRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+v1xeFroLEZ2pPLWd3Trc4JUUcj9sZhHuuFgi+e21Mw=; b=CQsUQHKAhWObqUaehL/3sUBuNhxw8mDUPd+jLIczBIOs2xxSmO+1Iv7HcXX5lHzXE9 /AOCKtFQ6o8tqixGS+qzWCG0SFb2/C/RE1y9cpd4fbcOGa4fAuqxoOOjmuJDfx0TNCb8 psjdz6opNrf5PzlUYO6etucVBF7D2a5Idn2nxHVtUjJGFriF2WM60c+tEf8BYGoUGgvO 3xpWP9jHmpUrGxMUl2UhZEwYtMZPOxWUrt8A+svzPSZDHp5amaLym0t4Jxd1MvapXYOb HclAtOVOTX3UoWkGWnXaEmvO85iFSIZlJEmJ53+G1h0lOkAC7bEMjSG9CHdBIGx4nwzU E0gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=QCYJSmxG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m13-20020a056402510d00b0046768efb587si6633583edd.69.2022.11.13.23.39.41; Sun, 13 Nov 2022 23:40:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=QCYJSmxG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235798AbiKNHhx (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Mon, 14 Nov 2022 02:37:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235561AbiKNHhv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 14 Nov 2022 02:37:51 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD8A4A45F for <linux-kernel@vger.kernel.org>; Sun, 13 Nov 2022 23:37:49 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id v1so16470851wrt.11 for <linux-kernel@vger.kernel.org>; Sun, 13 Nov 2022 23:37:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+v1xeFroLEZ2pPLWd3Trc4JUUcj9sZhHuuFgi+e21Mw=; b=QCYJSmxG90jy4NieQkayH0lG0lScaEdWQyhiRCp8N7qfAMSGsgfQ8iBhqOZ6SBmNfi JU78vKU+n8si93XORHoJlj+IyS35XgorRvB9drP9/ljOAHVajtonHoOx46PTsdMWWw33 u2UKx60i/0aIxiFFMhJvNmoVlCYYXZsYuM9f6gda6+ciPJt+HYMz3ugKdoAimwOAU4wZ elYJNaqU0EPk/jIb4FxDRNX/MiO7SzynHuwuKawRWmHxjUJMfc1GtH2YkATz0O0EzaP6 RDZl0oTFY3l/VEsL07ZaQ4Ugwqh6d48eFkJmTHCh0OoIxpwwUnUJHvusF1I7zlY/cEo6 Qc6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+v1xeFroLEZ2pPLWd3Trc4JUUcj9sZhHuuFgi+e21Mw=; b=nqg5hBfNEVg2HYDf/JJ2yMVPpaPI4sfzamAeyu9nQ7UDb6QvCvsuBr3OBoHsx83mrI 9XWKEWiLc9ChjU2X/Zv9B0t2CS4I+nXDJ2JkCUo/xKTYsT90n9iJc3uE77wNCl2KnggD qFR4oraml7lF7j02Sin3euNWlXFhTjhl+Pc+BjJAsUxRZC944HuHa3VL51oYK6GqyyA3 rUSp0xl8XZ38WJ2UT6kuS4xl2Rl+ZnuciZk3ZWgoFHNeJe2epgwBCLh13gefUzpqirf9 5qT1j1FnLk93dMm2Ch9v3lgT1HXYxQjtJwrlqSvDYubjzT6A817oX+7VDflJ46feQJtP y8eQ== X-Gm-Message-State: ANoB5pkYaKF1r/V7qAq1/uLFvepp2CeJFszFlo/YmprDCjJsram9t8nQ NstpZT8+O6mviEpC5D56lQ8z/A== X-Received: by 2002:adf:9bcf:0:b0:22e:5d66:dc5d with SMTP id e15-20020adf9bcf000000b0022e5d66dc5dmr6633491wrc.175.1668411468143; Sun, 13 Nov 2022 23:37:48 -0800 (PST) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id h11-20020a05600c314b00b003b4fe03c881sm18467775wmo.48.2022.11.13.23.37.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Nov 2022 23:37:47 -0800 (PST) From: Corentin Labbe <clabbe@baylibre.com> To: gregkh@linuxfoundation.org, johan@kernel.org Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Corentin Labbe <clabbe@baylibre.com> Subject: [PATCH v3 0/2] usb: serial: add support for CH348 Date: Mon, 14 Nov 2022 07:37:34 +0000 Message-Id: <20221114073736.672194-1-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749456367658585930?= X-GMAIL-MSGID: =?utf-8?q?1749456367658585930?= |
Series |
usb: serial: add support for CH348
|
|
Message
Corentin LABBE
Nov. 14, 2022, 7:37 a.m. UTC
Hello The CH348 is an octo serial to USB adapter. The following patch adds a driver for supporting it. Since there is no public datasheet, unfortunatly it remains some magic values. It was tested with a large range of baud from 1200 to 1500000 and used with success in one of our kernel CI testlab. Regards Changes since v1: - use a data structure for encoding/decoding messages. - check if needed endpoints exists - fix URB leak in ch348_allocate_status_read error case - test for maximum baud rate as stated by datasheet Changes since v2: - specify ch348_rxbuf data length - Use correct speed_t dwDTERate instead of __le32 - test for maximum baud rate supported according to datasheet - Use a define for CH348_TX_HDRSIZE Corentin Labbe (2): usb: serial: add support for CH348 usb: serial: add myself as maintainer of CH348 MAINTAINERS | 5 + drivers/usb/serial/Kconfig | 9 + drivers/usb/serial/Makefile | 1 + drivers/usb/serial/ch348.c | 739 ++++++++++++++++++++++++++++++++++++ 4 files changed, 754 insertions(+) create mode 100644 drivers/usb/serial/ch348.c