From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Ceclan Dumitru <mitrutzceclan@gmail.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
linus.walleij@linaro.org, brgl@bgdev.pl, andy@kernel.org,
linux-gpio@vger.kernel.org,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Jonathan Cameron" <jic23@kernel.org>,
"Rob Herring" <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Michael Walle" <michael@walle.cc>,
"Andy Shevchenko" <andy.shevchenko@gmail.com>,
"Arnd Bergmann" <arnd@arndb.de>,
"ChiaEn Wu" <chiaen_wu@richtek.com>,
"Niklas Schnelle" <schnelle@linux.ibm.com>,
"Leonard Göhrs" <l.goehrs@pengutronix.de>,
"Mike Looijmans" <mike.looijmans@topic.nl>,
"Haibo Chen" <haibo.chen@nxp.com>,
"Hugo Villeneuve" <hvilleneuve@dimonoff.com>,
"Ceclan Dumitru" <dumitru.ceclan@analog.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v11 1/2] dt-bindings: adc: add AD7173
Date: Wed, 17 Jan 2024 16:37:25 +0000 [thread overview]
Message-ID: <20240117163725.00003981@Huawei.com> (raw)
In-Reply-To: <18c239af-71ee-49d8-878e-e1770c3e2d46@gmail.com>
On Wed, 17 Jan 2024 14:43:21 +0200
Ceclan Dumitru <mitrutzceclan@gmail.com> wrote:
> On 1/16/24 18:30, Jonathan Cameron wrote:
> > On Mon, 15 Jan 2024 15:53:39 -0600
> > David Lechner <dlechner@baylibre.com> wrote:
> >
> >> On Wed, Dec 20, 2023 at 4:48 AM Dumitru Ceclan <mitrutzceclan@gmail.com> wrote:
>
> ...
>
> >> Sorry for the late reply as I see this has been applied already but...
> > We have plenty of time. Rather than dropping the ad7173 from my tree,
> > I'd prefer to see additional patches on top to tidy up whatever
> > makes sense from David's feedback.
> >
> Alright then.
>
> ...
>
> >>
> >> As discussed in v8 [1] it is not clear what signal this is. Based on
> >> that discussion, I'm assuming the RDY signal, but how would bindings
> >> consumers know that without a description since it is not the only
> >> digital output signal of the chip? And why the ERROR signal was
> >> omitted here was never addressed AFAICT.
> >>
> >> [1]: https://lore.kernel.org/linux-iio/20231217135007.3e5d959a@jic23-huawei/
> >
> > I'd forgotten about that. Adding interrupt-names would be the easiest
> > way to resolve this.
> >
>
> I'll add this, but my curiosity for the long run is: How should
> differences between what bindings include and what drivers support
> should be managed and documented?
Drivers almost always support a subset of functionality of the device.
This isn't much different. The driver 'should' use interrupt-names
but it doesn't need to support all the things that the binding says should
be in there.
Sometimes we document things in a driver, but there isn't any obligation to
do so and those docs are often out of date.
>
> ...
>
> >>> +
> >>> + refin-supply:
> >>> + description: external reference supply, can be used as reference for conversion.
> >>
> >> If I'm understanding correctly, this represents both voltage inputs
> >> REF+ and REF-, correct? The datasheet says "Reference Input Negative
> >> Terminal. REF− can span from AVSS to AVDD1 − 1 V". It seems like they
> >> should be separate supplies in case REF- is non-zero. Otherwise, how
> >> can we know what voltage it is? (same comment applies to refin2.)
> >
> > Agreed, in this case these are directly used as references (we recently
> > had another driver that could take a wide range of negative and positive
> > inputs but in that case an internal reference was generated that didn't
> > made it not matter exactly what was being supplied. Not true here though!
> >
> Wouldn't it be alright to specify that the voltage specified here should
> be the actual difference (REF+)-(REF-)?
How do you establish the offset to apply to single ended channels if you don't
know the value of REF- (relative to local ground)?
So no - as the device supports single ended channels the difference isn't
enough information. It would probably be fine to do as you say if it
were a device with only differential channels where all that matters is
the scaling.
>
> ...
>
> >>> +required:
> >>> + - compatible
> >>> + - reg
> >>> + - interrupts
> >>
> >> Why are interrupts required? What if the pin is not connected?
> >>
> > Ah. I clearly failed to review this one closely enough.
> >
> > Absolutely agree that interrupts should never be required.
> > No need for the driver to work if they aren't, but the binding
> > shouldn't require them!
> >
> > Jonathan
> >
>
> To make sure that I understand, the driver will not probe without
> interrupts, but it is alright to make then optional in the bindings?
Yes - it is fine for a driver to only support a subset of functionality
and fail to probe if that subset isn't what the hardware enables.
>
> This is in the case that someone will want to use this binding and
> implement reading with polling?
Yes.
J
next prev parent reply other threads:[~2024-01-17 16:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-20 10:48 [PATCH v11 1/2] dt-bindings: adc: add AD7173 Dumitru Ceclan
2023-12-20 10:48 ` [PATCH v11 2/2] iio: adc: ad7173: add AD7173 driver Dumitru Ceclan
2024-01-13 14:59 ` Jonathan Cameron
2023-12-21 17:45 ` [PATCH v11 1/2] dt-bindings: adc: add AD7173 Krzysztof Kozlowski
2024-01-08 9:11 ` Ceclan Dumitru
2024-01-09 2:58 ` Rob Herring
2024-01-15 21:53 ` David Lechner
2024-01-16 16:30 ` Jonathan Cameron
2024-01-17 12:43 ` Ceclan Dumitru
2024-01-17 16:37 ` Jonathan Cameron [this message]
2024-01-18 8:10 ` Ceclan Dumitru
2024-01-18 9:21 ` Jonathan Cameron
2024-01-17 12:30 ` Ceclan Dumitru
2024-01-17 16:46 ` 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=20240117163725.00003981@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=andy.shevchenko@gmail.com \
--cc=andy@kernel.org \
--cc=arnd@arndb.de \
--cc=brgl@bgdev.pl \
--cc=chiaen_wu@richtek.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=dumitru.ceclan@analog.com \
--cc=haibo.chen@nxp.com \
--cc=hvilleneuve@dimonoff.com \
--cc=jic23@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=l.goehrs@pengutronix.de \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael@walle.cc \
--cc=mike.looijmans@topic.nl \
--cc=mitrutzceclan@gmail.com \
--cc=robh+dt@kernel.org \
--cc=schnelle@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.