From patchwork Fri Nov 24 08:32:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 13467164 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 33AF6C61DF4 for ; Fri, 24 Nov 2023 08:33:41 +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:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+9QzmUafbaF+UqNOYF4z94u1gCNADH9MYqH2JiNjoF0=; b=0qYGVJNTuv55cj o6pTlXAvK4myNQYlnheT9W/8sFGaDKRZxXQ+KrV4rxcu8cOv+0XzLEl2Xk5U69cZF6+CovNLczQ+R ErF21Gdb41vzk/db0+8JLNtBNFMVyjFqw6pw1XUtKAwCPZgkk7ffNq+6X2dYjS/+fj2VfJOuWJWcp YGSK1rWaII6lu5UymzKYdIQ4OmUC4YEw+p8oz+1Gmh2uSwgp6I5a+pLNqD4+HsiWfHUVTYHMgDy4x YCG+ORH63O1Sgm8h4uJtysrkeH/gxUBgFvq/8jVDU1o30Ca1OC3q7tnUwKHlV8neyAAD43tc4M2Io trEoV3QIAJVpzoSiPJEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r6Rcf-006WlM-1g; Fri, 24 Nov 2023 08:33:13 +0000 Received: from mail5.25mail.st ([74.50.62.9]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r6Rcd-006Wk8-0C for linux-arm-kernel@lists.infradead.org; Fri, 24 Nov 2023 08:33:12 +0000 Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id 39105604D9; Fri, 24 Nov 2023 08:32:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1700814785; bh=oc5QObzNqZ6ec/CF9WZjU1D5oF0mTVvADtYPYp3eBdI=; h=From:To:Cc:Subject:Date:From; b=uMDyMWU9pWym1SFSgyIgZOBtA9Sw5Ezj/YwGrV+DN3ITLIVBFNL/Hh00U4cmdg0Zf EJUUmwo8ahgk7sylUyldt2Shr9mt0ih63LoEErsH7VuaDCmOCE4JjH5hDnbpXaMmfq VPXktfl09EllDs/K9Fq40DpwIW6iPo4GVSRGAWNjoapLgleuInAx59KJxFwPx4jVx1 nWotJnYZBHE1mxt9YDaiWPWzMXEEG6TeKp8SWcMS7Fqyq0/SEAoHjUrJqC0ASfvuoo IFnbBtKVkQ64S4kCAzitgxQZLFpbhoU7/Bi8Rm6WX+Epdp/mm1r5XkGwLqLA9bymx4 8vsQkv6lvnVbw== From: Tony Lindgren To: Dmitry Torokhov Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rob Herring Subject: [PATCH v4 1/2] dt-bindings: input: gpio-keys: Allow optional dedicated wakeirq Date: Fri, 24 Nov 2023 10:32:40 +0200 Message-ID: <20231124083241.40780-1-tony@atomide.com> X-Mailer: git-send-email 2.42.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231124_003311_512330_D9B3794F X-CRM114-Status: GOOD ( 15.54 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Allow configuring an optional dedicated wakeirq for gpio-keys that some SoCs have. Let's use the common interrupt naming "irq" and "wakeup" that we already have in use for some drivers and subsystems like i2c framework. Note that the gpio-keys interrupt property is optional. If only a gpio property is specified, the driver tries to translate the gpio into an interrupt. Reviewed-by: Rob Herring Signed-off-by: Tony Lindgren --- No changes since v3 Changes since v2: - Fix indentation as noted by Rob's bot - Add Reviewed-by from Rob Changes since v1: - Run make dt_binding_check on the binding - Add better checks for interrupt-names as suggested by Rob, it is now required if two interrupts are configured - Add more decription entries - Add a new example for key-wakeup .../devicetree/bindings/input/gpio-keys.yaml | 41 ++++++++++++++++++- 1 file changed, 40 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,23 @@ patternProperties: maxItems: 1 interrupts: - maxItems: 1 + oneOf: + - items: + - description: Optional key interrupt or wakeup interrupt + - items: + - description: Key interrupt + - description: Wakeup interrupt + + interrupt-names: + description: + Optional interrupt names, can be used to specify a separate dedicated + wake-up interrupt in addition to the gpio irq + oneOf: + - items: + - enum: [ irq, wakeup ] + - items: + - const: irq + - const: wakeup label: description: Descriptive name of the key. @@ -97,6 +113,20 @@ patternProperties: - required: - gpios + allOf: + - if: + properties: + interrupts: + minItems: 2 + required: + - interrupts + then: + properties: + interrupt-names: + minItems: 2 + required: + - interrupt-names + dependencies: wakeup-event-action: [ wakeup-source ] linux,input-value: [ gpios ] @@ -137,6 +167,15 @@ examples: linux,code = <108>; interrupts = <1 IRQ_TYPE_EDGE_FALLING>; }; + + key-wakeup { + label = "GPIO Key WAKEUP"; + linux,code = <143>; + interrupts-extended = <&intc 2 IRQ_TYPE_EDGE_FALLING>, + <&intc_wakeup 0 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "irq", "wakeup"; + wakeup-source; + }; }; ...