From patchwork Wed Nov 1 02:51:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Liu X-Patchwork-Id: 1857805 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=U/tB4HSe; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=permerror (SPF Permanent Error: More than 10 MX records returned) smtp.mailfrom=vger.kernel.org (client-ip=147.75.199.223; helo=ny.mirrors.kernel.org; envelope-from=devicetree+bounces-13332-incoming-dt=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SKs3t3mwLz1yQk for ; Wed, 1 Nov 2023 13:52:10 +1100 (AEDT) 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 16AE21C20D30 for ; Wed, 1 Nov 2023 02:52:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A89BA32; Wed, 1 Nov 2023 02:52:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U/tB4HSe" X-Original-To: devicetree@vger.kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B9FB643 for ; Wed, 1 Nov 2023 02:52:01 +0000 (UTC) Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2298FF5; Tue, 31 Oct 2023 19:51:57 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-28028f92709so349141a91.0; Tue, 31 Oct 2023 19:51:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698807116; x=1699411916; 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=khygvZjuMVBFSzCOEzvnNcm1upyhdkkBXmaI1/qLtD8=; b=U/tB4HSeQzQhlS4UKYaacF7e1Gax9mE1Epvm5i15llcXR7W9aA0R+MF2PDrhcpQMVG cwxjATPsXpeKOu9Jz6WXEm1Nsbt2Rni0SCInZzZkx62mrQ57Nly4kmMmaoxuciBhp3xR mqUdtzxkHM4hAXuljrczpt3AaO9m8F6U5OP5r7DctUrvJlVPoxZPGv2RmWwx8yjfi+LT u5ZRgZmcGCFoAX5LgiciNddx6z5+BGJHn8VpXIQNLdCfEUFKo5oKidyA8T3BI/zT8UvK 2xJevEJbMLClkNVmjkQg4GVqwW2hsgOwVE8O6fIiGOkveh9PkXUhIgU2UsefQ6Wdq77g aUHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698807116; x=1699411916; 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=khygvZjuMVBFSzCOEzvnNcm1upyhdkkBXmaI1/qLtD8=; b=DlSP8LuPE80zIuC6LrWTTSYrnxGG/+Gn8wrfce8L2k3s52Tsp2WkJ6IQ99Z9HiPDZX 6Tl4xLrW27Vh1MxurUsJJmLO7UGMhvu5nITBqW7AnVvaaq9pONTZeUmiW6qk7LAgsnrZ WqGRo+XGeXGtv+bWAwRAGa7eSk6jy8yrT1tBHTA3auu4Y6JPZU3f/VgF2aMgGwHqSDgf /m+vqojET4U8adj5jf4MGbVRPbRSe/hlwv89oSbK1DPo9wDOzQCO2tehb90lq773Zllp lvA93Hc0wMnRkv6E5dPnQPip9Auobo3nmLGR/af7LiBtR8wHIx94WDGKauy/SmP9dQJM owqg== X-Gm-Message-State: AOJu0YxTff1CmFHkEVX4zWWJ6KLWy5jAm581SQo38Pw+9ANMLjzumt09 nA/2GG0sjlp1mdLrm0O/Kog= X-Google-Smtp-Source: AGHT+IFTscJiXdgDvOozxUg7X7rOBzsPJhKFTpc+QrHap5hKCLhEJ0STE5UbNMrToYaWzyBigpDzfA== X-Received: by 2002:a17:90b:1e0d:b0:27d:d9a:be8b with SMTP id pg13-20020a17090b1e0d00b0027d0d9abe8bmr6069151pjb.6.1698807116381; Tue, 31 Oct 2023 19:51:56 -0700 (PDT) Received: from cs20-buildserver.lan ([1.200.130.202]) by smtp.gmail.com with ESMTPSA id m6-20020a17090b068600b002809074eb3esm1709685pjz.21.2023.10.31.19.51.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 19:51:56 -0700 (PDT) From: Jim Liu To: JJLIU0@nuvoton.com, krzysztof.kozlowski+dt@linaro.org, linus.walleij@linaro.org, andy@kernel.org, benjaminfair@google.com, brgl@bgdev.pl, jim.t90615@gmail.com, robh@kernel.org Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org Subject: [PATCH v7 1/3] dt-bindings: gpio: add NPCM sgpio driver bindings Date: Wed, 1 Nov 2023 10:51:08 +0800 Message-Id: <20231101025110.1704543-2-jim.t90615@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231101025110.1704543-1-jim.t90615@gmail.com> References: <20231101025110.1704543-1-jim.t90615@gmail.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: * Add dt-bindings document for the Nuvoton NPCM7xx sgpio driver Signed-off-by: Jim Liu Reviewed-by: Linus Walleij Reviewed-by: Rob Herring --- Changes for v7: - no change Changes for v6: - Drop quotes for $ref - Add and drop '|' for description - Add space after 'exposed.' - remove status Changes for v5: - remove bus bus-frequency - modify in/out description Changes for v4: - modify in/out property - modify bus-frequency property Changes for v3: - modify description - modify in/out property name Changes for v2: - modify description --- .../bindings/gpio/nuvoton,sgpio.yaml | 86 +++++++++++++++++++ 1 file changed, 86 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..84e0dbcb066c --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/nuvoton,sgpio.yaml @@ -0,0 +1,86 @@ +# 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. + Nuvoton NPCM7xx 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. + GPIO pins can be programmed to support the following options + - Support interrupt option for each input port and various interrupt + sensitivity option (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 is 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 is 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>; + };