From: <Marius.Cristea@microchip.com>
To: <jic23@kernel.org>, <nuno.sa@analog.com>, <dlechner@baylibre.com>,
<andy@kernel.org>
Cc: <robh@kernel.org>, <krzk+dt@kernel.org>, <conor+dt@kernel.org>,
<broonie@kernel.org>, <devicetree@vger.kernel.org>,
<linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/2] dt-bindings: iio: adc: adding support for PAC194X
Date: Tue, 10 Jun 2025 16:04:00 +0000 [thread overview]
Message-ID: <a9902463d1f29993f13ce0bc87fcfb05472624d5.camel@microchip.com> (raw)
In-Reply-To: <db78ac20-9b58-49d1-ba38-cc269eaff254@baylibre.com>
On Tue, 2025-06-10 at 10:22 -0500, David Lechner wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
>
> On 6/10/25 9:46 AM, Marius.Cristea@microchip.com wrote:
> > Hi David,
> >
> > Thank you for the feedback. Please see my comments below...
> >
>
> ...
>
...
>
> > > > +
> > > > + microchip,vbus-half-range:
> > > > + $ref: /schemas/types.yaml#/definitions/flag
> > > > + description: |
> > > > + In order to increase measurement resolution and
> > > > keeping
> > > > the same
> > > > + number the of bits the device has a configurable
> > > > VBUS
> > > > full range scale
> > > > + (FSR). The range should be set by hardware design
> > > > and it
> > > > should not be
> > > > + changed during runtime. The bipolar capability for
> > > > VBUS
> > > > enables
> > > > + accurate offset measurement and correction.
> > > > + The VBUS could be configured into the following full
> > > > scale range:
> > > > + - VBUS has unipolar 0V to 32V FSR (default) for
> > > > PAC195X or 0V to 9V
> > > > + (default) for PAC194X.
> > > > + - VBUS has bipolar -32V to 32V FSR for PAC195X or
> > > > -9V
> > > > to 9V for
> > > > + PAC194X. The actual range is limited to about -
> > > > 200
> > > > mV due to the
> > > > + impact of the ESD structures.
> > > > + - VBUS has bipolar -16V to 16V FSR for PAC195X or
> > > > -
> > > > 4.5V to 4.5V for
> > > > + PAC194X. The actual range is limited to about -
> > > > 200
> > > > mV due to the
> > > > + impact of the ESD structures.
> > > > +
> > > > + microchip,vbus-bipolar:
> > > > + $ref: /schemas/types.yaml#/definitions/flag
> > > > + description:
> > > > + If provided, the channel is to be used in bipolar
> > > > mode.
> > > > The
> > > > + actual range is limited to about -200 mV due to the
> > > > impact of the ESD
> > > > + structures.
> > > > +
> > >
> > > Using Jonathan's suggestion from v2 to just have a single
> > > property
> > > with 3 different
> > > ranges to chose from seems simpler that this. It would only
> > > require
> > > one property
> > > and would be self-documenting. The description could be shortened
> > > to
> > > just a couple
> > > of lines.
> >
> > I was thinking to add the range for this property, but it looks
> > (for me
> > at least) more complicated from the checking point of view. The
> > driver
> > is supporting two family of devices that has, each, 3 different
> > voltage
> > range as an input.
> >
>
> Usually, having a consistent binding for the same thing among similar
> devices is more important than how easy it is to implement in the
> driver.
>
> Since this seems to be a common pattern, we could probably justify an
> iio_property_match_ranges() helper function that would simplify the
> implementation in drivers that would need to use such a property.
> Then
> in each driver it would just be a matter of making a static const
> array
> lookup table of ranges for each device and calling the helper
> function.
Sorry for not explaining very well. I have implemented the range into
the driver and I was working well, but I had issues defining the range
into the device binding and the checker was failing. That was the
reason that I've dropped the range from the binding. Also I had some
issues enforcing a certain "available" ranges for a particular part
into the binding.
next prev parent reply other threads:[~2025-06-10 16:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-06 9:39 [PATCH v3 0/2] adding support for Microchip PAC194X Power Monitor marius.cristea
2025-06-06 9:39 ` [PATCH v3 1/2] dt-bindings: iio: adc: adding support for PAC194X marius.cristea
2025-06-06 15:53 ` David Lechner
2025-06-10 14:46 ` Marius.Cristea
2025-06-10 15:22 ` David Lechner
2025-06-10 16:04 ` Marius.Cristea [this message]
2025-06-10 16:35 ` David Lechner
2025-06-17 15:21 ` Marius.Cristea
2025-06-06 16:24 ` Conor Dooley
2025-06-06 9:39 ` [PATCH v3 2/2] " marius.cristea
2025-06-06 17:02 ` David Lechner
2025-06-10 15:07 ` Marius.Cristea
2025-06-10 16:11 ` David Lechner
2025-06-11 15:59 ` Jonathan Cameron
2025-06-10 20:20 ` Andy Shevchenko
2025-06-07 15:27 ` Jonathan Cameron
2025-06-10 15:58 ` Marius.Cristea
2025-06-11 16:12 ` Jonathan Cameron
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=a9902463d1f29993f13ce0bc87fcfb05472624d5.camel@microchip.com \
--to=marius.cristea@microchip.com \
--cc=andy@kernel.org \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--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®