Message ID | 20230811110432.3968-1-tony@atomide.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp1032080vqi; Fri, 11 Aug 2023 04:57:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHh/bfdYPl06Zd1nuAJ5acgYu4YxNTEuxwGUhg1eOU64v2ERlKoUhqE/Y2imuCKO1L6EDKo X-Received: by 2002:a05:6a00:1486:b0:687:40bd:561 with SMTP id v6-20020a056a00148600b0068740bd0561mr1764043pfu.20.1691755054545; Fri, 11 Aug 2023 04:57:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691755054; cv=none; d=google.com; s=arc-20160816; b=VEJPdGQEHTBMSPjAS2Raw5NIi3ekOx9a9QsShE/OPf2vfitbfAi2RftvJWIm7NdQXc 1tdeyJn6hAR2C0FpVX4/JSH/LZxRgC37IOgkLOAjsrA/jY/VNAtOKZojaQf2TeX6kzQb XmpSWKzrrpsXE0D3ZFDcOQDF18aPt3YaB5JLZX60hSsrwMhPYyt3AT0RDgKCFtgvLRVy 1CDQsVdUZX6WngLuGepeHq1sGuPQVYFnm/Zo4v2djt8A7myEHpfHwXaBUn333r8pwdlN YWaQ8l0aRQGuiVyT248YlfGrCOueZdTs9Ky1kL2VNN2Uig/G+u0bm2gXQd8bj7OLDGoo e6rQ== 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 :message-id:date:subject:cc:to:from; bh=LeQ+XbohlUmVSFtOnZZlPkqTu6LIEFn0XlNFpE2JXX4=; fh=b7Uwy7wdgJjggQw4v4a3KPJfz/TnfJhA0MIztKXpdt4=; b=yphoIiEpwfVMDvlUvXHZeyIjXRYMENIQCpBDEwartfvlHxpmcWxEpKHBy2Q22x70A/ xiUtcMLnh1ikU3OM44Hi34fL9TvIk1DpYFfNikWG61UPvGFSgU+tuffeMvMYuoaXOsx3 nhOZ2s4a+QkyZdAa7qPitPwEhuUGy68Y2NbE/SkX4cpLfvBUyzrJsmSuMREfQNbK815C jMy6zMz264L+wWgxoMEy5Hgu0CIbXZ7Btwpytq5YJw5aAuGdbFfMBoZ4rpwjPTyXdDPu kFBEMddAk/5RdVINj9uqT6i8BRtkskFFnG17QUU4xaz8kUMNtbCVhVau5A+QE7iWxFBj KuZw== 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 bn13-20020a056a00324d00b006738dfbaf42si3143562pfb.374.2023.08.11.04.57.21; Fri, 11 Aug 2023 04:57:34 -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 S234216AbjHKLEk (ORCPT <rfc822;shaohuahua6@gmail.com> + 99 others); Fri, 11 Aug 2023 07:04:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233288AbjHKLEj (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 11 Aug 2023 07:04:39 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EF35DE54; Fri, 11 Aug 2023 04:04:38 -0700 (PDT) Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 4EBC980F1; Fri, 11 Aug 2023 11:04:37 +0000 (UTC) From: Tony Lindgren <tony@atomide.com> To: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] dt-bindings: input: gpio-keys: Allow optional dedicated wakeirq Date: Fri, 11 Aug 2023 14:04:31 +0300 Message-ID: <20230811110432.3968-1-tony@atomide.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773933747661516276 X-GMAIL-MSGID: 1773933747661516276 |
Series |
[1/2] dt-bindings: input: gpio-keys: Allow optional dedicated wakeirq
|
|
Commit Message
Tony Lindgren
Aug. 11, 2023, 11:04 a.m. UTC
Allow configuring optional dedicated wakeirq that some SoCs have.
Let's use the interrupt naming "irq" and "wakeup" that we already have
in use for some drivers and subsystems like i2c.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
.../devicetree/bindings/input/gpio-keys.yaml | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
Comments
On Fri, 11 Aug 2023 14:04:31 +0300, Tony Lindgren wrote: > Allow configuring optional dedicated wakeirq that some SoCs have. > Let's use the interrupt naming "irq" and "wakeup" that we already have > in use for some drivers and subsystems like i2c. > > Signed-off-by: Tony Lindgren <tony@atomide.com> > --- > .../devicetree/bindings/input/gpio-keys.yaml | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13): yamllint warnings/errors: ./Documentation/devicetree/bindings/input/gpio-keys.yaml:40:1: [error] syntax error: found character '\t' that cannot start any token (syntax) dtschema/dtc warnings/errors: make[2]: *** Deleting file 'Documentation/devicetree/bindings/input/gpio-keys.example.dts' Documentation/devicetree/bindings/input/gpio-keys.yaml:40:1: found character '\t' that cannot start any token make[2]: *** [Documentation/devicetree/bindings/Makefile:26: Documentation/devicetree/bindings/input/gpio-keys.example.dts] Error 1 make[2]: *** Waiting for unfinished jobs.... ./Documentation/devicetree/bindings/input/gpio-keys.yaml:40:1: found character '\t' that cannot start any token /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/input/gpio-keys.yaml: ignoring, error parsing file make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1500: dt_binding_check] Error 2 make: *** [Makefile:234: __sub-make] Error 2 doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230811110432.3968-1-tony@atomide.com The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
On Fri, Aug 11, 2023 at 02:04:31PM +0300, Tony Lindgren wrote: > Allow configuring optional dedicated wakeirq that some SoCs have. > Let's use the interrupt naming "irq" and "wakeup" that we already have > in use for some drivers and subsystems like i2c. > > Signed-off-by: Tony Lindgren <tony@atomide.com> > --- > .../devicetree/bindings/input/gpio-keys.yaml | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/input/gpio-keys.yaml b/Documentation/devicetree/bindings/input/gpio-keys.yaml > --- a/Documentation/devicetree/bindings/input/gpio-keys.yaml > +++ b/Documentation/devicetree/bindings/input/gpio-keys.yaml > @@ -31,7 +31,17 @@ patternProperties: > maxItems: 1 > > interrupts: > - maxItems: 1 > + description: > + Optional interrupts if different from the gpio interrupt > + maxItems: 2 > + > + interrupt-names: > + description: > + Optional interrupt names, can be used to specify a separate > + dedicated wake-up interrupt > + items: > + -const: irq > + -const: wakeup Also need a space after '-'. > > label: > description: Descriptive name of the key. > @@ -130,6 +140,9 @@ examples: > label = "GPIO Key UP"; > linux,code = <103>; > gpios = <&gpio1 0 1>; > + interrupts-extended = <&intc_wakeup 0 IRQ_TYPE_LEVEL_HIGH>; > + interrupt-names = "wakeup"; That's not what your schema allows. You need: minItems: 1 items: - enum: [ irq, wakeup ] - const: wakeup (repeating 'wakeup' is disallowed globally for ".*-names".) > + wakeup-source; Of course with this, a single interrupt is the wake-up source and doesn't need a name. So you could define that 'interrupt-names' is only used when there are 2 interrupts. In that case, the schema is right and the example is wrong. Rob
* Rob Herring <robh@kernel.org> [230811 15:10]: > On Fri, Aug 11, 2023 at 02:04:31PM +0300, Tony Lindgren wrote: > > Allow configuring optional dedicated wakeirq that some SoCs have. > > Let's use the interrupt naming "irq" and "wakeup" that we already have > > in use for some drivers and subsystems like i2c. > > > > Signed-off-by: Tony Lindgren <tony@atomide.com> > > --- > > .../devicetree/bindings/input/gpio-keys.yaml | 15 ++++++++++++++- > > 1 file changed, 14 insertions(+), 1 deletion(-) > > > > diff --git a/Documentation/devicetree/bindings/input/gpio-keys.yaml b/Documentation/devicetree/bindings/input/gpio-keys.yaml > > --- a/Documentation/devicetree/bindings/input/gpio-keys.yaml > > +++ b/Documentation/devicetree/bindings/input/gpio-keys.yaml > > @@ -31,7 +31,17 @@ patternProperties: > > maxItems: 1 > > > > interrupts: > > - maxItems: 1 > > + description: > > + Optional interrupts if different from the gpio interrupt > > + maxItems: 2 > > + > > + interrupt-names: > > + description: > > + Optional interrupt names, can be used to specify a separate > > + dedicated wake-up interrupt > > + items: > > + -const: irq > > + -const: wakeup > > Also need a space after '-'. Oops sorry about that, obviously I did not run make dtbs_check on this binding. I guess I just grepped so we don't have interrupt-names in use right now. > > > > label: > > description: Descriptive name of the key. > > @@ -130,6 +140,9 @@ examples: > > label = "GPIO Key UP"; > > linux,code = <103>; > > gpios = <&gpio1 0 1>; > > + interrupts-extended = <&intc_wakeup 0 IRQ_TYPE_LEVEL_HIGH>; > > + interrupt-names = "wakeup"; > > That's not what your schema allows. You need: > > minItems: 1 > items: > - enum: [ irq, wakeup ] > - const: wakeup > > (repeating 'wakeup' is disallowed globally for ".*-names".) OK > > + wakeup-source; > > Of course with this, a single interrupt is the wake-up source and > doesn't need a name. So you could define that 'interrupt-names' is only > used when there are 2 interrupts. In that case, the schema is right and > the example is wrong. OK. So here's what gpio-keys currently allows: 1. gpios property with no interrupt in the dts, the driver tries to find the interrupt based on the gpio 2. gpios property with one interrupts property and no interrupt-names And here's what we could allow in the binding with the wakeirq support added: 1. gpios property with no interrupt in the dts, the driver tries to find the interrupt based on the gpio 2. gpios property with one interrupts property and no interrupt-names 3. gpios property with one interrupts property and interrupt-names = "irq" 4. gpios property with one wakeirq and interrupt-names = "wakeirq", the driver tries to find the io interrupt based on the gpio 5. gpios property with two interrupts and interrupt-names = "irq", "wakeirq" So yeah we could only allow interrupt-names if there are two interrupts like the attempted binding has. This would leave out #3 and #4 options above. No need to limit these options from driver point of view though. Any preferences on what the binding should have? Regards, Tony
diff --git a/Documentation/devicetree/bindings/input/gpio-keys.yaml b/Documentation/devicetree/bindings/input/gpio-keys.yaml --- a/Documentation/devicetree/bindings/input/gpio-keys.yaml +++ b/Documentation/devicetree/bindings/input/gpio-keys.yaml @@ -31,7 +31,17 @@ patternProperties: maxItems: 1 interrupts: - maxItems: 1 + description: + Optional interrupts if different from the gpio interrupt + maxItems: 2 + + interrupt-names: + description: + Optional interrupt names, can be used to specify a separate + dedicated wake-up interrupt + items: + -const: irq + -const: wakeup label: description: Descriptive name of the key. @@ -130,6 +140,9 @@ examples: label = "GPIO Key UP"; linux,code = <103>; gpios = <&gpio1 0 1>; + interrupts-extended = <&intc_wakeup 0 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "wakeup"; + wakeup-source; }; key-down {