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: 160425 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp153704vqx; Tue, 31 Oct 2023 19:52:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEDj0gvJzC6u4vVh96m0tLpNjIlHPdvKQ19ic64DyvgHYFFvAoSBNVVRR1iZQYrWOXftBt6 X-Received: by 2002:a05:6a00:6511:b0:68f:a92a:8509 with SMTP id hc17-20020a056a00651100b0068fa92a8509mr1806738pfb.7.1698807130963; Tue, 31 Oct 2023 19:52:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698807130; cv=none; d=google.com; s=arc-20160816; b=Vs1grFaiZ11JAXu+jueY0vHXP7nrT0t5Nue+gwFs/QxCbV7VDdHSnPnODdXLSz0CoU UXtQjkfZxyu1Rg2vmZ4oF71avLCBpLVYRwl4znVhW+DhvL7il+BzTFdUN4/tpJpOsEwW bsmgf2jYzrG4YZEKkm3GTWkeO+SibHGn9ekI1CJM1qUmGrxK76DWebBYQ8avYG0LO9Th wreSBfqpZLt0II/ZZvEcEfBXjSQ8cfWGwcOyU2WUz5h1J6eH2wVjMfhTohuZerC0KiOv 73KKB8FIShdOGgANv62wgVc9u5SNrwEX1HXMvE2Ube76Yr906MYe9i75M1ltwW0ttdHw W+Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=khygvZjuMVBFSzCOEzvnNcm1upyhdkkBXmaI1/qLtD8=; fh=KJdEJmgksnryzR31HhCdZKQwv0HmHAHWS5tgtVgOaWw=; b=KUDHY5ag2PPdGqHBB1kwbJgbsqX7irI/Hj5uCSxl5Xrje4HQAHE/DqKmsI0cWF0FhU LIcgVcW87KlnFiYp7rLoOa9bcIrYRllpNT1BNzvIilzKYByKNFkIbYxnl162dSQpZ5Y8 YR/rFnKAjDDbMbpsyJ1yk2kqgMsGJmbuQLKteXgQhk2NJ8+L6IKmYN4z63lyVUec6eej xiKv2qUC74Dv0+af/eWMuT68nF4XvzkIuBAiDKiNs3kGarQQQd8Sv8Btplm81G7BMM2n uRLbzTZibIW1AYf1zuI3bE6yUAajXpMyDHGjBqZ8GJgdIo4rCDiRGErivbQoDkXytD/1 GLcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="U/tB4HSe"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id l187-20020a6325c4000000b005b863258361si2075336pgl.45.2023.10.31.19.52.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 19:52:10 -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=@gmail.com header.s=20230601 header.b="U/tB4HSe"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 168BE8129AF0; Tue, 31 Oct 2023 19:52:10 -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 S1345940AbjKACwF (ORCPT + 34 others); Tue, 31 Oct 2023 22:52:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345164AbjKACwC (ORCPT ); Tue, 31 Oct 2023 22:52:02 -0400 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-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> MIME-Version: 1.0 X-Spam-Status: No, score=1.5 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_BLOCKED,RCVD_IN_SBL_CSS,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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]); Tue, 31 Oct 2023 19:52:10 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781328385949454060 X-GMAIL-MSGID: 1781328385949454060 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>; + };