Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1031804iog; Wed, 15 Jun 2022 18:57:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uNH0olst34OS6RPYm2x4ci1E+2qWvUBaC1iZe17idtAMFE9NQmv22w8fZ/khIJ9397Hejv X-Received: by 2002:a05:6a00:1901:b0:518:916e:4a85 with SMTP id y1-20020a056a00190100b00518916e4a85mr2260157pfi.65.1655344660532; Wed, 15 Jun 2022 18:57:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655344660; cv=none; d=google.com; s=arc-20160816; b=E/WV9Mm0wSn8mDzHpKOvIL9V3uByUon97WqCU6fQCpYTovzhGEwSuoenHk2FLPkKG1 976GF8rvEr30VMlJUReHhReiFmf5JBQZtTYVFoYj1FDWqRLfHDsWJiSnC+8FPIaD/5Eg 7WkCYw/jgB6x7KgDbnUUSWJw1mbIE+ZzdU89EwJEUdf9nh53xA0W29xaMxLUZ9lwDznz Ld92Zi0/b++J2QMhYWJJlegdEryvHpQ8H/5leW1JShzvLpTovWQJmgUfcLkaGgIJzY0L 6JLlpC9nzEMooGFJvfm3Ht8zovCUzG2RVi1LgEP1OCG4I4wFtEZrV400zxV3djoctgOh KZVA== 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:to:from; bh=GH/Bc97gJX3jBT9JqX8lt9pQXe4zs0FFu1V8gBcjA70=; b=d0UzFNlljfifRewTHujT94fPL86S0JUU0EX+m7LUihi/Mi97LgjyFYJJ0sO6SeaIi2 AmBuCkKvQPRw7uUqj8Yy3/DUY4Uu8r6gnWkq91j+rnvdEAC/FAv8rOf5G/J3QOY2usBm +CBRzIFAWmxsghkwXB0+EwaqFJnUMIT5Itllw5zdnOhhKooD8s49QstUNYJ2kAgHHRBM U4BRrNPCyjzLsqdzXm6RSFLt2o6t6siP9tJPqVVRZwWe7scFlgBpB87aiveSMzOBMsCP Ik9vySG3hBuDhNiO+yl8BB/jBNM/HecoXS7DULIkcjY++cq6QtKoYi/X0v2FdKoN0Ijp 10jA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d7-20020a623607000000b0050e136de8absi816606pfa.283.2022.06.15.18.57.27; Wed, 15 Jun 2022 18:57:40 -0700 (PDT) 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; 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 S1357004AbiFPBh7 (ORCPT + 99 others); Wed, 15 Jun 2022 21:37:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350809AbiFPBh5 (ORCPT ); Wed, 15 Jun 2022 21:37:57 -0400 Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5992E4EF75; Wed, 15 Jun 2022 18:37:55 -0700 (PDT) Received: (Authenticated sender: frank@zago.net) by mail.gandi.net (Postfix) with ESMTPSA id 5A429200004; Thu, 16 Jun 2022 01:37:51 +0000 (UTC) From: frank zago To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Bartosz Golaszewski , Wolfram Sang , Johan Hovold , linux-usb@vger.kernel.org, Lee Jones , Linus Walleij , linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org, frank zago Subject: [PATCH v6 0/4] add driver for the WCH CH341 in I2C/GPIO mode Date: Wed, 15 Jun 2022 20:37:43 -0500 Message-Id: <20220616013747.126051-1-frank@zago.net> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org The CH341 is a multifunction chip, presenting 3 different USB PID. One of these functions is for I2C/SPI/GPIO. This new set of drivers will manage I2C and GPIO. Changes from v5: Addressed reviewers' comments. Better handling of 0-bytes i2c commands Use of better USB API. Changes from v4: I should have addressed all the comments: rework of the GPIO interrupt handling code to be more modern, changes in Kconfig wording, some code cleanup. Driver was tested again with up to 4 of these devices. No error seen. Changes from v3: - really converted to an MFD driver. Driver is now split into 3 modules (MFD+I2C+GPIO). - minor code cleanups Changes from v2: - bug fixes - more robust USB enumeration - Changed to an MFD driver as suggested During testing I found that i2c handles hot removal, but not gpio. The gpio subsystem will complain with 'REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED', but it's a gpiolib issue. Changes from v1: - Removed double Signed-off-by - Move Kconfig into the same directory as the driver frank zago (4): mfd: ch341: add core driver for the WCH CH341 in I2C/SPI/GPIO mode gpio: ch341: add GPIO MFD cell driver for the CH341 i2c: ch341: add I2C MFD cell driver for the CH341 docs: misc: add documentation for ch341 driver Documentation/misc-devices/ch341.rst | 109 ++++++++ Documentation/misc-devices/index.rst | 1 + MAINTAINERS | 9 + drivers/gpio/Kconfig | 10 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-ch341.c | 385 +++++++++++++++++++++++++++ drivers/i2c/busses/Kconfig | 10 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-ch341.c | 377 ++++++++++++++++++++++++++ drivers/mfd/Kconfig | 10 + drivers/mfd/Makefile | 1 + drivers/mfd/ch341-core.c | 90 +++++++ include/linux/mfd/ch341.h | 26 ++ 13 files changed, 1030 insertions(+) create mode 100644 Documentation/misc-devices/ch341.rst create mode 100644 drivers/gpio/gpio-ch341.c create mode 100644 drivers/i2c/busses/i2c-ch341.c create mode 100644 drivers/mfd/ch341-core.c create mode 100644 include/linux/mfd/ch341.h -- 2.32.0