Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1690075rdh; Mon, 25 Sep 2023 23:49:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEPlPpO0D4TC1LrhxBICmFPq7pu7gtp3glaa7CEFy7POQVm03LyoYCah3UZRkWJBKz1TZ4O X-Received: by 2002:a05:6870:2429:b0:1bb:6485:7988 with SMTP id n41-20020a056870242900b001bb64857988mr11105403oap.35.1695710996802; Mon, 25 Sep 2023 23:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695710996; cv=none; d=google.com; s=arc-20160816; b=vVA2ljtOTkjabMfLNLFKMKpmBa+ufBS1LOB71rN+8FV6GPKAxa/yVerOkFwLKhnyE7 CbBPvuB/SxK0016n6bopgS2MYQ1eFwCJ51wvvBaEZQXv4Ty59g46y19TacpYlgrG0H1/ ZgEeFhscL0h1BxiUi6qC/hMjjFaLO859gnNwWXS1sgpuvAwvz+nh4PVpg1mywJj19hVV watJAD7IblA0EuiE1Mt1b80Fc/au3w/0F7t0NKTOoFhRxwhj8MZfSANIv8eiNmHBU+2J d3A8qOgBiDOZc4PJtu3/EesFmpOhz3PZ01SoVSh493oOkPh602sv76IX5Je6aTUFE7hf 6qXw== 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=J8KwLoKlOnTsn10YfSnNgwUVHULzKYsOBCvOaGeqZ90=; fh=j+LuT0CTcySy3NN47RMMrgqUFjRUe42CPyHC6nZaXcM=; b=mcEoe7SK9oiCC/G9NCBLKlGPM2gOQhOS0a5LLWcIOZJgy+uFWIizx8SZpfYxhjmReJ G1sPsfTHxMkFkWwLCf4IHLw/7vUxev699M2WC5YHmQ+mvDy+vz8U5gH2z+BPFSe51Yuu H0VP9YQmSj1qdIbxQQ2NfnGbpNtrFzSYD1wsojQt64p37TBZ7cDt7aIWQBYFny4zbIMA d2tYRbMgh26u5eA4hfYAHfP/hBiqjE1wnZYP29YL1rr/sge5FLfb75+fGd+43ZhyIGSj caiyJs548JzheBJSoZso+1sjn7T5vWmK7w8mULaviWIhrJzZ2LQoP8srbCdJuGcwv2GV BD7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id b17-20020a656691000000b005648d20203dsi12199476pgw.233.2023.09.25.23.49.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 23:49:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 25DB280BEF3C; Mon, 25 Sep 2023 23:38:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233831AbjIZGia (ORCPT + 99 others); Tue, 26 Sep 2023 02:38:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233818AbjIZGi0 (ORCPT ); Tue, 26 Sep 2023 02:38:26 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 818E511D; Mon, 25 Sep 2023 23:38:19 -0700 (PDT) Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id B53DC80A3; Tue, 26 Sep 2023 06:38:17 +0000 (UTC) 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 v3 1/2] dt-bindings: input: gpio-keys: Allow optional dedicated wakeirq Date: Tue, 26 Sep 2023 09:38:08 +0300 Message-ID: <20230926063809.25654-1-tony@atomide.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 25 Sep 2023 23:38:48 -0700 (PDT) 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 --- 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; + }; }; ... -- 2.42.0