From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B7672DE6E8 for ; Thu, 3 Jul 2025 08:35:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751531706; cv=none; b=I61oTjDntMDAkhAtoean2GZiqu59UufD5z8NvCe/FCaeZILybu9jvtWJJCaGk6I30PvKstad+nh47zaoSxtdlWkqOItm/JGtHeowLHFs1LfucNkvIfgKFD4W0BhbafeC7LF48p8wWUsgxbF60d6GqtX+wlE9w9Aw+8X7AMZuNI0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751531706; c=relaxed/simple; bh=NT0yQG3sC1VKEvVYPrK/jls25IuUlGbDhx/qzeFhFw8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=X23AbD53Pz4xrQR4SSYcAF3fZysfPcfqvy+mjODY44I+urYsZ0qtrROYmjJVS30molb4VRPlAG9p3i6z6O4jjNSamDsKPT1csboLOY88uCkshxWZB3gJBGacnPoAyHdQtn/mFZGtjkx2r9+EJ37vKewpa97QMda9ROlTOi4o8g8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=mns8X3pX; arc=none smtp.client-ip=209.85.208.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="mns8X3pX" Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-6099d89a19cso10167735a12.2 for ; Thu, 03 Jul 2025 01:35:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1751531703; x=1752136503; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=b2eX30yl7oqdcdrJB3WzZqEr8ZG/CPC8SD+o4qZfKEs=; b=mns8X3pXn78K+Taco4IvfsudjoD2Z1IsAlm/kahzWYNl/veVhEv7VtoJIXKbkU2G9w 3OG50mqMpmYfTjgtF02A60O3pfaNyNa3m05UZ95szpeejwrO+sPYsvR7mpEYkBDjRxsg 8OsOPaoYN0ySmmTjJw/1B+iC3deCHVVJoXv6YlquiF0m/dl07s5ZWRaluTplkw1YhjWI x/qJLLHR13sYevjrKAVEXgtN5G4cZ0N0U33OFJDUcItjMwnAiHQcqD53nhUBsWxBN60j /olV5mfwpNVPlg8MPDO2lvGHSupEe2YWati+7OxAlSktBZQR7WXeHtPEnAZ1eky6ZUmv 6q+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751531703; x=1752136503; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=b2eX30yl7oqdcdrJB3WzZqEr8ZG/CPC8SD+o4qZfKEs=; b=OCdEbP0fpg78d7hT9XDzcyqJWkIlNl6TF12kqUrsibPa3vbNLxWaPnSv7ohJAVD4XS W2MwS2ig2FS8ogntUIIfcL4JMvfmxHfp5+1GCkFNT2PnX+0Lo5gJQuzgVpd0XMPS9XAe VdmSAQKMEs9BsPV3MiM+FIROauGIHbhm+5/dfxCLPiGMO8tEYqoJW9DKqNybbqYhNfAW QSgQ04T9WIY+QlqWWdfG7O680Czcg39BxKseDkvLRk1g7gPZBURgY9Bxj0W7N2cVKFKw dBV5/x8efdVusU32Ub50uJf54T5rKZ+pKAzldziWdde+ViTBoS5XnPqMUobb8oRWJxC6 abFg== X-Forwarded-Encrypted: i=1; AJvYcCVSBgnv9b9op00DNIul6//qoIqU+l0u5wn8LbA3Kzy+cpx9G/OdOpIrHhLTcHH4b1T6O5bVdUGNJ2wE@vger.kernel.org X-Gm-Message-State: AOJu0YxubS7ihgHK0Xk35DvbbjQIxXlRr7a13BJYMz3K2uZFJnd9uvWn WIfz0wSX/+LYcJ1yivt3+m2FtuDUY+EWtXWWdMngx7Q6gj+e02iW/Qp4XZZUHjBiNCE= X-Gm-Gg: ASbGncs4E5NW7VwGtChLVM+ZXvayT89O8mSGCkAsqv6idSpoW137chPMkkxXO0xqg8Q CBFdgYyTV/zoBIQlgl8Do/2U2dh1SDEDXjeCYb3jk0JquxgXyXyrNXxcA9jrdhzqYT+hDLnUvt1 G3+mRGvi2AtfAs9WqhKa4SxExFtgd8NNWxaV87vCZ+QhCJODtAH2X+2uX9WdQMv0XHr8/Ad417t uZmXj/bINnZ4di2jcOLp7RAyGNJvzkVH1VmCOcIdWjqsJ5HnKqARNkrPdliBhwUPfDaIqlnhS02 RfNxINpLP41nCg7zxh7hmTrZJJCVjXxLAqXRNVpnPmUWlt2uBf6eMkTz/3ynRxm+Tr0I8Q== X-Google-Smtp-Source: AGHT+IF/Y2iFli3knmF19jiiLfqcT8/gMSbL/8+pT+jQ7QFuTg1qr/h5I1xoan1atXKvMNyhdeJAjw== X-Received: by 2002:a05:6402:51d2:b0:606:f836:c656 with SMTP id 4fb4d7f45d1cf-60e52d01efamr5862235a12.19.1751531702333; Thu, 03 Jul 2025 01:35:02 -0700 (PDT) Received: from [192.168.50.4] ([82.78.167.83]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-60c8319b155sm10376216a12.52.2025.07.03.01.35.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Jul 2025 01:35:01 -0700 (PDT) Message-ID: Date: Thu, 3 Jul 2025 11:35:00 +0300 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] arm64: dts: renesas: r9a09g047e57-smarc: Add gpio keys To: Biju Das , Geert Uytterhoeven Cc: Magnus Damm , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "linux-renesas-soc@vger.kernel.org" , "devicetree@vger.kernel.org" , Prabhakar Mahadev Lad , "biju.das.au" References: <20250414153818.214811-1-biju.das.jz@bp.renesas.com> <25a4e9bc-4c96-4c9c-880f-e67223662f56@tuxon.dev> From: Claudiu Beznea Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, Biju, On 03.07.2025 10:42, Biju Das wrote: > Hi Claudiu, > >> -----Original Message----- >> From: Claudiu Beznea >> Sent: 03 July 2025 08:17 >> Subject: Re: [PATCH] arm64: dts: renesas: r9a09g047e57-smarc: Add gpio keys >> >> Hi, Biju, >> >> On 01.07.2025 17:38, Biju Das wrote: >>> Hi Geert, >>> >>>> -----Original Message----- >>>> From: Geert Uytterhoeven >>>> Sent: 01 July 2025 12:50 >>>> Subject: Re: [PATCH] arm64: dts: renesas: r9a09g047e57-smarc: Add >>>> gpio keys >>>> >>>> Hi Biju, >>>> >>>> On Tue, 1 Jul 2025 at 13:40, Biju Das wrote: >>>>>> From: Geert Uytterhoeven On Mon, 14 Apr 2025 >>>>>> at 17:38, Biju Das wrote: >>>>>>> RZ/G3E SMARC EVK has 3 user buttons called USER_SW1, USER_SW2 and >>>>>>> USER_SW3. Add a DT node in device tree to instantiate the >>>>>>> gpio-keys driver for these buttons. >>>>>>> >>>>>>> Signed-off-by: Biju Das >>>> >>>>>>> --- a/arch/arm64/boot/dts/renesas/renesas-smarc2.dtsi >>>>>>> +++ b/arch/arm64/boot/dts/renesas/renesas-smarc2.dtsi >>>>>>> @@ -12,8 +12,13 @@ >>>>>>> * SW_SDIO_M2E: >>>>>>> * 0 - SMARC SDIO signal is connected to uSD1 >>>>>>> * 1 - SMARC SDIO signal is connected to M.2 Key E connector >>>>>>> + * >>>>>>> + * GPIO keys are enabled by default. Use PMOD_GPIO macros to >>>>>>> + disable them >>>>>>> + * if needed. >>>>>>> */ >>>>>>> >>>>>>> +#include >>>>>>> + >>>>>>> / { >>>>>>> model = "Renesas RZ SMARC Carrier-II Board"; >>>>>>> compatible = "renesas,smarc2-evk"; @@ -27,6 +32,31 @@ >>>>>>> aliases { >>>>>>> serial3 = &scif0; >>>>>>> mmc1 = &sdhi1; >>>>>>> }; >>>>>>> + >>>>>>> + keys: keys { >>>>>>> + compatible = "gpio-keys"; >>>>>>> + >>>>>>> + key-1 { >>>>>>> + interrupts-extended = <&pinctrl KEY_1_GPIO >>>>>>> + IRQ_TYPE_EDGE_FALLING>; >>>>>> >>>>>> So you are using them as interrupts. Don't you need to configure >>>>>> pin control for that (function 15 = IRQ14)? >>>>> >>>>> The same pin can be configured as TINT or IRQ15, currently it is configured as TINT IRQ. >>>>> Is it ok? >>>> >>>> OK. >>>> >>>>>> Alternatively, can't you use them as gpios with interrupt facilities? >>>>> >>>>> interrupts-extended = <&pinctrl KEY_1_GPIO IRQ_TYPE_EDGE_FALLING>; >>>>> >>>>> The TINT IRQ will provide the same right? Am I missing anything here? >>>> >>>> When you use interrupts directly, the system will detect only key >>>> presses, and fake (timer-based) key releases. >>>> When you use GPIOs with interrupt-capability, the system can detect both key presses and releases. >>>> >>>> See also commit cab3511ea7a0b1fc ("ARM: dts: marzen: Add slide switches"). >>> >>> As per [1], for GPIOs with interrupt-capability, IRQ controller needs to support both edges. >>> But TINT supports Rising or Falling edge, but not both. So, we cannot use this. >> >> If I clearly understand it, this has been solved on RZ/G3S SMARC Carrier-II by defining these pins as >> gpio hogs: >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/renesas/rz >> g3s-smarc.dtsi#n141 > > Looks like it is redundant, you may need to take out the gpio hog node as > pinctrl driver already configure the pin as input pin[1]. The pinctrl support wasn't there at the moment gpio hog was introduced. > > As per [2], still it is not GPIOs with interrupt-capability. OK, the I must have been wrong. I haven't looked in deep over this thread. Sorry for the noise, Claudiu > > [1] > https://elixir.bootlin.com/linux/v6.16-rc4/source/drivers/pinctrl/renesas/pinctrl-rzg2l.c#L2534 > [2] > https://elixir.bootlin.com/linux/v6.16-rc4/source/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi#L30 > > > Cheers, > Biju