From: Jonathan Cameron <Jonathan.Cameron-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Fabrice Gasnier <fabrice.gasnier-qxv4g6HH51o@public.gmane.org>
Cc: Jonathan Cameron
<jic23-tko9wxEg+fIOOJlXag/Snyp2UmYkHbXO@public.gmane.org>,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
benjamin.gaignard-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org,
alexandre.torgue-qxv4g6HH51o@public.gmane.org,
linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org,
linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
knaack.h-Mmb7MZpHnFY@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
benjamin.gaignard-qxv4g6HH51o@public.gmane.org
Subject: Re: [PATCH 1/3] dt-bindings: iio: adc: stm32: add support for diff channels
Date: Mon, 23 Oct 2017 14:09:56 +0100 [thread overview]
Message-ID: <20171023140956.00002613@huawei.com> (raw)
In-Reply-To: <0726f676-0440-afbe-f275-ec7fdaa29c9f-qxv4g6HH51o@public.gmane.org>
On Mon, 23 Oct 2017 10:06:27 +0200
Fabrice Gasnier <fabrice.gasnier-qxv4g6HH51o@public.gmane.org> wrote:
> On 10/21/2017 09:23 PM, Jonathan Cameron wrote:
> > On Sat, 21 Oct 2017 18:54:01 +0100
> > Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> >
> >> On Tue, 17 Oct 2017 15:15:43 +0200
> >> Fabrice Gasnier <fabrice.gasnier-qxv4g6HH51o@public.gmane.org> wrote:
> >>
> >>> STM32H7 ADC channels may be configured either as single-ended or
> >>> differential.
> >>> Add 'st,adc-diff-channels' property to support differential channels.
> >>> Differential channels are defined as a pair of positive and negative
> >>> inputs: vinp & vinn.
> >>>
> >>> Signed-off-by: Fabrice Gasnier <fabrice.gasnier-qxv4g6HH51o@public.gmane.org>
> >> Hmm. Fair enough. Sometimes we support both types of channels
> >> and leave it to userspace, but in many cases that makes little sense
> >> - particularly if like I think is going on here, we aren't combining channels
> >> that can be separately read but rather the negative pin is simply unused
> >> when we are in single channel mode... (did I understand that right?)
> > I clearly didn't understand. This is same as other devices
> > in that we are picking a pair from the channels that can otherwise be
> > used as single end channels. (I think).
>
> Hi Jonathan,
>
> Indeed, we're picking a pair from the channels that can be used as
> single channels otherwise.
> Also, it doesn't makes sense to leave the choice to userspace: when
> these channels are used in differential mode, both input should be
> biased. This is quite dependent on hardware (board), not really a
> runtime choice.
> Hope this clarifies ?
>
> >
> > For this binding I think I'd like to see an example added showing how
> > this works...
>
> You're right, I should have added that. Please let me know if I can add
> bellow example in v2:
Looks good to me.
Jonathan
>
> Example to setup differential channels 1, 2 & 3 (with resp. 0, 6 & 7
> negative inputs):
> adc: adc@40022000 {
> compatible = "st,stm32h7-adc-core";
> ...
> adc1: adc@0 {
> compatible = "st,stm32h7-adc";
> ...
> st,adc-diff-channels = <1 0>, <2 6>, <3 7>;
> };
> };
>
> Thanks for reviewing,
> Best Regards,
> Fabrice
>
> >
> > Thanks,
> >
> > Jonathan
> >>
> >> Jonathan
> >>
> >>> ---
> >>> Documentation/devicetree/bindings/iio/adc/st,stm32-adc.txt | 6 ++++++
> >>> 1 file changed, 6 insertions(+)
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.txt b/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.txt
> >>> index 48bfcaa3..c3c8de1 100644
> >>> --- a/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.txt
> >>> +++ b/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.txt
> >>> @@ -62,6 +62,12 @@ Required properties:
> >>> - st,adc-channels: List of single-ended channels muxed for this ADC.
> >>> It can have up to 16 channels on stm32f4 or 20 channels on stm32h7, numbered
> >>> from 0 to 15 or 19 (resp. for in0..in15 or in0..in19).
> >>> +- st,adc-diff-channels: List of differential channels muxed for this ADC.
> >>> + Depending on part used, some channels can be configured as differential
> >>> + instead of single-ended (e.g. stm32h7). List here positive and negative
> >>> + inputs pairs as <vinp vinn>, <vinp vinn>,... vinp and vinn are numbered
> >>> + from 0 to 19 on stm32h7)
> >>> + Note: At least one of "st,adc-channels" or "st,adc-diff-channels" is required.
> >>> - #io-channel-cells = <1>: See the IIO bindings section "IIO consumers" in
> >>> Documentation/devicetree/bindings/iio/iio-bindings.txt
> >>>
> >>
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> >> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> >> More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2017-10-23 13:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-17 13:15 [PATCH 0/3] iio: adc: stm32: Add support for differential channels Fabrice Gasnier
2017-10-17 13:15 ` [PATCH 1/3] dt-bindings: iio: adc: stm32: add support for diff channels Fabrice Gasnier
2017-10-21 17:54 ` Jonathan Cameron
2017-10-21 17:55 ` Jonathan Cameron
2017-10-21 19:23 ` Jonathan Cameron
2017-10-23 8:06 ` Fabrice Gasnier
[not found] ` <0726f676-0440-afbe-f275-ec7fdaa29c9f-qxv4g6HH51o@public.gmane.org>
2017-10-23 13:09 ` Jonathan Cameron [this message]
[not found] ` <1508246145-19417-2-git-send-email-fabrice.gasnier-qxv4g6HH51o@public.gmane.org>
2017-10-24 16:41 ` Rob Herring
2017-10-24 18:42 ` Jonathan Cameron
2017-10-25 8:05 ` Fabrice Gasnier
2017-10-17 13:15 ` [PATCH 2/3] iio: adc: stm32: remove const channel names definition Fabrice Gasnier
[not found] ` <1508246145-19417-3-git-send-email-fabrice.gasnier-qxv4g6HH51o@public.gmane.org>
2017-10-21 17:59 ` Jonathan Cameron
2017-10-17 13:15 ` [PATCH 3/3] iio: adc: stm32: add support for differential channels Fabrice Gasnier
[not found] ` <1508246145-19417-4-git-send-email-fabrice.gasnier-qxv4g6HH51o@public.gmane.org>
2017-10-21 19:25 ` Jonathan Cameron
2017-10-23 8:09 ` Fabrice Gasnier
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=20171023140956.00002613@huawei.com \
--to=jonathan.cameron-hv44wf8li93qt0dzr+alfa@public.gmane.org \
--cc=alexandre.torgue-qxv4g6HH51o@public.gmane.org \
--cc=benjamin.gaignard-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=benjamin.gaignard-qxv4g6HH51o@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=fabrice.gasnier-qxv4g6HH51o@public.gmane.org \
--cc=jic23-tko9wxEg+fIOOJlXag/Snyp2UmYkHbXO@public.gmane.org \
--cc=knaack.h-Mmb7MZpHnFY@public.gmane.org \
--cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \
--cc=linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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).