From patchwork Mon Mar 20 16:33:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13181582 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 732C4C6FD1D for ; Mon, 20 Mar 2023 16:34:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=8mX7XXtmxEmUhq18ub9vJWi7mVeV8MdundRVUo6G1cE=; b=qYk/N9APJnJHSG 5Wt5Y5C0La4fRrWBCTQo/aRX4/OPPy5qF782v/bXP89Xdw8BDitTYJsCMdFl1SwVXh0cKWQbUkEU3 ZtdK8Wb1FflCAFuXCH8ivMd5+wNDpfGQcrons2n6ZxfJd013V6cNUTR0+tDOb+UppYRqfTOEStkiv uz1GjkqziPtgwtTeIlyHNyT0B48ktZJ8QY3MWD7Oa4AEac9D7kRIDHVGyBWt0fKCOEtDaCdMs7Zwm SvLdUifvJ416kl558pZZypxmgTUJ57S/3cVKI9xp5PMOZlyQNrjHiM8iUe5C/KrMT2J+kCqdN0BE/ zAwssf+yxMPM9y4rU0ow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peIRx-009nT9-1j; Mon, 20 Mar 2023 16:33:33 +0000 Received: from baptiste.telenet-ops.be ([2a02:1800:120:4::f00:13]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1peIRr-009nQ5-1B for linux-arm-kernel@lists.infradead.org; Mon, 20 Mar 2023 16:33:31 +0000 Received: from ramsan.of.borg ([84.195.187.55]) by baptiste.telenet-ops.be with bizsmtp id agZP2900A1C8whw01gZPd8; Mon, 20 Mar 2023 17:33:23 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1peIR8-00E2vb-PL; Mon, 20 Mar 2023 17:33:23 +0100 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1peIRn-007SWm-JF; Mon, 20 Mar 2023 17:33:23 +0100 From: Geert Uytterhoeven To: Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Geert Uytterhoeven Subject: [PATCH] ARM: dts: marzen: Add slide switches Date: Mon, 20 Mar 2023 17:33:22 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230320_093327_546909_7A448C79 X-CRM114-Status: GOOD ( 12.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Describe the four General Purpose Switches on the Marzen development board, so they can be used for user input and/or for wake-up from s2ram. The GPIO block on R-Car H1 does not support triggering interrupts on both edges of a changing input signal, hence one cannot use gpio-keys with gpios properties. Instead, one of two alternatives needs to be used: 1. Use gpio-keys with interrupts instead of gpios properties, at the expense of receiving only key presses (release events will be auto-generated), 2. Use gpio-keys-polled with gpios properties, at the expense of making these keys unusable as wake-up sources. As the DTS for the Marzen development board serves mainly as an example, the approach taken is to use the first alternative for the first two switches, and the second alternative for the last two switches. Signed-off-by: Geert Uytterhoeven --- For proper operation, this depends on "[PATCH] pinctrl: renesas: r8a7779: Add bias pinconf support" https://lore.kernel.org/r/dd966cfc916ef881051ec53bc3393dce7eea8e03.1679328215.git.geert+renesas@glider.be To be queued in renesas-devel-for-v6.4. arch/arm/boot/dts/r8a7779-marzen.dts | 63 ++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/arch/arm/boot/dts/r8a7779-marzen.dts b/arch/arm/boot/dts/r8a7779-marzen.dts index 5f05f2b44a481669..60c9c4b7faa151f4 100644 --- a/arch/arm/boot/dts/r8a7779-marzen.dts +++ b/arch/arm/boot/dts/r8a7779-marzen.dts @@ -9,6 +9,7 @@ /dts-v1/; #include "r8a7779.dtsi" #include +#include #include / { @@ -66,6 +67,51 @@ ethernet@18000000 { vdd33a-supply = <&fixedregulator3v3>; }; + keyboard-irq { + compatible = "gpio-keys"; + + pinctrl-0 = <&keyboard_irq_pins>; + pinctrl-names = "default"; + + interrupt-parent = <&gpio0>; + + key-1 { + interrupts = <17 IRQ_TYPE_EDGE_FALLING>; + linux,code = ; + label = "SW1-1"; + wakeup-source; + debounce-interval = <20>; + }; + key-2 { + interrupts = <18 IRQ_TYPE_EDGE_FALLING>; + linux,code = ; + label = "SW1-2"; + wakeup-source; + debounce-interval = <20>; + }; + }; + + keyboard-gpio { + compatible = "gpio-keys-polled"; + poll-interval = <50>; + + pinctrl-0 = <&keyboard_gpio_pins>; + pinctrl-names = "default"; + + key-3 { + gpios = <&gpio0 19 GPIO_ACTIVE_LOW>; + linux,code = ; + label = "SW1-3"; + debounce-interval = <20>; + }; + key-4 { + gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; + linux,code = ; + label = "SW1-4"; + debounce-interval = <20>; + }; + }; + leds { compatible = "gpio-leds"; led2 { @@ -161,6 +207,14 @@ endpoint { }; }; +&gpio0 { + keyboard-irq-hog { + gpio-hog; + gpios = <17 GPIO_ACTIVE_LOW>, <18 GPIO_ACTIVE_LOW>; + input; + }; +}; + &irqpin0 { status = "okay"; }; @@ -223,6 +277,15 @@ hspi0_pins: hspi0 { groups = "hspi0"; function = "hspi0"; }; + + keyboard_irq_pins: keyboard-irq { + pins = "GP_0_17", "GP_0_18"; + bias-pull-up; + }; + keyboard_gpio_pins: keyboard-gpio { + pins = "GP_0_19", "GP_0_20"; + bias-pull-up; + }; }; &sata {