Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp647483rdb; Tue, 31 Oct 2023 19:52:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHKb+9qSf8KlLs+DijwSuX8UftpoI5p55JQtBI0BUd1pO+q0aeW7RnB+idDLVP+UngtPSZp X-Received: by 2002:a05:6a00:2314:b0:68b:a137:373d with SMTP id h20-20020a056a00231400b0068ba137373dmr5707826pfh.17.1698807128886; Tue, 31 Oct 2023 19:52:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698807128; cv=none; d=google.com; s=arc-20160816; b=MmZ8bwsKjpcIIiS9v6IhJiVTJcWxTcpwCcpA3Q7MzzVSEop+rIx7zbsCG6oHXXVnQf Qe7jMZp8hezx06hW1GMKLvtpZvlArR4WcxRDY83VLaT5P++jM7c/4IQeAqMgnYbPEddj RtgmZPBzoYVLcX5UFY8Yn/mDrkKieSXLbfR4U0U+OvecWBvsW/V1ZRv59yokX7Fn0wIY v64A4sha7zyRu+M5Hq0m4JMID0yVQhs7vNnwdN/ktFCWftJwgdUnMryZ6l0lSWFosKWC 0bzpNgrpDR/o402XR8OrcBOKmW+mIlrheyx9KfkZU6pPHwYGcYeV+3xx6vY77i0MRl/a 0EbQ== 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 Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id y21-20020aa79af5000000b006c0328db725si631436pfp.39.2023.10.31.19.52.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 19:52:08 -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 8A534805ECDD; Tue, 31 Oct 2023 19:52:07 -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 S1345397AbjKACwF (ORCPT + 99 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 Content-Transfer-Encoding: 8bit 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:07 -0700 (PDT) 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>; + }; -- 2.25.1