mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Rob Herring <robh@kernel.org>,
	Cedric Encarnacion <cedricjustine.encarnacion@analog.com>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jean Delvare <jdelvare@suse.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-i2c@vger.kernel.org
Subject: Re: [PATCH v2 1/2] dt-bindings: hwmon: pmbus: add lt3074
Date: Thu, 27 Feb 2025 08:32:58 -0800	[thread overview]
Message-ID: <dbd9cc84-a0b6-4323-b343-6e80aaaf2d14@roeck-us.net> (raw)
In-Reply-To: <20250227-sceptical-phenomenal-wolverine-56e3cf@krzk-bin>

On Thu, Feb 27, 2025 at 09:50:23AM +0100, Krzysztof Kozlowski wrote:
> > > > 
> > > > hwmon code might need some changes, but that's not really relevant for
> > > > proper hardware description.
> > > 
> > > Normally, I would agree, but it seems generic pmbus code expects this
> > > structure. This just came up with changing another binding maintained by
> > > 'Not Me' to follow this structure. We're stuck with the existing way, so
> > > I don't know that it is worth supporting 2 ways forever. OTOH, is it
> > > guaranteed that these devices will only ever be pmbus devices or that
> > > other regulator devices which are not handled as pmbus devices currently
> > > will be in the future. If so, more flexibility in the bindings will be
> > > needed.
> > > 
> > 
> > I would appreciate if someone would explain to me what the problems with
> > the current PMBus code actually are. I have seen several comments claiming
> 
> Not exactly a problem but missing feature. pmbus code (at least one of
> macros I looked at) expects regulator node and some sort of child of it
> (vout), while such simple devices should be:
> 
> regulator {
> 	compatible = "adi,lt3074";
> 	regulator-name = "vout";
> 	regulator-min-microvolt = "100000";
> 	regulator-max-microvolt = "100000";
> };
> 
> so without any of regulators and regulators/vout subnodes.
> 
> > that the code should be changed, but I have no idea what the expected changes
> > actually are or, in other words, what the PMBus code should be doing
> > differently.
> 
> I did not investigate much into pmbus code, but this might be as simple
> as accepting arguments for .of_match and .regulators_node and then
> accepting NULLs as them as well. Or a new macro which assigns NULLs
> there.
> 

Unless I am missing something, the following should do the trick.

diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h
index ddb19c9726d6..289767e5d599 100644
--- a/drivers/hwmon/pmbus/pmbus.h
+++ b/drivers/hwmon/pmbus/pmbus.h
@@ -512,7 +512,6 @@ int pmbus_regulator_init_cb(struct regulator_dev *rdev,
 	{							\
 		.name = (_name),				\
 		.of_match = of_match_ptr(_name),		\
-		.regulators_node = of_match_ptr("regulators"),	\
 		.ops = &pmbus_regulator_ops,			\
 		.type = REGULATOR_VOLTAGE,			\
 		.owner = THIS_MODULE,				\

Maybe someone can check if that works.

Thanks,
Guenter

  reply	other threads:[~2025-02-27 16:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25 13:01 [PATCH v2 0/2] Add support for LT3074 low voltage linear regulator Cedric Encarnacion
2025-02-25 13:01 ` [PATCH v2 1/2] dt-bindings: hwmon: pmbus: add lt3074 Cedric Encarnacion
2025-02-26  8:20   ` Krzysztof Kozlowski
2025-02-26 14:59     ` Rob Herring
2025-02-26 19:17       ` Guenter Roeck
2025-02-27  8:50         ` Krzysztof Kozlowski
2025-02-27 16:32           ` Guenter Roeck [this message]
2025-03-18 10:03             ` Encarnacion, Cedric justine
2025-03-18 15:17               ` Guenter Roeck
2025-03-19  4:10                 ` Encarnacion, Cedric justine
2025-03-21 16:53                   ` Encarnacion, Cedric justine
2025-03-21 17:09                     ` Guenter Roeck
2025-03-21 17:24                       ` Guenter Roeck
2025-03-24  7:16                         ` Krzysztof Kozlowski
2025-03-24 13:58                           ` Guenter Roeck
2025-03-21 20:23                     ` Guenter Roeck
2025-04-07 22:59     ` Guenter Roeck
2025-02-25 13:01 ` [PATCH v2 2/2] hwmon: (pmbus/lt3074): add support for lt3074 Cedric Encarnacion
2025-02-26 13:03   ` Guenter Roeck

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=dbd9cc84-a0b6-4323-b343-6e80aaaf2d14@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=Delphine_CC_Chiu@wiwynn.com \
    --cc=cedricjustine.encarnacion@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /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

all inboxes | Powered by JetHome®