Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1284479rdb; Wed, 20 Sep 2023 05:14:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUB2YtmlAgzY5OzEqVneXGxXtxrcj/9lbg0xQ6rl/4WOOdc79AUitAhdlFuTz9wpWrePnv X-Received: by 2002:a05:6a00:2389:b0:690:c79c:1912 with SMTP id f9-20020a056a00238900b00690c79c1912mr2751916pfc.0.1695212039688; Wed, 20 Sep 2023 05:13:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695212039; cv=none; d=google.com; s=arc-20160816; b=J1GzXKnNZm1nyt1gRJsKT835EZS23XP9PACLZX1h3wCjvWGwDfhtzbK/tahcSbu0GC aEbY4qybHgx2AFJIK5gDEWMZO3rbUuvDx1WmUaLt2CK83frTtEAAf3VUP3K9q6/ZRgnU xpFCXKCAJJgsnIGeoI7jSGSMmzg+iAv0TabepvO4z0FtC/uwGmqFe+Zkh4mrjmci8BNw qMk4CsQ4N9DEAICzIhaS7PLJM/dn2A7CKxz4i1+6rT+TLcadrIVn5yTnoSeYHZUzcRUI 00bI2WowjVXbGXjJhdkBSwieNBSUxxRfzqNQ86uLOkkzV3Xa9v4lc3eNbPi3vov8C6q6 +5gQ== 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=mHdi2C60cwq1WEKC/JrwbJRe1I0svdolwqmda/AQIco=; fh=qNJTVozd0zf7rDe9cmDiIud3XGAhSApqfqoTi+Gdd8I=; b=fIKS49Tb24mnXlhndWocCDLk7HewlIsOhVyGGdt+Ex8e31wH5H1pHoBjGNltXfq5AF EJFcnAmrdZ06yM4Qn+3y/t+IEH8KDJqzYA2YwPwcFCYPsAQ3sqhmXE97kxtZxEvAQYI2 jwTGbHaaoebAW4rnTTQqXPIxGP4utxn/wd9oIvy0/+6D+Lqe/NatKkZCdvP0zFWfB+iQ 5DsWkVG/jfq7qqbsbTBm0zwIo6fboFig+ebbmuLpS9+s7zNDDI2d+C8kJoaxiq16P5MG sjsudO+JE05iMWJi9ijo0YBWIxlwLB6tREtwv+gnB9c1z0llfSfDgRfOkJAmkmvBFCuK JcKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id ds2-20020a056a004ac200b00690d25b1991si2196663pfb.41.2023.09.20.05.13.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 05:13:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 0CB408021E2D; Wed, 20 Sep 2023 04:51:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234685AbjITLu6 (ORCPT + 99 others); Wed, 20 Sep 2023 07:50:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234588AbjITLu5 (ORCPT ); Wed, 20 Sep 2023 07:50:57 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CDE7FA3; Wed, 20 Sep 2023 04:50:51 -0700 (PDT) Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id D4CE980E0; Wed, 20 Sep 2023 11:50:49 +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 Subject: [PATCH v2 1/2] dt-bindings: input: gpio-keys: Allow optional dedicated wakeirq Date: Wed, 20 Sep 2023 14:50:43 +0300 Message-ID: <20230920115044.53098-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 fry.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 (fry.vger.email [0.0.0.0]); Wed, 20 Sep 2023 04:51:09 -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. Signed-off-by: Tony Lindgren --- 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