From patchwork Wed Nov 29 11:06:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 171244 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a5a7:0:b0:403:3b70:6f57 with SMTP id d7csp260134vqn; Wed, 29 Nov 2023 03:07:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IERfOSTwglqs8aj/IXb2XgqFI8mtZhkgUXXGSaTX0tr2q7gvgYPz+hGUzqSKTcvHoMjicgU X-Received: by 2002:a05:6808:11c5:b0:3b8:4164:5fe0 with SMTP id p5-20020a05680811c500b003b841645fe0mr21295001oiv.37.1701256028068; Wed, 29 Nov 2023 03:07:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701256028; cv=none; d=google.com; s=arc-20160816; b=KxwPtIOqVHc8JS+C6bPPSFwdO6zJXqxmyjyk8TDlm5FYuZQKvBCLsb11hg0/KTY8WT 3+UhoZdjDfXP9nNhul+iWX72fEQ9ngeyYJpILzbhhfh51o7O6F5CcjgBSWmPQX5gFlnJ dwcbdy1O/PFvgsO4cXwxzLsIVnQ+D8m42vP29s9JWfM3K73Q5A/rDVS/K3ByCp6bw3/9 /2F7YlzekgqZMVMpLmtWUhPfbXgfmMxkWbtF0Hfdi5iLQG1ECaUQ8fgkFDOe/Axj85by JLArRxNB1JcPFVBeE5h6VYrxLSBDV/u+CHfR79ETu5ja1D2moWTddQ3+x6BbRxN6L9Z7 6OFA== 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:dkim-signature; bh=HXdKCTDzhNjN5oYh4jL58CEo8yT4ZiYH2SSxSmfjokk=; fh=dnazboxc2+4VnUw60BCA3/ZZfU7FmDRN46ma+A61wJU=; b=Sbbnp2DOeyLiVCnk/Wl07s4NjZuVz7otVEoczGr1MwG/j65aE4/Hfv5fCZRMOxS6ew jE75QnrJE1wtP0Q/QPjhIiGk9NaarlLlqtZiu/60XSmRALwNsX9TNTt+abHQjB50sRAN ajyN8EMtqy9XyqGdB3XgKVCGmKFbLX4lLc6SFgAhpijbPQo5ywxtV2KVJzjagRw4pdo0 BBhxCmv1eBfLmxYkoxBC9wb04TzBTURx0XMnA/l4wPSdVVdBERPNx0G9d0yHi4A+2UoM 6qvkTFXmv7ZDQx/VaA3MrR2yjOg6RTKA8pDWY/lD1uXxgL3BRUgK1krDKz4MpSmww9u/ hY3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@atomide.com header.s=25mailst header.b=uP89EbkW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id z11-20020a65610b000000b005b90af1943asi13946467pgu.807.2023.11.29.03.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 03:07:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=fail header.i=@atomide.com header.s=25mailst header.b=uP89EbkW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 89570808E561; Wed, 29 Nov 2023 03:07:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230350AbjK2LGx (ORCPT + 99 others); Wed, 29 Nov 2023 06:06:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231139AbjK2LGv (ORCPT ); Wed, 29 Nov 2023 06:06:51 -0500 Received: from mail5.25mail.st (mail5.25mail.st [74.50.62.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35DF11707; Wed, 29 Nov 2023 03:06:57 -0800 (PST) Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id 9F559603F4; Wed, 29 Nov 2023 11:06:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1701256016; bh=NNHh2O5OrEdJoEBrrlI3WR9bFXRtApPJeE2ytpFLV9w=; h=From:To:Cc:Subject:Date:From; b=uP89EbkW275ztvlvlbHJF/Zw4iYhKc3OhWAg+t9RQxbOGa/OGj7uEujUi0HqiBSyH KH+3h/IhCI/tTDmBR+OXHHuUiN6Zy35cT8y5fPId5O/LY7nPfX6zN4kaq6bJgIKrF3 PLAXkn8yLhh8eDuG3I6V55ZB6vo8BDa6dVVGEhQYVCRndNBZAQo4CY7teV2ePrS9E/ CIgKhugRNe0XrzTaTLSUzpYdrgdKO893kXRz4Jp0rQFfnLBM/eEFHA7qGKa2vWt4S8 d+t+8LfQkxSB+vjz1l1gzx9fpGd1UjDedas5MzpAzFVQIwSPAk5MM06FAcKvc91KBC /W88r/cgvOMWw== From: Tony Lindgren To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Rob Herring , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 1/2] dt-bindings: input: gpio-keys: Allow optional dedicated wakeirq Date: Wed, 29 Nov 2023 13:06:14 +0200 Message-ID: <20231129110618.27551-1-tony@atomide.com> X-Mailer: git-send-email 2.42.1 MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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]); Wed, 29 Nov 2023 03:07:03 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783896240750876728 X-GMAIL-MSGID: 1783896240750876728 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; + }; }; ...