public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Luca Weiss <luca.weiss@fairphone.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org,
	Griffin Kroah-Hartman <griffin.kroah@fairphone.com>
Subject: Re: Unexpected behavior of of_regulator_get()?
Date: Thu, 30 Apr 2026 20:18:03 +0900	[thread overview]
Message-ID: <afM6a3lWHnU3_q3-@sirena.co.uk> (raw)
In-Reply-To: <DI6ABL0HCWTB.2K5532GWRM6US@fairphone.com>

[-- Attachment #1: Type: text/plain, Size: 1930 bytes --]

On Thu, Apr 30, 2026 at 08:44:40AM +0200, Luca Weiss wrote:
> On Thu Apr 30, 2026 at 2:10 AM CEST, Mark Brown wrote:
> > On Wed, Apr 29, 2026 at 10:18:31AM +0200, Luca Weiss wrote:

> >> 		event-hall-sensor {
> >> 			label = "Hall Effect Sensor";
> >> 			vdd-supply = <&vreg_l10b>;
> >> 		};

> > I don't understand what this is supposed to describe.

> Such hall effect sensor requires power, so the IC has a VDD/VCC pin

Neither of which is "supply".

> which needs to be powered, in order for the GPIO of the IC to trigger,
> and that Linux can create an input event from it. So far this was mostly
> described in devicetree using regulator-always-on because the devicetree
> bindings & driver did not support that.

I think at the point where you're shoehorning a separate device into the
middle of a keyboard with a non-descriptive binding you're making
problems - at some point someone is going to try to shoehorn something
that has two supplies into the binding and everyone will be sad.  These
sorts of attempts to describe regulators in a "standard" way that
doesn't correspond to the actual hardware generally cause problems like
the AHCI ones.  I'd just make a separate input device here, you're
trying to solve a problem that you've actively created by not
representing the hardware.

> There's devm_regulator_get_optional() which gets a regulator for a given
> device (on the gpio-keys level), and my expectation of
> of_regulator_get() was that you point it at a devicetree node (e.g. the
> event-hall-sensor subnode and it grabs the regulator from that node, not
> from the parent (gpio-keys), nor from a different subnode of gpio-keys.

of_regulator_get() is not intended to be used by anything other than
framework code, the use case for a driver to use it would be that it's
got bindings that don't map well onto Linux or it's just made a mess of
it's bindings and needs to bodge it's way out of that situation.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2026-04-30 11:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29  8:18 Unexpected behavior of of_regulator_get()? Luca Weiss
2026-04-30  0:10 ` Mark Brown
2026-04-30  6:44   ` Luca Weiss
2026-04-30 11:18     ` Mark Brown [this message]

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=afM6a3lWHnU3_q3-@sirena.co.uk \
    --to=broonie@kernel.org \
    --cc=griffin.kroah@fairphone.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.weiss@fairphone.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