From patchwork Wed Nov 16 06:53:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinbo Zhu X-Patchwork-Id: 20740 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3129399wru; Tue, 15 Nov 2022 23:02:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf6CiWM2WRh8cDCMuRC0NqHGcH10pWGie1RGvpn4EDrjNHG7OBNmIWqxIwRHCxFVEbDaIqGV X-Received: by 2002:a63:cc0e:0:b0:473:e501:8c03 with SMTP id x14-20020a63cc0e000000b00473e5018c03mr19383009pgf.539.1668582124234; Tue, 15 Nov 2022 23:02:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668582124; cv=none; d=google.com; s=arc-20160816; b=xgK5sbo8tYqteVcXiW5k7AmB2zzmSYfmNrsHeqvLcZuuzfsVZuOeqOw628SAyOvEuq rst6v7dFGC6AkXbZJHxKhixbwmi7rrjA4q9D6VCCPB5KPQx4+WESE6USmjJZTScuRkwD ExrjlYPPNZ4eI2Oui9CVG955/YP0vZ9Wcnh5IyOKR6tSxZpaZJ3tVHuFjKmYWySGt5jF ZsMq5vojOwXMY11QXccLfALIaSkS9gZaDOza4lRVuSYGsDleIE/7LNLMTYrytprFsMzf nnWG/TH7P50nFcVumUdIneM7sU/2jih0UQiWmOCtvm6FSGtQNkrZJ7iQd6XqOOaT1lWu BykQ== 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:to:from; bh=mWP6cMqmWg8k9Q+zhDGEphzRIE7dHFsc28KsljNLFds=; b=Jh2RXAa41RIMpFG4OdNjUW4o0Z6jEAg+fBrxcFkNiNUYvA9Zmty1BMC1ROo5r+HEWZ 8cf1NzWtllYRhN7ibvngle1mICvlWhADaY7esBYnGKaSEOSz2wEpAc/zjAqeNA27FXNI YL04ND5vUEjc4PomxaL6AogH6L/RVINsM+bK17wYRDshpt8s9BrD0LDSyqDGHoQ3ffO6 sHCW3TFhBNBJ9hPwK2F1pnB3HHWyQU5tY0szl4FjU/37UoNZaeDNi9ElGXWPp3xctql+ RFvJLA8eqNM2j6fTx2qLnSb7OuHFj8clemK8YpxTcm2Nutvw4MZZs/5LXIQH4g4ucJQq kEpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f17-20020a170902f39100b00188b63f078dsi9374088ple.362.2022.11.15.23.01.44; Tue, 15 Nov 2022 23:02:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231464AbiKPGyJ (ORCPT + 99 others); Wed, 16 Nov 2022 01:54:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231995AbiKPGxx (ORCPT ); Wed, 16 Nov 2022 01:53:53 -0500 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 40166A8; Tue, 15 Nov 2022 22:53:48 -0800 (PST) Received: from loongson.cn (unknown [10.180.13.64]) by gateway (Coremail) with SMTP id _____8CxPLb7iHRjOqsHAA--.10502S3; Wed, 16 Nov 2022 14:53:47 +0800 (CST) Received: from localhost.localdomain (unknown [10.180.13.64]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dx_1fxiHRjC4sUAA--.54738S3; Wed, 16 Nov 2022 14:53:46 +0800 (CST) From: Yinbo Zhu To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , WANG Xuerui , Jiaxun Yang , Thomas Bogendoerfer , Juxin Gao , Bibo Mao , Yanteng Si , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, Arnaud Patard , Huacai Chen , Yinbo Zhu Subject: [PATCH v3 2/2] dt-bindings: gpio: add loongson series gpio Date: Wed, 16 Nov 2022 14:53:35 +0800 Message-Id: <20221116065335.8823-2-zhuyinbo@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20221116065335.8823-1-zhuyinbo@loongson.cn> References: <20221116065335.8823-1-zhuyinbo@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Dx_1fxiHRjC4sUAA--.54738S3 X-CM-SenderInfo: 52kx5xhqerqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjvJXoWxXF47tFy8Ww43XFy5Gw4xXrb_yoWrZrykp3 WDZFZxX3y2grnxtF45KanrZr4xAr1kC3WrurnxC3yxtrW7KwnxXFWfWFykG3Z3WrWUXF17 JwsrurWFya43Aw7anT9S1TB71UUUUjJqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bfkFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AKwVWUAVWUZwA2ocxC64 kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28E F7xvwVC0I7IYx2IY6xkF7I0E14v26r4j6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJw A2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJwAaw2AFwI0_JF0_Jw1le2I262IYc4CY 6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27wAqx4xG64xvF2IEw4CE5I8CrV C2j2WlYx0E2Ix0cI8IcVAFwI0_Jw0_WrylYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE 7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCY1x0262kKe7AKxVWUtVW8ZwCF04k20xvY0x 0EwIxGrwCF04k20xvE74AGY7Cv6cx26rWl4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxYO2xF xVAFwI0_JF0_Jw1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWw C2zVAF1VAY17CE14v26r4a6rW5MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Gr0_ Xr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJV WUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIY CTnIWIevJa73UjIFyTuYvjxU24EEUUUUU X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749635169641602134?= X-GMAIL-MSGID: =?utf-8?q?1749635169641602134?= Add the Loongson series gpio binding with DT schema format using json-schema. Signed-off-by: Yinbo Zhu Reviewed-by: Krzysztof Kozlowski --- Change in v3: 1. Separate some changes of MAINTAINERS file and enter the first patch. Change in v2: 1. Drop "loongson,gpio_base" and "gpio-ranges" will cover it. 1. Drop "loongson,conf_offset", "loongson,out_offset", "loongson,in_offset", "loongson,support_irq" and kernel driver will initial them that depend compatible in kernel. 3. Fixup maintainer for this driver. .../bindings/gpio/loongson,ls-gpio.yaml | 126 ++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 127 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml diff --git a/Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml b/Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml new file mode 100644 index 000000000000..f54048d03d9b --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml @@ -0,0 +1,126 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/loongson,ls-gpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Loongson series GPIO controller. + +maintainers: + - Yinbo Zhu + +properties: + compatible: + enum: + - loongson,ls2k-gpio + - loongson,ls7a-gpio + + reg: + maxItems: 1 + + ngpios: + minimum: 1 + maximum: 64 + + "#gpio-cells": + const: 2 + + gpio-controller: true + + gpio-ranges: true + + interrupts: + minItems: 1 + maxItems: 64 + +required: + - compatible + - reg + - ngpios + - "#gpio-cells" + - gpio-controller + - gpio-ranges + - interrupts + +additionalProperties: false + +examples: + - | + #include + + gpio0: gpio@1fe00500 { + compatible = "loongson,ls2k-gpio"; + reg = <0x1fe00500 0x38>; + ngpios = <64>; + #gpio-cells = <2>; + gpio-controller; + gpio-ranges = <&pctrl 0 0 15>, + <&pctrl 16 16 15>, + <&pctrl 32 32 10>, + <&pctrl 44 44 20>; + interrupt-parent = <&liointc1>; + interrupts = <28 IRQ_TYPE_LEVEL_LOW>, + <29 IRQ_TYPE_LEVEL_LOW>, + <30 IRQ_TYPE_LEVEL_LOW>, + <30 IRQ_TYPE_LEVEL_LOW>, + <26 IRQ_TYPE_LEVEL_LOW>, + <26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PE_LEVEL_LOW>, + <27 IRQ_TYPE_LEVEL_LOW>, + <27 IRQ_TYPE_LEVEL_LOW>, + <27 IRQ_TYPE_LEVEL_LOW>, + <27 IRQ_TYPE_LEVEL_LOW>, + <27 IRQ_TYPE_LEVEL_LOW>, + <27 IRQ_TYPE_LEVEL_LOW>, + <27 IRQ_TYPE_LEVEL_LOW>, + <27 IRQ_TYPE_LEVEL_LOW>, + <27 IRQ_TYPE_LEVEL_LOW>, + <27 IRQ_TYPE_LEVEL_LOW>, + <27 IRQ_TYPE_LEVEL_LOW>, + <27 IRQ_TYPE_LEVEL_LOW>, + <27 IRQ_TYPE_LEVEL_LOW>, + <27 IRQ_TYPE_LEVEL_LOW>; + }; diff --git a/MAINTAINERS b/MAINTAINERS index bbd7a0d946eb..cfef13aada3b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12056,6 +12056,7 @@ M: Huacai Chen M: Yinbo Zhu L: linux-gpio@vger.kernel.org S: Maintained +F: Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml F: drivers/gpio/gpio-loongson.c F: include/linux/platform_data/gpio-loongson.h