From patchwork Fri Dec 29 07:45:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Liu X-Patchwork-Id: 18598 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp2433328dyb; Thu, 28 Dec 2023 23:46:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IHuA/Cyzzy+73AbJwy8Mlvdroeldn4FaIU80edN9b1pxU5w4mlQ9n+50AU3j6WRbznAFBKo X-Received: by 2002:a05:6808:4447:b0:3bb:c8ed:57ce with SMTP id ep7-20020a056808444700b003bbc8ed57cemr5030273oib.79.1703835997567; Thu, 28 Dec 2023 23:46:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703835997; cv=none; d=google.com; s=arc-20160816; b=0tqrn/uAMMGjepyqtSPA/U+QJpJ+h8EsPqc11PzdWpbZCfClnMqpSdLc2h7WT1qqA1 h6wH5JhGV9ve3GQaqfazZdp+uQw+vg39D1dfxh5v7DzibG572r+zSrMMk+rbbzWwJErT I6gVQ5UiGj/HSQwnSJi1rEJHjbyEDLCntIDLKXM0G17TNmfv208LemuNtr4WZci093Zz Few9x8NA7tCo8LNvXXM+GfpGIDex9MXmoM2Iy4PPYj9zDCdAK+8ZrE1rGAyR4z6At/Jo HsDoMDaCday6LRCE7NCbzff7dK0bzdY0jay/+tLnZA2mfaevOzH3z7YPOTUJ595GzcAF 338w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=rSHwqKa1O5F2oXrIiKvFNvbBOMiFR0XtCw83IG7yVSc=; fh=UOUFIXaP3V3zbDDCQj9JBBA8zvknbSKb3cqjJ0SiGkQ=; b=apW9ErhQ5cEvYWmrKrd3zjXvb7ArWIIV4DYKrOWpgBygcQGSbZKqtBknhuM1Fr2LPY 9LBW5wiKVS2vpkHoR8e/8zWcC4mRksorYMEGhduOb4CFSjI/EYQsVd96LMJV+PbVCFhG 7cDMDkpTKeKOKV13wtQJUPQO6IG2gEei2HK0XAQ+bvodGFDKuCHHTXQnXDwMHSJ8311h sr4rkb0Kt7JYJw3PB7wxzF4uK5vuNfsIHB2jScFGciT20FZg5adtK/jP2L647nWJ2KV+ U+fcYHfvY2RMLR31404xNBiKt7G+bPexXkErJQNWNWc3SNidQkgxvAtNJxey7id9+T6n 7jMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="EDZaLk/N"; spf=pass (google.com: domain of linux-kernel+bounces-12971-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12971-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w11-20020a65410b000000b005c701bf0e27si13950936pgp.79.2023.12.28.23.46.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 23:46:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12971-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="EDZaLk/N"; spf=pass (google.com: domain of linux-kernel+bounces-12971-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12971-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EF7CA2846DB for ; Fri, 29 Dec 2023 07:45:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7F09B79CD; Fri, 29 Dec 2023 07:45:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EDZaLk/N" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EF8A746A; Fri, 29 Dec 2023 07:45:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-3bbc648bed4so1703635b6e.3; Thu, 28 Dec 2023 23:45:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703835924; x=1704440724; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=rSHwqKa1O5F2oXrIiKvFNvbBOMiFR0XtCw83IG7yVSc=; b=EDZaLk/NAPL5dSxcZm9V5vYVUZDUcmmgPlWHnrcVDMpQpqB8HC2eOJ986NxveBnhSA LG50uam0yfrY8G/ZiA+Zo60hfAGYwotpkzPkWA1jOvo31r+fbgMvLYYWyyETzAsPYN+4 LNuLVZYV8CJysD3eUQC8qGoYgPxWkzJPaUViuddvtYZ9rvYyILAkA4Uiis9AKEykzv+e QKQOUS/cePnxzg3NVixHOIDPM9g5ylxlK9JMeO4KZWfaGILUjQ5YV9U2czo0N3fjhAYa jq3Kn92aHkr33J0A1PDZyZQVmAeiPtEed7ILbfE903FwYRshcvNmMMjFyT9lkVPsSEz0 KGzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703835924; x=1704440724; 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=rSHwqKa1O5F2oXrIiKvFNvbBOMiFR0XtCw83IG7yVSc=; b=vq5NxeoxGSWn6hJyLI0oHWM7VmlmLtnvHfexZ+/aGUsg8MVvs6kFs1bLPd0JFZMXcR nbSHPTMvf5M4QqAyeNd6dbhgELTUWJTR13cxQAg4Kj+tQquXIRRn+0PVRlIzZWcbJJA0 JELg1oSg3gSGvyXdp4fcHJBixEoBHGSD6xRTeGsCvs6utZxhLLY+T4NWqv2djkcXWzlW XLjzQ3pLoRuDuCWdf+/FXDm+gcCwI9z5YSAxZCmstyFMzmC0iS9Ss6opby3TfBncFctL Cg/I5+fPpl3HcJkkJ+dqXLHNKu+MM1ilQcP4X60lbRW3T34wA2TwUZQd3ZhfxGtpeetD pYBQ== X-Gm-Message-State: AOJu0Yz2uwd/MRODbBqRJXwBdHyL8C9kZIWxcWX8pzJwcs8zwP+gXkiJ g23qGZurnUu3FfyCH9mFMO4= X-Received: by 2002:a05:6808:13c2:b0:3bb:e066:7d27 with SMTP id d2-20020a05680813c200b003bbe0667d27mr1025603oiw.91.1703835924688; Thu, 28 Dec 2023 23:45:24 -0800 (PST) Received: from localhost.localdomain ([1.200.140.173]) by smtp.gmail.com with ESMTPSA id s188-20020a6377c5000000b005c683937cc5sm10305186pgc.44.2023.12.28.23.45.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 23:45:24 -0800 (PST) From: jim.t90615@gmail.com X-Google-Original-From: JJLIU0@nuvoton.com To: JJLIU0@nuvoton.com, KWLIU@nuvoton.com, jim.t90615@gmail.com, linus.walleij@linaro.org, brgl@bgdev.pl, andy@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org Subject: [PATCH v10 0/3] Add Nuvoton NPCM SGPIO feature Date: Fri, 29 Dec 2023 15:45:05 +0800 Message-Id: <20231229074508.2709093-1-JJLIU0@nuvoton.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786601534992840872 X-GMAIL-MSGID: 1786601534992840872 From: Jim Liu 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. Jim Liu (3): dt-bindings: gpio: add NPCM sgpio driver bindings arm: dts: nuvoton: npcm: Add sgpio feature gpio: nuvoton: Add Nuvoton NPCM sgpio driver .../bindings/gpio/nuvoton,sgpio.yaml | 87 +++ .../dts/nuvoton/nuvoton-common-npcm7xx.dtsi | 24 + drivers/gpio/Kconfig | 7 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-npcm-sgpio.c | 612 ++++++++++++++++++ 5 files changed, 731 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/nuvoton,sgpio.yaml create mode 100644 drivers/gpio/gpio-npcm-sgpio.c