From: "Heiko Stübner" <heiko@sntech.de>
To: Daniel Semkowicz <dse@thaumatec.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Quentin Schulz <quentin.schulz@cherry.de>
Cc: Dragan Simic <dsimic@manjaro.org>,
Farouk Bouabid <farouk.bouabid@theobroma-systems.com>,
Quentin Schulz <quentin.schulz@theobroma-systems.com>,
Vahe Grigoryan <vahe.grigoryan@theobroma-systems.com>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org
Subject: Re: [PATCH] arm64: dts: rockchip: Add power button for RK3399 Puma
Date: Mon, 30 Sep 2024 11:21:42 +0200 [thread overview]
Message-ID: <2221314.irdbgypaU6@diego> (raw)
In-Reply-To: <5f73e2cf-cb18-4b65-9e42-cf3192aee706@cherry.de>
Am Montag, 30. September 2024, 11:11:56 CEST schrieb Quentin Schulz:
> Hi Heiko,
>
> On 9/30/24 10:49 AM, Heiko Stübner wrote:
> > Hey Quentin, Daniel,
> >
> > Am Donnerstag, 26. September 2024, 14:34:30 CEST schrieb Quentin Schulz:
> >> On 9/25/24 9:28 AM, Daniel Semkowicz wrote:
> >>> There is a PWRBTN# input pin exposed on a Q7 connector. The pin
> >>> is routed to a GPIO0_A1 through a diode. Q7 specification describes
> >>> the PWRBTN# pin as a Power Button signal.
> >>> Configure the pin as KEY_POWER, so it can function as power button and
> >>> trigger device shutdown.
> >>> Add the pin definition to RK3399 Puma dts, so it can be reused
> >>> by derived platforms, but keep it disabled by default.
> >>>
> >>> Enable the power button input on Haikou development board.
> >>>
> >>> Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
> >>
> >> This works, thanks.
> >>
> >> Tested-by: Quentin Schulz <quentin.schulz@cherry.de>
> >>
> >> Now I have some questions I wasn't able to answer myself, maybe someone
> >> can provide some feedback on those :)
> >>
> >> We already have a gpio-keys for buttons on Haikou, c.f.
> >> https://elixir.bootlin.com/linux/v6.11/source/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts#L22.
> >> Those signals are directly routed to the SoM and follow the Qseven standard.
> >>
> >> The same applies to PWRBTN# signal.
> >>
> >> However, here we have one gpio-keys for PWRBTN# in Puma DTSI and one
> >> gpio-keys for the buttons and sliders on Haikou devkit in Haikou DTS.
> >>
> >> I'm a bit undecided on where this should go.
> >>
> >> Having all button/slider signals following the Qseven standard in Puma
> >> DTSI and enable the gpio-keys only in the devkit would make sense to me,
> >> so that other baseboards could easily make use of it. However, things
> >> get complicated if the baseboard manufacturer decides to only implement
> >> **some** of the signals, for which we then need to remove some nodes
> >> from gpio-keys (and pinctrl entries) since gpio-keys doesn't check the
> >> "status" property in its child nodes (though that could be fixed). At
> >> which point, it's not entirely clear if having it in Puma DTSI is
> >> actually beneficial.
> >>
> >> Someone has an opinion/recommendation on that?
> >
> > I guess from a platform perspective nobody really cares, so as that is
> > "your" board, it comes down to a policy decision on your part ;-) .
> >
> > While pins follow the q7 standard, there may very well be some lax
> > handling of that standard in some places, and I guess gpio lines could
> > be re-used for something else if needed, as something like the lid-switch
> > is probably non-essential.
> >
> > Also a gpio-key input does not create that much code-overhead if
> > replicated, so personally I'd just stick the power-button with the other
> > buttons in the haikou dts.
> >
> > Which is also a way better thing than having multiple gpio-keys instances
> > that userspace then has to handle.
> >
>
> Yes, but this also means "code" duplication for whoever needs this for
> their baseboard, instead of just having to add a &gpio_keys { status =
> "okay"; }.
Yes :-) .
gpio-keys is special in a way in that you could end up with a different set
of enabled keys per baseboard - dependent on how closely it follows the
standard.
So if someone repurposed the lid-switch only, you'd start changing the
core node again. Hence for the gpio-keys it's probably easier to define
the set of keys in the baseboard.
It's of course different for regulator-infrastructure and such.
> I don't think there's a good solution here, so I would suggest we go
> with everything in Haikou's gpio-keys as Heiko suggested then, @Daniel
> if you agree can you send a v2 for that?
I'll wait for v2 then.
Heiko
next prev parent reply other threads:[~2024-09-30 9:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-25 7:28 [PATCH] arm64: dts: rockchip: Add power button for RK3399 Puma Daniel Semkowicz
2024-09-26 12:34 ` Quentin Schulz
2024-09-30 8:49 ` Heiko Stübner
2024-09-30 9:11 ` Quentin Schulz
2024-09-30 9:21 ` Heiko Stübner [this message]
2024-09-30 12:21 ` Daniel Semkowicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2221314.irdbgypaU6@diego \
--to=heiko@sntech.de \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dse@thaumatec.com \
--cc=dsimic@manjaro.org \
--cc=farouk.bouabid@theobroma-systems.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=quentin.schulz@cherry.de \
--cc=quentin.schulz@theobroma-systems.com \
--cc=robh@kernel.org \
--cc=vahe.grigoryan@theobroma-systems.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox