Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2363425rdg; Sun, 13 Aug 2023 23:04:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFq0fIqS9IIuvB+zj3MJEMmilAK7dRDUaIpI1q1+mpc5jTPZHvm2R5WX0ivoKDerQhnJDH/ X-Received: by 2002:a17:906:8a6d:b0:99c:ced6:842f with SMTP id hy13-20020a1709068a6d00b0099cced6842fmr6290775ejc.10.1691993041397; Sun, 13 Aug 2023 23:04:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691993041; cv=none; d=google.com; s=arc-20160816; b=bxSInB4tmU4B9ZEErI3V42SsJ59KAonWNPsI++po1KADO438E514mYb+QQ3+6DChn/ soAI+gydp2Pk5Gy2H/hIvE8aevqf8FLE0z/iFkh+BRNHK9DnXGTkFGJ2TfpL7tVNnEZI Z/3XFXzhtClgxzjC1ZaZ08lXKpipBmOma6nnz5CUoAR47QIO+KBAz1gA8cdCFK9Jt6pY Cv9FmxEDx951SNL6C7jjWSsKi2Zb9TwChE0mhIimO3DxOUFkzIJyNbCMMo0qc9pfo0on Ykd6/jLKu1NSqD4jKSIyvgKK+34tkt3kxyowbW6MjCI73yBzChNdgNT7oYLrDNK3iPwZ mQsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=+vy+m5b3Y++4DSZ2TVgFUpiXHjPrzaLS+Zsh+wKOq+s=; fh=XwNYH+RNVZL5SQDquiSmQBMVwgcDEV2IRNKKmqOOgUo=; b=lptu1/NCunlaPqZNSg3mnyiivoFW5zt/bgnhphhrUyFNSjj5G6o5NF1dsgYvY9zY/C QcgcBgIgD5IVPq4ubUoZco7QzuSzFFTiuKfa3vuSnDCQT2RNh4eXAc3cs+WxCzCjoenP MKZRxsp+nvaLw1ZN5ITDrzupHJlFkgBm0srz7B7q7EC2YbLZHVS2Ta6ZKckfDaF+lhxm 4tFIVuBI2FzqvX4u5eQHujSTWrNCU6JDY+7GtkpCj2DPUMbbUMNH2ZV7PgIF374K94fq NpgR1XevYqtgQIS+kw7Pl83Px04VLA+PO/FBRoxbMKsBOCB/Z2Cua7DSm0tNVc9jBKiS 5Vbw== 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 x14-20020a170906710e00b0098dfec24292si7427097ejj.829.2023.08.13.23.03.36; Sun, 13 Aug 2023 23:04:01 -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 S233074AbjHNF0Z (ORCPT + 99 others); Mon, 14 Aug 2023 01:26:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232881AbjHNF0C (ORCPT ); Mon, 14 Aug 2023 01:26:02 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 05F59E77; Sun, 13 Aug 2023 22:26:00 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 0C25D80A0; Mon, 14 Aug 2023 05:26:00 +0000 (UTC) Date: Mon, 14 Aug 2023 08:25:58 +0300 From: Tony Lindgren To: Rob Herring Cc: Dmitry Torokhov , Krzysztof Kozlowski , Conor Dooley , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/2] dt-bindings: input: gpio-keys: Allow optional dedicated wakeirq Message-ID: <20230814052558.GN11676@atomide.com> References: <20230811110432.3968-1-tony@atomide.com> <20230811151048.GA3452914-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230811151048.GA3452914-robh@kernel.org> 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: X-Mailing-List: linux-kernel@vger.kernel.org * Rob Herring [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 > > --- > > .../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