From patchwork Wed Dec 6 01:45:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Liu X-Patchwork-Id: 174267 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3825828vqy; Tue, 5 Dec 2023 17:46:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/g9V9BOvp9tJpux4Mxols96q99+PcV2FeDpGoZmx7ISa7mDohHkwEHAtq0mrPxYBm4Md7 X-Received: by 2002:a17:902:6bc5:b0:1d0:afd5:1e93 with SMTP id m5-20020a1709026bc500b001d0afd51e93mr102896plt.8.1701827209430; Tue, 05 Dec 2023 17:46:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701827209; cv=none; d=google.com; s=arc-20160816; b=Vl0Fk0g0ZfFvQAYod5X2cutGF4GmuQeGHijABIRULjCv0mWQC8XFE3jOe85flIJxJg gz0qIh2Y3lp1qOlxQ869QSdJAt0U7ZOk0xvGN3D8FsCFE2rF1J19/n4BGmjCDD8Xvlh2 seMzEnuq4ZaFBpij+htNswkaUCvFJ9XZkKhUTN49jzgjBCj3UvtEji+zLlJcJeHjmMoX pFZScugs+5pA3/TR3g6iOwRUkhztwjsW+7IuIyAFRHnVq0H6hIouDZzNC/Mn/qi8vAsQ qu1nlDyzcLZkttoXBqv9cYqnu8R+7uxl5id5dxCF8XdUcbW1OUmM+0DplKdUS29Gaucr xoGw== 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=csVIocKJcCA0/pKL9VAYyHAhw6hsvYWEU7r5aRbgOmA=; fh=q1cHK1FWGDfuI/+7+aLpzVSgaJN0R+iQyw4dSIrRA5c=; b=ab7KEkffjbj9GGCYtMZ8rZNGRrArUvHQVcNtcD64CWXrZizUCyau6wCJuCvMKQLtkl YVb0RI3e+8evNH3VJpa9eTvlBjnAfFLOimjLVYqKVJokbigNAdsRlhYhoTjL4YnM1g/F VssGkhhbGxxuRrydTVrn82yBzWi+SHhi+NOl6cjjT6nQhhVhFX4hfSSD1lDOVbNa4D5c qV6m1T/8fk9GyVmqlo/BBHkDERwY7zTnYnlv9VqnYOk6gFJyC0V/uMAH3PY6R4ddmU0I PAehuxOpGr1Y5D7owCzvcrtKwiX0oA014Bes5Plj/91MZAlPmGE7VwcpZ7VUeh5sy279 480Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=k7ZYZ6fX; 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 b3-20020a170902d50300b001d08cfd46absi5428554plg.372.2023.12.05.17.46.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 17:46:49 -0800 (PST) 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=k7ZYZ6fX; 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 DCBB6802FB8A; Tue, 5 Dec 2023 17:46:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376613AbjLFBqi (ORCPT + 99 others); Tue, 5 Dec 2023 20:46:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235372AbjLFBqb (ORCPT ); Tue, 5 Dec 2023 20:46:31 -0500 Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12EEA10EA; Tue, 5 Dec 2023 17:46:17 -0800 (PST) Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-6d9a3c035b3so1687457a34.2; Tue, 05 Dec 2023 17:46:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701827176; x=1702431976; 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=csVIocKJcCA0/pKL9VAYyHAhw6hsvYWEU7r5aRbgOmA=; b=k7ZYZ6fXc2kx0u0FG8a/3Ng1nNeGr3DiZp3+rUGvX8dpgBvYMGAWAcjRW6CZNaTG5b cNwD/9FuVwqZlZrIZwyTrrJsyHQ5JDT9LvFs9cHk9hGruEt7f9FxEUBJb2OjULNOIiOk kUzhsz8pzJIYZxtsiKcsB0ihWDjdgSD/D8D0g5BMZDmOdWHDbTfH4LGHt+NLchB82gBc c1XvPjVjc+0HofcwjC281M6P74TmNmLQ0nitFM9yljaCzPiHGdko73y6w1wvTjEvKD4i jStVuwa9RqIzZRtXAyUXHW9YDheg+lizDec1cbVXgfSzjBVdcw0qREYqZVQ9I0xr/qyF hvMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701827176; x=1702431976; 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=csVIocKJcCA0/pKL9VAYyHAhw6hsvYWEU7r5aRbgOmA=; b=HoyE4GfDaMD+MezOAlcwmQ3Zb8T+BtW7QsBpzX0Uj6EQ5RPaOjp20R/shRZVGOBFGw JkU/OlBq2TOFoC5ds0nvd662iAp5HiKM1jU+mHtGnrSAheeHZSmKviJJD5AfPuUxrAac 2CzMFExDMUhM1LAR1Gl5auiThHCFbae0YiqYlDfBE8WqZiyP/m8d7zN9MLiiNgJ1x3Zg BDkbeJdmm2z8jfBWpMx8r4ENT8f3vt+VY+cbLtQ2Omrfe88MKPzPuko8uDraOgU4qjof rW9F8PbEebdNIWFz14ufE80ML9l9uF6YHinGFrn85zH4W9zddNPzbCp8z0WgKsYa7JZ1 Gtcw== X-Gm-Message-State: AOJu0Ywp5QFjhep9aLqjo97GZ3adIW2pdrb46L2CvXjBjN+Z/9CWedV8 aukkvXWEt2CVM9ILCjWdb4F3gfNn4Z2Z8g== X-Received: by 2002:a05:6830:1681:b0:6d8:e05b:115b with SMTP id k1-20020a056830168100b006d8e05b115bmr266085otr.7.1701827176057; Tue, 05 Dec 2023 17:46:16 -0800 (PST) Received: from localhost.localdomain ([112.78.94.69]) by smtp.gmail.com with ESMTPSA id g24-20020aa78758000000b006ce781f6f85sm1250956pfo.43.2023.12.05.17.46.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 17:46:15 -0800 (PST) From: Jim Liu To: JJLIU0@nuvoton.com, krzysztof.kozlowski+dt@linaro.org, linus.walleij@linaro.org, andy@kernel.org, robh+dt@kernel.org, conor+dt@kernel.org, KWLIU@nuvoton.com, jim.t90615@gmail.com Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, Rob Herring Subject: [PATCH v8 1/3] dt-bindings: gpio: add NPCM sgpio driver bindings Date: Wed, 6 Dec 2023 09:45:28 +0800 Message-Id: <20231206014530.1600151-2-jim.t90615@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231206014530.1600151-1-jim.t90615@gmail.com> References: <20231206014530.1600151-1-jim.t90615@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 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_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 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, 05 Dec 2023 17:46:48 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784495168112189214 X-GMAIL-MSGID: 1784495168112189214 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 v8: - no changed Changes for v7: - no changed Changes for v6: - Drop quotes for $ref - Add and drop '|' for description - Add space after 'exposed.' - remove status --- .../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>; + };