From patchwork Tue Sep 26 06:38:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 144745 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp1715357vqu; Mon, 25 Sep 2023 23:47:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGfn+aop6T5Y4Lqenjr9IE4vGNVD3LFu+/rG+OnDXKqTx7nv21+xpW6wXa5UC6yhFHEiqPE X-Received: by 2002:a05:6358:2796:b0:140:f08b:4f35 with SMTP id l22-20020a056358279600b00140f08b4f35mr9139848rwb.21.1695710860381; Mon, 25 Sep 2023 23:47:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695710860; cv=none; d=google.com; s=arc-20160816; b=xLokrp1dMUyxSEQUga80Iqdh9m0+DqiDIFwBkRVeBAZN0S2LoKkw+sTvA0SbSnAcWD SOBATRmbOQfHycwWAth/YZtGbm4C1/TJ/t/JHBfslNl3VEgO0iULRV9LxgYosQwVPU0v i0C2HJDOa49pBNMfQj58FyYE3TEIwep/cbOTL/H5lbBoDlukXU5nCH9Qm1eFxqhI6B3j pLRHAgpDoyzWFZhU30MyOWkT0L4lM2hj7g2W8clZVKPdiXqll0O7A6+uS9A1pEK9BsJP O2nhqOceAskp6v/g3o70pdaXaorpZbpEL6hMBhGEAh5hStStUdOSdbmAkBSLg3b7bNO0 RZrQ== 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 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id m68-20020a633f47000000b00584b6c0d62csi1012749pga.356.2023.09.25.23.47.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 23:47:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id AED7180CF556; Mon, 25 Sep 2023 23:38:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233824AbjIZGia (ORCPT + 27 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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 25 Sep 2023 23:38:31 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778081711391528246 X-GMAIL-MSGID: 1778081711391528246 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; + }; }; ...