Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1714719rdb; Sun, 8 Oct 2023 23:34:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFePJPvLPsDvpipXVJYLYzOh1FTKYlnvjnFpkhNd1OvSv3LTn66cMR5HV5R9c8Fl1dVI1d1 X-Received: by 2002:a05:6a00:2189:b0:693:3851:bd3e with SMTP id h9-20020a056a00218900b006933851bd3emr12216254pfi.3.1696833243161; Sun, 08 Oct 2023 23:34:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696833243; cv=none; d=google.com; s=arc-20160816; b=NdwqJFrZh4q9BRfxr4Ynk48L6Oyyl/y811IMoGbWc2/ZlbcbKxsxSnWkgWmB721IvM uRO5s+VdSjzNZKplg72SH5WHixQVsLxdvqsMvr9hBzQVXzf/CvEszxJscD4EJYP5TjU8 uPdyj/HcBONkQw2NpGc/gK5Fh1sq4ALXmSfrvJSEBslgP5A4omy6NUZgP+Wm+H4oOiI/ Y8NfiKiPHaJN4YCvhbi4/bhaBqHlzgL4SO9ypdwLqelfiTv4EgCApvILvfLyzIMW99b3 yVS8upw0pG0qyKzp+zEQB8troLGHI2ojR4HtGJ/8/Rv3yCONc9PgBEMiMwy6DldYivhZ UTYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=ftwbKhET8+/msWvi5MMRTpCz/J2p8IDyIe8SFfls+iA=; fh=f9qfx3lUHU0Tv4livTjoBT6B9P8g5Cwj9oHFZ/NiEvU=; b=tZ2dfF/awrqs7WSy2Vo95e9mSt0feY0NBC9lqsVlBT6V8XJBFf8AmQsHIc6Lu/iFKP 02oEqMQiaFvvKQdtenes0fQl2qp+CGYKxYYkEKLZmOv49Vja34Z0K5A20KBmfIC8sLDO evdWNXg7p3k9zP27F48Q1RQrQSv0S9xnyLPVSR2tvyCdxaef4PqwQGYXaU0fh8katPHW DZjvDQd0zTfcAibYMMl/LXu81pkP/Kn2NWXz5S/VJTN2W/CUyLrLtir6y34rtZhKz15S oWmITYHYAyOsdO9vMXrg2iuo2IZBsc/Uo2Y/QgaRhyvADttoz8Z+E2kUcB1ROxcQ1Jbe Fazw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RhzwvGgW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id dw8-20020a056a00368800b0069f456b74e9si4406019pfb.292.2023.10.08.23.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 23:34:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RhzwvGgW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5EAAC8030B54; Sun, 8 Oct 2023 23:34:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345258AbjJIGd5 (ORCPT + 99 others); Mon, 9 Oct 2023 02:33:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbjJIGd4 (ORCPT ); Mon, 9 Oct 2023 02:33:56 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 265A6B9; Sun, 8 Oct 2023 23:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696833234; x=1728369234; h=from:to:cc:subject:date:message-id; bh=yGGnTiOwfcMWNPVc2G/Q813ixhjZkvPBHMtZp7WfHWA=; b=RhzwvGgW2Tay0i90VybRKZkZns+OkvFNviuWP8QAvEoI2Dm5YADqBnL8 Xzn4lmefIuDYnS11qsVcOtnUIs/FlNvK0FVYdmnsFguae0664Od7KjHK6 KnSpfiTj7BvEQB11ytKycUE6UPGlZy14RNRWo4QoFwAgsJ7e2LGStV3uA usQvzYrJh2mK9SLoCEMu5Ubx+Fgko54HdGoa2V3evU1HsZOcjq5pUV88v wTKKe5FGxnJCEBR9T9Wasbv/1BJb1MKvOzpwwQLA3yWdDkoN0yvOA4fie w6FwIV34g7coFaIl1w2k+naBsB46w8YvjFda+o6ji+1GKDXTKY7I+OJk0 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10857"; a="448273533" X-IronPort-AV: E=Sophos;i="6.03,209,1694761200"; d="scan'208";a="448273533" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2023 23:33:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10857"; a="896653868" X-IronPort-AV: E=Sophos;i="6.03,209,1694761200"; d="scan'208";a="896653868" Received: from shsensorbuild2.sh.intel.com ([10.239.134.197]) by fmsmga001.fm.intel.com with ESMTP; 08 Oct 2023 23:32:08 -0700 From: Wentong Wu To: gregkh@linuxfoundation.org, oneukum@suse.com, wsa@kernel.org, andi.shyti@linux.intel.com, broonie@kernel.org Cc: bartosz.golaszewski@linaro.org, linus.walleij@linaro.org, hdegoede@redhat.com, linux-usb@vger.kernel.org, linux-i2c@vger.kernel.org, linux-spi@vger.kernel.org, sakari.ailus@linux.intel.com, zhifeng.wang@intel.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Wentong Wu Subject: [PATCH v20 0/4] Add Intel LJCA device driver Date: Mon, 9 Oct 2023 14:33:21 +0800 Message-Id: <1696833205-16716-1-git-send-email-wentong.wu@intel.com> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 08 Oct 2023 23:34:02 -0700 (PDT) Add driver for Intel La Jolla Cove Adapter (LJCA) device. This IO-expander adds additional functions to the host system with host USB interface, such as GPIO, I2C and SPI. This patch set adds four drivers to support this device: a USB device driver, a GPIO chip driver, a I2C controller driver and a SPI controller driver. --- v20: - add __counted_by attributes for all of [] arrays - use proper kernel doc for ljca_adapter structure - re-structure ljca_recv function to make it more clear - remove all of scoped_guard - check return value of usb_autopm_get_interface() - re-structure ljca_enumerate_clients() to handle error correctly - add comment for 'uid = "0";' in ljca_match_device_ids() - change the parameters' type of ljca_send() to u8 v17 - v19: - rebase patch set on top of Linus' master branch (57d88e8a5974644039fbc47806bac7bb12025636) - change valid_pins type to __le32 and access valid_pins with get_unaligned_le32 - remove COMPILE_TEST for USB_LJCA Kconfig v16: - drop all void * and use real types in the exported apis and internal ljca_send() - remove #ifdef in usb-ljca.c file - add documentation in ljca.h for the public structures - add error message in ljca_handle_cmd_ack() if error happens and remove blank line - use the functionality in cleanup.h for spinlock to make function much simpler - change the type of ex_buf in struct ljca_adapter to u8 * v14 - v15: - enhance disconnect() of usb-ljca driver - change memchr to strchr in ljca_match_device_ids() of usb-ljca driver - fix build error: implicit declaration of function 'acpi_dev_clear_dependencies' v13: - make ljca-usb more robust with the help of Hans de Goede - call acpi_dev_clear_dependencies() to mark _DEP ACPI dependencies on the I2C controller as satisfied - avoid err printing because of calling usb_kill_urb when attempts to resubmit the rx urb v10 - v12: - 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 - remove ljca_i2c_format_slave_addr - remove memset before write write w_packet for i2c driver - 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 | 343 ++++++++++++++++ drivers/spi/Kconfig | 11 + drivers/spi/Makefile | 1 + drivers/spi/spi-ljca.c | 297 ++++++++++++++ drivers/usb/misc/Kconfig | 13 + drivers/usb/misc/Makefile | 1 + drivers/usb/misc/usb-ljca.c | 902 ++++++++++++++++++++++++++++++++++++++++++ include/linux/usb/ljca.h | 145 +++++++ 12 files changed, 1870 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 -- 2.7.4