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: 169282 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp1005856vqx; Fri, 24 Nov 2023 00:39:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IE3CI+LfS3cRtkRlIQ1mcZRoNUCbxzSZhdtj3J3LJy++5CRVUPeMrmQ3LTgWXCJh2dESLri X-Received: by 2002:a05:6808:19a4:b0:3ac:aae1:6d64 with SMTP id bj36-20020a05680819a400b003acaae16d64mr2704013oib.2.1700815162675; Fri, 24 Nov 2023 00:39:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700815162; cv=none; d=google.com; s=arc-20160816; b=W4rJBtP9kCsVjsF2WL5XevR3XNC70T7WC2h5pjvWQ+v4vaYDVCrBKGKv+yUlhzb7XE ZgQgmsrsgT0E2vpxLKFDhEhARFrkRYWhkLUd5FXjy2rccwLF1GuJn6x8yPumXcX7/Rqy azXbRQ8CdZiFuPDxefZBeSGbCHp/AWIweuGrnUzCsldsj6/ROZTbidFII0IBP/TP5pk9 o0RoQmbONAtTp9KvfaFAAanR84NM5vKPm5Zw83NXcEYPn+9DANkGiFB1bMUsFYqOyQdv wCV6DzDKDggHGQlOz9dO3nHwZckRn9nqO1u0AnmLlSuxB0OKxzw0UHg14IYB1PG79r9L bM1w== 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=3rcLDOGhU7lD5GEAtnDSmkKil99OBM9/4d3rZunHPTY=; fh=j+LuT0CTcySy3NN47RMMrgqUFjRUe42CPyHC6nZaXcM=; b=U2bSRPtJMHX2oBb6UyLw+DMWtU8DFVA/7OMm4TP1ULOTsqBa7z3CxV7G9aU99t1Ipv XG12YsothmAuGEv82g8gGRATMBT6UZB5aMDkdGj+A9vuLg64PCL3ffgE0pRPo3AfhLoF AYw6ZxJd9ozG347n9I6Ww2MNTGE/RvlH9pUNhh7Zr6nLN7jJ5uk8AFH4qYSwUnPe5UV+ iJiqiZQ3DgSTWanTyRmRCmXO07o7gTgP1bSZI2NZf4Wdy53CkSDIzgrwVBacTre6YPMJ IhNjbQn6DcCjkej4628HF4dKjUn/xOPUrSCiJgtYrnIgTsrz2TEScouAaeUUWDqPQf1N Vwpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@atomide.com header.s=25mailst header.b=uMDyMWU9; 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id bq11-20020a056a02044b00b005c1cd418245si3477735pgb.737.2023.11.24.00.39.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 00:39:22 -0800 (PST) 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; dkim=fail header.i=@atomide.com header.s=25mailst header.b=uMDyMWU9; 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 D308381E3E28; Fri, 24 Nov 2023 00:39:18 -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 S1344808AbjKXIjJ (ORCPT + 99 others); Fri, 24 Nov 2023 03:39:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbjKXIjH (ORCPT ); Fri, 24 Nov 2023 03:39:07 -0500 Received: from mail5.25mail.st (mail5.25mail.st [74.50.62.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09A121BD; Fri, 24 Nov 2023 00:39:13 -0800 (PST) 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 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]); Fri, 24 Nov 2023 00:39:19 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783433959700882275 X-GMAIL-MSGID: 1783433959700882275 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; + }; }; ...