devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Grant Peltier <grantpeltier93@gmail.com>
Cc: robh@kernel.org, linux@roeck-us.net, geert+renesas@glider.be,
	magnus.damm@gmail.com, grant.peltier.jg@renesas.com,
	brandon.howell.jg@renesas.com, linux-hwmon@vger.kernel.org,
	devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
	jic23@kernel.org, Peter Rosin <peda@axentia.se>
Subject: Re: [PATCH v3 2/2] dt-bindings: hwmon: isl68137: add bindings to support voltage dividers
Date: Thu, 31 Oct 2024 12:55:01 +0000	[thread overview]
Message-ID: <20241031-chalice-drainpipe-d49b0c5f9ef0@spud> (raw)
In-Reply-To: <ZxqSqcN11fTambT4@raspberrypi>

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

On Thu, Oct 24, 2024 at 01:32:09PM -0500, Grant Peltier wrote:
> On Thu, Oct 24, 2024 at 06:01:11PM +0100, Conor Dooley wrote:
> > On Wed, Oct 23, 2024 at 03:53:51PM -0500, Grant Peltier wrote:
> > > + [...]
> > > +
> > > +properties:
> > > +  compatible:
> > > +    enum:
> > > +      - renesas,isl68220
> > > +      - renesas,isl68221
> > > +      - renesas,isl68222
> > > +      - renesas,isl68223
> > > +      - renesas,isl68224
> > > +      - renesas,isl68225
> > > +      - renesas,isl68226
> > > +      - renesas,isl68227
> > > +      - renesas,isl68229
> > > +      - renesas,isl68233
> > > +      - renesas,isl68239
> > > +      - renesas,isl69222
> > > +      - renesas,isl69223
> > > +      - renesas,isl69224
> > > +      - renesas,isl69225
> > > +      - renesas,isl69227
> > > +      - renesas,isl69228
> > > +      - renesas,isl69234
> > > +      - renesas,isl69236
> > > +      - renesas,isl69239
> > > +      - renesas,isl69242
> > > +      - renesas,isl69243
> > > +      - renesas,isl69247
> > > +      - renesas,isl69248
> > > +      - renesas,isl69254
> > > +      - renesas,isl69255
> > > +      - renesas,isl69256
> > > +      - renesas,isl69259
> > > +      - renesas,isl69260
> > > +      - renesas,isl69268
> > > +      - renesas,isl69269
> > > +      - renesas,isl69298
> > > +      - renesas,raa228000
> > > +      - renesas,raa228004
> > > +      - renesas,raa228006
> > > +      - renesas,raa228228
> > > +      - renesas,raa229001
> > > +      - renesas,raa229004
> > 
> > Damn, that;s a list and a half, innit! Looking briefly at the driver
> > change, the match data implies that quite a few of these actually would
> > be suitable for fallback compatibles.
> 
> Yes, there are quite a few part numbers (and likely to be more in the
> future). My intention was to make the driver more user friendly since the
> variants listed in the driver do not map to something in any of the
> datasheets. So using those instead would require users to inspect the
> source of the driver instead of simply referencing their part number(s).

I don't understand. How would a fallback materially change anything in
that regard? You still put the compatible corresponding to the device
you have in your dts. A fallback means having multiple compatible
strings in the property, not a single one corresponding to another
device.

> > > +  reg:
> > > +    maxItems: 1
> > > +
> > > +  '#address-cells':
> > > +    const: 1
> > > +
> > > +  '#size-cells':
> > > +    const: 0
> > > +
> > > +patternProperties:
> > > +  "^channel@([0-3])$":
> > > +    type: object
> > > +    description:
> > > +      Container for properties specific to a particular channel (rail).
> > > +
> > > +    properties:
> > > +      reg:
> > > +        description: The channel (rail) index.
> > > +        items:
> > > +          minimum: 0
> > > +          maximum: 3
> > > +
> > > +      renesas,vout-voltage-divider:
> > 
> > There's already a binding for voltage dividers: voltage-divider.yaml
> > That said, I have no idea how that would work with an extant driver for
> > the hardware like we have here. I'd imagine it would really have to be
> > used with iio-hwmon? + Peter and Jonathan, since I don't know how the
> > driver side of using the voltage divider works.
> 
> In his recent revier, Guenter requested using a standard voltage divider
> schema as well. I see there is an implementation in maxim,maxim20730.yaml
> but that differs from the one in voltage-divider.yaml. Should I opt to
> match maxim,maxim20730.yaml?

I would rather the standard binding was used, but it would probably
involve having to hook up iio-rescale to hwmon? I don't know enough
about that, which is why I Cced Peter and Jonathan.

> > > +examples:
> > > +  - |
> > > +    i2c {
> > > +      #address-cells = <1>;
> > > +      #size-cells = <0>;
> > > +
> > > +      isl68239@60 {
> > > +        compatible = "renesas,isl68239";
> > > +        reg = <0x60>;
> > > +      };
> > > +    };
> > 
> > Without any channels, what does this actually do? If you've got no
> > channels you cannot measure anything making this example invalid?
> 
> The channel structures are optional to allow users to arbitrarily define
> voltage dividers for any particular rail. Omitting the channel definitions
> still allow the device to be instantiated and probed as an I2C device
> along with all related hwmon PMBus telemetry dictated by the part variant.

I dunno, either the channels are hooked up to something or they are not.
If they are, the channels should be populated in the devicetree.

Cheers,
Conor.

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

      reply	other threads:[~2024-10-31 12:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-23 20:52 [PATCH v3 0/2] dt-bindings: hwmon: pmbus: add bindings for isl68137 Grant Peltier
2024-10-23 20:53 ` [PATCH v3 1/2] hwmon: (pmbus/isl68137) add support for voltage divider on Vout Grant Peltier
2024-10-23 20:53 ` [PATCH v3 2/2] dt-bindings: hwmon: isl68137: add bindings to support voltage dividers Grant Peltier
2024-10-24 17:01   ` Conor Dooley
2024-10-24 18:32     ` Grant Peltier
2024-10-31 12:55       ` Conor Dooley [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=20241031-chalice-drainpipe-d49b0c5f9ef0@spud \
    --to=conor@kernel.org \
    --cc=brandon.howell.jg@renesas.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=grant.peltier.jg@renesas.com \
    --cc=grantpeltier93@gmail.com \
    --cc=jic23@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=magnus.damm@gmail.com \
    --cc=peda@axentia.se \
    --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;
as well as URLs for NNTP newsgroup(s).