Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7496975rwl; Tue, 10 Jan 2023 01:20:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXt7W7BAzyOX2Gv+NOOt9ExYSGOKYTFS+nvv7SDpcgIV8LrCQ/kY6meFxPXkBRi/L42aVF9S X-Received: by 2002:a05:6a20:9c93:b0:b5:a240:fec5 with SMTP id mj19-20020a056a209c9300b000b5a240fec5mr11457752pzb.56.1673342433073; Tue, 10 Jan 2023 01:20:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673342433; cv=none; d=google.com; s=arc-20160816; b=KqLn5MogHaiWz9wKXyphU8EYC1BtBYFSn8n1j50QynHYfCYCuljNyu/ER+2VvJ8pzD oHHglx31d0wcQuQt2s6kp6Fo9e5TCO2lCns1aiTC2W2+m+PUP/0qsFlPwrJe2gC6mdOR CE8FrhUQVjqq9wdxuFLYCEW44kInVmj7hn8oluTl6mrEn8aC32YLLxEZZcuTKOFAAV1w 8EFHuCanQgIO3noIhJk6gu1OXDjYKsaUxlq6OFwKTqEhBwEiYKmKcaOf4WYLoQxasj6K 5ilTGgTNbMhCY4GnqUMPN0fgSnWGvA0dJEliCkRrkH+R2SHqUgtKgB0qe3U1ELsdd9ZW 2gYQ== 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=zJ/v0pFfGvRs3zyXE24+cF6mCJewg5X+XGBEKPnV2CI=; b=fxMiynqc7TR8ZKhkY/Sbx9REY4KA/Y96o+4kh+wUOdUpKBn+8W3fMxFBd51rRPRve/ uFQaz+0wgKyFrPYHXv9SlC4DyBYQamgOHgiJAQVgx19o54UcWgXmMHHXM0XqRRtJAj/t ZqcA8suGPmDE8XdEWjmO8hY1FAXRjnKuxw3pPIU6h86VXCLvW4TJI6I6IreN5rh+vOSs WyJkWAUoWp6/LNlZeT6BqqxRS15anFr9lafVkqqDJQAd0T1GSBf6EjyL8bcEMaTvILca 1veEK0+qteWazuTxjKEXtyWmikghVLC1bEtdsQeEOtLNyBWIPrtPj87iYIQY4Siyk1d8 HrXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WPR2v5fh; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z12-20020a634c0c000000b00477d8b03517si11431494pga.524.2023.01.10.01.20.26; Tue, 10 Jan 2023 01:20:33 -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=@gmail.com header.s=20210112 header.b=WPR2v5fh; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230433AbjAJIcy (ORCPT + 53 others); Tue, 10 Jan 2023 03:32:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231660AbjAJIcu (ORCPT ); Tue, 10 Jan 2023 03:32:50 -0500 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBD954915C; Tue, 10 Jan 2023 00:32:49 -0800 (PST) Received: by mail-pg1-x535.google.com with SMTP id f3so7728091pgc.2; Tue, 10 Jan 2023 00:32:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zJ/v0pFfGvRs3zyXE24+cF6mCJewg5X+XGBEKPnV2CI=; b=WPR2v5fheduYSJiBQxrVo5qTgujdxcxL7ORJorYz7h6tbfQy0HP1i5zFKeQ/+H3cP2 menpkORMbtOJx4istwVMzZtmwn1Z42iCe4wi2a4Gueu40pBPpjmtdRr4j3QpZfTQM30Z Ui5aqZtXT6TPpTNjzwj/pmfspFTDifjEGA83H+MvMWjejJNSXWLE+ced7exUbbZ4rhnf aqCQ9jtBR4FN8JG61Q5Abn+R70Kp5FMk01dICqdfWDJMyOqustgHQkUrxnqBnRGbc0Dm I5oa1i/yUZsfTTC4qBbry3fv/meYH/bZ6tWl+Xn7DsiUkD6ZpLgHq0YHJv39nbNfMWkE vZRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zJ/v0pFfGvRs3zyXE24+cF6mCJewg5X+XGBEKPnV2CI=; b=aIbRWa7WIU+Vt7o1sNaN49pYkhbzpBMAhU9SRCUylRN6OhK2s4SdqyIrs9SXfsTuJH fBN+2968KYh+T+IRCaAuacOdTp/wuZpFxosSDnEGbCWAjO5qbTxIMew5T+BdeqA3wope /zHWWGrGfgQ1hM89kzugDMg1saBvgQ+sLwc/6A7gXe1MC/+pk6GpoY0jRhaLY+RYLHZ9 UFz8Tfgtg1t5xwjCWac539dfyK1UofFGOr3Bbcv1FUp9SZcw0W8ikw2XfAGgkh+ZpRwc r7Ae4IUxAeu+WJGmEssVbWfS7cBz1tdluVoBItw9EiRmSNqGDuQJeq8ie9bVcXP5ey/3 pZKw== X-Gm-Message-State: AFqh2ko5Y4uxQqOXPW+2U5OJX1xZecrJTPzZhX4sXnSGm4khWW9GsHPW qkyVhN5P5DDk9Z1wPzoavNk= X-Received: by 2002:aa7:8043:0:b0:573:487d:e852 with SMTP id y3-20020aa78043000000b00573487de852mr76820952pfm.4.1673339569264; Tue, 10 Jan 2023 00:32:49 -0800 (PST) Received: from localhost.localdomain ([180.217.149.10]) by smtp.gmail.com with ESMTPSA id z3-20020a626503000000b005871b73e27dsm5064950pfb.33.2023.01.10.00.32.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 00:32:48 -0800 (PST) From: Jim Liu To: JJLIU0@nuvoton.com, KWLIU@nuvoton.com, linus.walleij@linaro.org, brgl@bgdev.pl, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, Jim Liu Subject: [PATCH v4 0/3] Add Nuvoton NPCM SGPIO feature Date: Tue, 10 Jan 2023 16:32:35 +0800 Message-Id: <20230110083238.19230-1-jim.t90615@gmail.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,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: X-Mailing-List: linux-kernel@vger.kernel.org This SGPIO controller is for NUVOTON NPCM7xx and NPCM8xx SoC. Nuvoton NPCM SGPIO module is combine serial to parallel IC (HC595) and parallel to serial IC (HC165), and use APB3 clock to control it. This interface has 4 pins (D_out , D_in, S_CLK, LDSH). NPCM7xx/NPCM8xx have two sgpio module each module can support up to 64 output pins,and up to 64 input pin, the pin is only for gpi or gpo. GPIO pins have sequential, First half is gpo and second half is gpi. The datasheet can reference HC165 and HC595. Jim Liu (3): gpio: nuvoton: Add Nuvoton NPCM sgpio driver arm: dts: nuvoton: npcm: Add sgpio feature dt-bindings: gpio: add NPCM sgpio driver bindings .../bindings/gpio/nuvoton,sgpio.yaml | 92 +++ arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi | 30 + .../dts/nuvoton/nuvoton-common-npcm8xx.dtsi | 30 + drivers/gpio/Kconfig | 8 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-npcm-sgpio.c | 647 ++++++++++++++++++ 6 files changed, 808 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/nuvoton,sgpio.yaml create mode 100644 drivers/gpio/gpio-npcm-sgpio.c -- 2.17.1