From patchwork Fri Dec 29 07:45:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Liu X-Patchwork-Id: 183862 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp2433378dyb; Thu, 28 Dec 2023 23:46:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IHq8hPBg1eW6MvwdCaZMXNyUyCepPfFLRExCFiwdEmkoqOCVHOSx8MTx08PhcWb89RZ+dpr X-Received: by 2002:a62:e708:0:b0:6d9:a4e6:ce1b with SMTP id s8-20020a62e708000000b006d9a4e6ce1bmr3147954pfh.9.1703836008708; Thu, 28 Dec 2023 23:46:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703836008; cv=none; d=google.com; s=arc-20160816; b=BEwejztKKQ6yoZLSwgylkmeNZEwFjCvVQdEXSZNFjLDCiVvSvzqhsAKey4j5rNda1Z YrwW71cfgVedT5A4csXe0GE0SL/UbzyTjmYGsnFGepNIxgVKEVvcbKRb3da2oMVqQE5I 1J+oRtYrOQtVrgN2dKZHq2l963lAi1UPwEDsY3GXFtHYrNVtsiajJ+Ro1yWnRTt8dsR+ 8+vxF3eVqhXc29XWjSi8sBHgfwRrLKb8w/cLwcu3tRvvZhf+zx1uBIZGNIgWsmyr2q3b HKKBHnw88ilgixzNikBfpQcNWegpQq0LAhGe7iPC4VDI8ZUbYoMboVW5n8B3TyHC7+4G 2hzA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=GEGAxLf4IsKoqwzjcok3JRGPJ70voZ7ZjL8ngt195yA=; fh=s39qivJt3sTOQRsMlx81afxSPwcKdWE7alHcaPDaiFc=; b=g3mzZlavi4f+FI7LMNvCA34F/VSh08bnZuU4+Ye5JHTW22jYaSvAyxsnyOQA441/6v OwcC17TOf6gQ0aGHvEU75qv7ZIDt//mlXa9xfFVDzouy+WcW+gZEnAwOMC/ISLGZTdon iQvMfNsVT/twhfDFuuBhecFEvyq/OIMiSc7FwVqw6kzT+UkzDnsonEwPby2yMkOvDOqn kCd622aynigKCIk9SAdZ95T51R1Hpzygr6quqMfage2KpjI4K6npYRSa+IGLx6JEIjUH 8ljLBLghyZTHGMuw2IQfxV8DKwkLgImgzByxqQFaPfRfq6ZrbBdGvsr2vJCiGUdrpPSD cJKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NCdMyGia; spf=pass (google.com: domain of linux-kernel+bounces-12972-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12972-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i28-20020a63541c000000b005ca1286f8f7si14366552pgb.308.2023.12.28.23.46.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 23:46:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12972-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NCdMyGia; spf=pass (google.com: domain of linux-kernel+bounces-12972-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12972-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 E198F284B51 for ; Fri, 29 Dec 2023 07:46:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 78B9F8C0B; Fri, 29 Dec 2023 07:45:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NCdMyGia" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com [209.85.219.172]) (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 339EA79C2; Fri, 29 Dec 2023 07:45:31 +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-yb1-f172.google.com with SMTP id 3f1490d57ef6-dbd532e6e8aso4738095276.2; Thu, 28 Dec 2023 23:45:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703835930; x=1704440730; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GEGAxLf4IsKoqwzjcok3JRGPJ70voZ7ZjL8ngt195yA=; b=NCdMyGiak1nikI5QIs8riOgraD+MoSWraRRmel/fElhPgHqZsAfCuvrPlVKupXbQYc vFb9Dk7VkuvDg3T8BdukCa8rOp1W48IwldORza/BfQRydUDEJsOZ1EwvDG9HyJBVEQva pm2IZerlVNVXneMDZSCKwk6WI1/eAkinyb30KzCCeLBO/9Xw/rGQpbPqtWoVYLtFRWH/ xs2Du3uu9hEywqRMnfQJfCLHOOSnup9+iKFHFhcrlSJCPz5BBfjAvvqqVvSLWZo2D3gD eHO/ad0KBiRvRs7OaKbbjxUKUKM1WPvE3QEZetOgOonXKDR1RWX+1mJNfVBA/E5cXSnY 1sOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703835930; x=1704440730; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GEGAxLf4IsKoqwzjcok3JRGPJ70voZ7ZjL8ngt195yA=; b=MBF70VEiZkDMKkh71upBbuD0v7/k6arsqF4jlyec0J5ph2mt4g2oH3idxulPz4YtIt 4GMPqQ2KbZRhwzuvjo8RdE2O5K+wEBYkgHiYbPQ9BL59/weiulCsCFt8hGGqrOt3ZtCT VmV0ToW2oRKKbpKXacZpS7ft+a0LzfNZxbaxtaIJXl24DcJAJ8i/RZzgaNO3qC5QS3w9 aBteuXo+HBcAlgHJpHv77swPGSSadB3YiaI1lbHnpKPuUh3paWFJkbPMCCRmnDZqxeQG DfCE+JnP8Cs681RHjCrAR8FFAJPaH6qQSk/ueXD18MM6hC2O0R6xYRK5rbX0dcfoD8LW K+Jw== X-Gm-Message-State: AOJu0YxgHVP1WoVf7E1HQSsVj304ezO8wV1TSvvKpPmGXJPs9BJFXa/P icqc42VPhwtqLrjvdiRgzpU= X-Received: by 2002:a25:69c5:0:b0:dbd:38c:e612 with SMTP id e188-20020a2569c5000000b00dbd038ce612mr6841255ybc.84.1703835930106; Thu, 28 Dec 2023 23:45:30 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 23:45:29 -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, Rob Herring , Paul Menzel Subject: [PATCH v10 1/3] dt-bindings: gpio: add NPCM sgpio driver bindings Date: Fri, 29 Dec 2023 15:45:06 +0800 Message-Id: <20231229074508.2709093-2-JJLIU0@nuvoton.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231229074508.2709093-1-JJLIU0@nuvoton.com> References: <20231229074508.2709093-1-JJLIU0@nuvoton.com> 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: 1786601546487137955 X-GMAIL-MSGID: 1786601546487137955 From: Jim Liu Add dt-bindings document for the Nuvoton NPCM7xx sgpio driver Signed-off-by: Jim Liu Reviewed-by: Linus Walleij Reviewed-by: Rob Herring Reviewed-by: Paul Menzel --- Changes for v10: - modify error words Changes for v9: - no changed Changes for v8: - no changed --- .../bindings/gpio/nuvoton,sgpio.yaml | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/nuvoton,sgpio.yaml diff --git a/Documentation/devicetree/bindings/gpio/nuvoton,sgpio.yaml b/Documentation/devicetree/bindings/gpio/nuvoton,sgpio.yaml new file mode 100644 index 000000000000..9e32e54aeb24 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/nuvoton,sgpio.yaml @@ -0,0 +1,87 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/nuvoton,sgpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Nuvoton SGPIO controller + +maintainers: + - Jim LIU + +description: | + This SGPIO controller is for NUVOTON NPCM7xx and NPCM8xx SoC and detailed + information is in the NPCM7XX/8XX SERIAL I/O EXPANSION INTERFACE section. + Nuvoton NPCM7xx SGPIO module is combines a serial to parallel IC (HC595) + and a parallel to serial IC (HC165). + Clock is a division of the APB3 clock. + This interface has 4 pins (D_out , D_in, S_CLK, LDSH). + NPCM7xx/NPCM8xx have two sgpio modules. Each module can support up + to 64 output pins, and up to 64 input pins, the pin is only for GPI or GPO. + GPIO pins can be programmed to support the following options + - Support interrupt option for each input port and various interrupt + sensitivity options (level-high, level-low, edge-high, edge-low) + - ngpios is number of nuvoton,input-ngpios GPIO lines and nuvoton,output-ngpios GPIO lines. + nuvoton,input-ngpios GPIO lines is only for GPI. + nuvoton,output-ngpios GPIO lines is only for GPO. + +properties: + compatible: + enum: + - nuvoton,npcm750-sgpio + - nuvoton,npcm845-sgpio + + reg: + maxItems: 1 + + gpio-controller: true + + '#gpio-cells': + const: 2 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + nuvoton,input-ngpios: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + The numbers of GPIO's exposed. GPIO lines are only for GPI. + minimum: 0 + maximum: 64 + + nuvoton,output-ngpios: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + The numbers of GPIO's exposed. GPIO lines are only for GPO. + minimum: 0 + maximum: 64 + +required: + - compatible + - reg + - gpio-controller + - '#gpio-cells' + - interrupts + - nuvoton,input-ngpios + - nuvoton,output-ngpios + - clocks + +additionalProperties: false + +examples: + - | + #include + #include + gpio8: gpio@101000 { + compatible = "nuvoton,npcm750-sgpio"; + reg = <0x101000 0x200>; + clocks = <&clk NPCM7XX_CLK_APB3>; + interrupts = ; + gpio-controller; + #gpio-cells = <2>; + nuvoton,input-ngpios = <64>; + nuvoton,output-ngpios = <64>; + };