From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1EBE4C001B0 for ; Mon, 14 Aug 2023 05:26:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=M5uNrqkguuW5y6+crtGPNgnM/0fE0SOPYdrZq8zLMa8=; b=xJw5qAb5aKxBUW d9lLSrL9H/SxQCZxwnsvc+l94BwsABE1uRAAwGa1blaVv0RsK8skSCJIbjoO1aahDOhg7pN3pkcnH L4mTQm4fnAO7nuSonUJQIc7kMBjs1SMrXqafIglCavolHjBt1y2QETLlpYNopZFghxXvfJWfpxsVF 9y7a6g0Gp3aeDyQe5y749e94Y0DoOPvV4mrXlX0lwQPUqQLlGkn8q+pkv8QF+C2Zu2a18BMCeprZQ waH5oeCK73RgSfRJqyw5qNFs7JlAesebkR5O3cQJg/P2kcH0m1tXnDQKM0r8bdsfqvUEVbslvSbpT UhRimoWfEJmgqdCNId/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qVQ5h-00GC2T-1I; Mon, 14 Aug 2023 05:26:09 +0000 Received: from muru.com ([72.249.23.125]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qVQ5d-00GC1o-2L for linux-arm-kernel@lists.infradead.org; Mon, 14 Aug 2023 05:26:08 +0000 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-Disposition: inline In-Reply-To: <20230811151048.GA3452914-robh@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230813_222605_830214_BA576E8A X-CRM114-Status: GOOD ( 28.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel