From patchwork Tue Aug 29 04:54:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wu, Wentong" X-Patchwork-Id: 719370 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 5C48EC71153 for ; Tue, 29 Aug 2023 04:55:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234833AbjH2Eyu (ORCPT ); Tue, 29 Aug 2023 00:54:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234042AbjH2EyU (ORCPT ); Tue, 29 Aug 2023 00:54:20 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6570E122; Mon, 28 Aug 2023 21:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693284856; x=1724820856; h=from:to:cc:subject:date:message-id; bh=RN/GmDnk2IrRwuc8FnC9NabrjftBizF/m1OAQAhRvO4=; b=PZ4uNKvK26Ckp/mfi/GpUmcKLyIh6lRNPIl69k2g6XzVSj8Fa9IEpiug pO2Chkyx2npRnjC/dKhkZGo+YA5wXu54uqQQI7X0Nvoe8lBaBjCym1MX0 rM+HE3Wm+mdENH1FrJx9P3p3D4c+Ij8ejIq8BUA6rw0ckU9jm8nV8rOTU HNOLgV9lDLItif6xaTDnF7IWArDGem3mqKB9Nb1P+QeQ+AoGc1WsAgP0i CMrCtrz/+wZdhyd2oXnblHWFvNYwer0lEl3aZKA1JrKZpl+tR3WYARP0j ovuoNoFBzYU8ZVyfuwcrjj5MUiXMxVa0TNy/Fac1YVghooa8SHO5L3reN Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10816"; a="355600308" X-IronPort-AV: E=Sophos;i="6.02,208,1688454000"; d="scan'208";a="355600308" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 21:54:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10816"; a="773531067" X-IronPort-AV: E=Sophos;i="6.02,208,1688454000"; d="scan'208";a="773531067" Received: from shsensorbuild2.sh.intel.com ([10.239.134.197]) by orsmga001.jf.intel.com with ESMTP; 28 Aug 2023 21:54:10 -0700 From: Wentong Wu To: gregkh@linuxfoundation.org, arnd@arndb.de, mka@chromium.org, oneukum@suse.com, lee@kernel.org, wsa@kernel.org, kfting@nuvoton.com, broonie@kernel.org, linus.walleij@linaro.org, maz@kernel.org, brgl@bgdev.pl, linux-usb@vger.kernel.org, linux-i2c@vger.kernel.org, linux-spi@vger.kernel.org, linux-gpio@vger.kernel.org, andriy.shevchenko@linux.intel.com, heikki.krogerus@linux.intel.com, andi.shyti@linux.intel.com, sakari.ailus@linux.intel.com, bartosz.golaszewski@linaro.org, srinivas.pandruvada@intel.com Cc: zhifeng.wang@intel.com, Wentong Wu Subject: [PATCH v11 0/4] Add Intel LJCA device driver Date: Tue, 29 Aug 2023 12:54:04 +0800 Message-Id: <1693284848-29269-1-git-send-email-wentong.wu@intel.com> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Add driver for Intel La Jolla Cove Adapter (LJCA) device. This is a USB-GPIO, USB-I2C and USB-SPI device. We add 4 drivers to support this device: a USB driver, a GPIO chip driver, a I2C controller driver and a SPI controller driver. --- v11: - switch dev_err to dev_dbg for i2c-ljca driver - remove message length check because of defined quirk structure - remove I2C_FUNC_SMBUS_EMUL support v10: - remove ljca_i2c_format_slave_addr - remove memset before write write w_packet - make ljca_i2c_stop void and print err message in case failure - use dev_err_probe in ljca_i2c_probe function v9: - overhaul usb-ljca driver to make it more structured and easy understand - fix memory leak issue for usb-ljca driver - add spinlock to protect tx_buf and ex_buf - change exported APIs for usb-ljca driver - unify prefix for structures and functions for i2c-ljca driver - unify prefix for structures and functions for spi-ljca driver - unify prefix for structures and functions for gpio-ljca driver - update gpio-ljca, i2c-ljca and spi-ljca drivers according to usb-ljca's changes Wentong Wu (4): usb: Add support for Intel LJCA device i2c: Add support for Intel LJCA USB I2C driver spi: Add support for Intel LJCA USB SPI driver gpio: update Intel LJCA USB GPIO driver drivers/gpio/Kconfig | 4 +- drivers/gpio/gpio-ljca.c | 246 +++++++------ drivers/i2c/busses/Kconfig | 11 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-ljca.c | 326 +++++++++++++++++ drivers/spi/Kconfig | 11 + drivers/spi/Makefile | 1 + drivers/spi/spi-ljca.c | 297 +++++++++++++++ drivers/usb/misc/Kconfig | 14 + drivers/usb/misc/Makefile | 1 + drivers/usb/misc/usb-ljca.c | 817 ++++++++++++++++++++++++++++++++++++++++++ include/linux/usb/ljca.h | 113 ++++++ 12 files changed, 1737 insertions(+), 105 deletions(-) create mode 100644 drivers/i2c/busses/i2c-ljca.c create mode 100644 drivers/spi/spi-ljca.c create mode 100644 drivers/usb/misc/usb-ljca.c create mode 100644 include/linux/usb/ljca.h