Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5325271rwb; Tue, 1 Aug 2023 00:05:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlEB1J72mzG5bFbTXLJf7iDZcuD2yLrOvoX1kLOQkNP6IY+m/NkalSPeZcdm9rBysPbLupwM X-Received: by 2002:a05:6402:1299:b0:522:2af1:1ffe with SMTP id w25-20020a056402129900b005222af11ffemr1522333edv.9.1690873528017; Tue, 01 Aug 2023 00:05:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690873528; cv=none; d=google.com; s=arc-20160816; b=JOy0hP8zexHO8Uhe0BkPWTNzjdvE/XgP5l+lPhZYGsrOAV7MGCvEpRJEJjj8+jMyRH sqBVOwR9OBTmrZo680PJK2j0sBIptW6EnG335SBJpsBWpzdD6mEPvIjKvPi46Uot1cXN u++oaiheSAsXynHe/59PNCeoWuGieUMz01ftSeaE5D33Nbl5JirOGgptsFdQDm1B2azJ XutjwkcFVNKgbn3JMugLlG5FUkwtP/4GfUODmWI0aKuj7Bj0B2K9eR3b5HiR63g7hn1b 9kKnjAdEbsm2RV9UUeUuKC6TdrYMXqafLB1Dj1syo/BTuHCij1NshUpzFSyMmVGYGekE M4AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=M+DH9cmTejDQV6xufsev2XYe7CBBYaw/raUQQB7KasU=; fh=VRXePkykJYzSI8e9NstGSyThzddBVzvQ5loqpQj0png=; b=Ln59ustQoGsgxpnRaYw8NamfOV96qMo1Gs4a8ls0/xD0ztKoIIq1nrwfaxHEEThQwW vK2527dy1qGe4KMW+Qkum0WQNMKn+9uYjbRRLGra5lcVoMnXgxvrK6eLtAplCVgw+tmP vZM9ufGOnfNkI/Zk7Jvx9EEaje9Uby5PQ3VvwGXlTiG1A9gzN0BcDzXjhTtxeT5Qt1+w XC52MTlbdZn6jNihjCsg1Ddf96/nE2yvnPQj4IGQA4twLHOUgcWCcsvmsu2xdLkhxtzV rGf8WQKQPJGNfFydkuIq3EzeT2nI3pdd9M8VNu3yx7C6mG1s90zHOd6EyjYV9WI3Zuqr UYJg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w7-20020aa7d287000000b00522be1235bcsi3256384edq.544.2023.08.01.00.05.03; Tue, 01 Aug 2023 00:05:27 -0700 (PDT) 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 S231744AbjHAGj6 (ORCPT + 99 others); Tue, 1 Aug 2023 02:39:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbjHAGj4 (ORCPT ); Tue, 1 Aug 2023 02:39:56 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 89F5F98; Mon, 31 Jul 2023 23:39:53 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.201]) by gateway (Coremail) with SMTP id _____8Cxruu3qMhky+YNAA--.30050S3; Tue, 01 Aug 2023 14:39:51 +0800 (CST) Received: from [10.20.42.201] (unknown [10.20.42.201]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxniO1qMhkHphDAA--.4219S3; Tue, 01 Aug 2023 14:39:50 +0800 (CST) Subject: Re: [PATCH v2 1/2] gpio: dt-bindings: add parsing of loongson gpio offset To: Conor Dooley Cc: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Jianmin Lv , wanghongliang@loongson.cn, Liu Peibao , loongson-kernel@lists.loongnix.cn, zhuyinbo@loongson.cn References: <20230731091059.17323-1-zhuyinbo@loongson.cn> <20230731091059.17323-2-zhuyinbo@loongson.cn> <20230731-setback-such-61815ee3ef51@spud> From: Yinbo Zhu Message-ID: <041bf8a6-8d91-c2ce-6752-aa7255f946c7@loongson.cn> Date: Tue, 1 Aug 2023 14:39:49 +0800 User-Agent: Mozilla/5.0 (X11; Linux loongarch64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20230731-setback-such-61815ee3ef51@spud> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8BxniO1qMhkHphDAA--.4219S3 X-CM-SenderInfo: 52kx5xhqerqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,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 在 2023/7/31 下午11:55, Conor Dooley 写道: > On Mon, Jul 31, 2023 at 05:10:58PM +0800, Yinbo Zhu wrote: >> Add parsing GPIO configure, input, output, interrupt register offset >> address and GPIO control mode support. > > This reeks of insufficient use of SoC specific compatibles. Do GPIO > controllers on the same SoC have different register offsets? Yes, > Where are the users for this? For example, ls2k500 contains multiple GPIO chips with different (configure, input, output, interrupt) offset addresses, but all others are the same. > > Cheers, > Conor. > >> >> Signed-off-by: Yinbo Zhu >> --- >> .../bindings/gpio/loongson,ls-gpio.yaml | 37 +++++++++++++++++++ >> 1 file changed, 37 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml b/Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml >> index fb86e8ce6349..cad67f8bfe6e 100644 >> --- a/Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml >> +++ b/Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml >> @@ -29,6 +29,33 @@ properties: >> >> gpio-ranges: true >> >> + loongson,gpio-conf-offset: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + description: >> + This option indicate this GPIO configuration register offset address. >> + >> + loongson,gpio-out-offset: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + description: >> + This option indicate this GPIO output register offset address. >> + >> + loongson,gpio-in-offset: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + description: >> + This option indicate this GPIO input register offset address. >> + >> + loongson,gpio-ctrl-mode: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + description: >> + This option indicate this GPIO control mode, where '0' represents >> + bit control mode and '1' represents byte control mode. >> + >> + loongson,gpio-inten-offset: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + description: >> + This option indicate this GPIO interrupt enable register offset >> + address. >> + >> interrupts: >> minItems: 1 >> maxItems: 64 >> @@ -39,6 +66,11 @@ required: >> - ngpios >> - "#gpio-cells" >> - gpio-controller >> + - loongson,gpio-conf-offset >> + - loongson,gpio-in-offset >> + - loongson,gpio-out-offset >> + - loongson,gpio-ctrl-mode >> + - loongson,gpio-inten-offset >> - gpio-ranges >> - interrupts >> >> @@ -54,6 +86,11 @@ examples: >> ngpios = <64>; >> #gpio-cells = <2>; >> gpio-controller; >> + loongson,gpio-conf-offset = <0>; >> + loongson,gpio-in-offset = <0x20>; >> + loongson,gpio-out-offset = <0x10>; >> + loongson,gpio-ctrl-mode = <0>; >> + loongson,gpio-inten-offset = <0x30>; >> gpio-ranges = <&pctrl 0 0 15>, >> <&pctrl 16 16 15>, >> <&pctrl 32 32 10>, >> -- >> 2.20.1 >>