devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Peter Rosin <peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Hartmut Knaack <knaack.h-Mmb7MZpHnFY@public.gmane.org>,
	Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>,
	Peter Meerwald-Stadler
	<pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 3/4] dt-bindings: iio: document envelope-detector bindings
Date: Sat, 22 Oct 2016 15:53:07 +0100	[thread overview]
Message-ID: <a97858d3-16b4-838c-c46c-a197318264bf@kernel.org> (raw)
In-Reply-To: <1476955562-13673-4-git-send-email-peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>

On 20/10/16 10:26, Peter Rosin wrote:
> Signed-off-by: Peter Rosin <peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
Definitely going to need device tree maintainer input!  (though as Lars
and you discussed some mods to this in the cover letter discussion,
perhaps they should wait for V2).
> ---
>  .../bindings/iio/adc/envelope-detector.txt         | 65 ++++++++++++++++++++++
>  MAINTAINERS                                        |  6 ++
>  2 files changed, 71 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/adc/envelope-detector.txt
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/envelope-detector.txt b/Documentation/devicetree/bindings/iio/adc/envelope-detector.txt
> new file mode 100644
> index 000000000000..0e26299516fd
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/envelope-detector.txt
> @@ -0,0 +1,65 @@
> +Bindings for ADC envelope detector using a DAC and a comparator
> +
> +The DAC is used to find the peak level of an alternating voltage input
> +signal by a binary search using the output of a comparator wired to
> +an interrupt pin. Like so:
> +                          _
> +                         | \
> +    input +------>-------|+ \
> +                         |   \
> +           .-------.     |    }---.
> +           |       |     |   /    |
> +           |    dac|-->--|- /     |
> +           |       |     |_/      |
> +           |       |              |
> +           |       |              |
> +           |    irq|------<-------'
> +           |       |
> +           '-------'
> +
> +Required properties:
> +- compatible: Should be "envelope-detector"
Agreed with the discussion in the cover letter responses.  Needs
to be more specific as lots of ways of skinning this cat.
Hehe, just occurred to me that your Maintainer entry below
makes you responsible for all of them.. Acked!

> +- io-channels: Channel node of the dac to be used for comparator input.
> +- io-channel-names: Should be "dac".
> +- interrupt specification for one client interrupt,
> +  see ../../interrupt-controller/interrupts.txt for details.
> +- interrupt-names: Should be "comp".
> +- envelope-detector,dac-max: The maximum raw input value for the dac.
I guess the available stuff you have brought up to date should deal with this
one without needing another param.

> +- envelope-detector,comp-interval-ms: How long to wait for the comparator
> +  to trigger before moving on to another DAC level. This interval needs to
> +  relate to the lowest possible frequency of the above input signal.
This is an odd one and definitely a case for the device tree guys.

It's not generic enough to not have a 'manufacturer' in the param name,
but there isn't really a manufacturer as anyone with a few chips can build
one of these (using the 'wiring' diagram above ;)

So what should the prefix be?

> +
> +Optional properties:
> +- envelope-detector,inverted: If the input signal is centered around the
> +  dac-max voltage (instead of zero), this property causes the detector to
> +  search for the lowest DAC value that does not triggers the comparator
> +  (instead of the highest). The result is also inverted so that a lower DAC
> +  reading yields a higher voltage value.
As discussed, this is fundamental enough that it should probably
be based on the compatible string rather than a separate item.
> +
> +
> +Example:
> +
> +	&spi {
> +		dac: ad7303@4 {
> +			compatible = "adi,ad7303";
> +			reg = <4>;
> +			spi-max-frequency = <10000000>;
> +			Vdd-supply = <&vdd_supply>;
> +			adi,use-external-reference;
> +			REF-supply = <&vref_supply>;
> +			#io-channel-cells = <1>;
> +		};
> +	};
> +
> +	envelope-detector {
> +		compatible = "envelope-detector";
> +		io-channels = <&dac 0>;
> +		io-channel-names = "dac";
> +
> +		interrupt-parent = <&gpio>;
> +		interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
> +		interrupt-names = "comp";
> +
> +		envelope-detector,dac-max = <255>;
> +		envelope-detector,comp-interval-ms = <50>;
> +	};
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 8c8aae24b96b..4b6f6ec1b703 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -6118,6 +6118,12 @@ S:	Maintained
>  F:	Documentation/devicetree/bindings/iio/dac/dpot-dac.txt
>  F:	drivers/iio/dac/dpot-dac.c
>  
> +IIO ENVELOPE DETECTOR
> +M:	Peter Rosin <peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
> +L:	linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> +S:	Maintained
> +F:	Documentation/devicetree/bindings/iio/adc/envelope-detector.txt
> +
>  IIO SUBSYSTEM AND DRIVERS
>  M:	Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>  R:	Hartmut Knaack <knaack.h-Mmb7MZpHnFY@public.gmane.org>
> 

  parent reply	other threads:[~2016-10-22 14:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20  9:25 [PATCH 0/4] IIO wrapper drivers, dpot-dac and envelope-detector Peter Rosin
     [not found] ` <1476955562-13673-1-git-send-email-peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2016-10-20  9:25   ` [PATCH 1/4] dt-bindings: iio: document dpot-dac bindings Peter Rosin
     [not found]     ` <1476955562-13673-2-git-send-email-peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2016-10-22 14:36       ` Jonathan Cameron
2016-10-20  9:26   ` [PATCH 3/4] dt-bindings: iio: document envelope-detector bindings Peter Rosin
     [not found]     ` <1476955562-13673-4-git-send-email-peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2016-10-20 11:29       ` Peter Meerwald-Stadler
2016-10-22 14:53       ` Jonathan Cameron [this message]
2016-10-20 12:55   ` [PATCH 0/4] IIO wrapper drivers, dpot-dac and envelope-detector Lars-Peter Clausen
     [not found]     ` <9b8c0789-566d-67a3-b4f5-dbe4c69f6932-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2016-10-20 14:53       ` Peter Rosin
     [not found]         ` <7472292a-a509-c791-4eff-5a5037ead837-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2016-10-20 15:29           ` Lars-Peter Clausen
     [not found]             ` <30a4b562-f553-2620-e961-c2904bce9c51-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2016-10-22 14:27               ` Jonathan Cameron
2016-10-22 14:31         ` Jonathan Cameron
2016-10-20 17:30     ` Jonathan Cameron
2016-10-20 17:37       ` Jonathan Cameron
     [not found]         ` <DB170A5C-B172-4B86-80D5-58FD53752ED4-tko9wxEg+fIOOJlXag/Snyp2UmYkHbXO@public.gmane.org>
2016-10-20 18:17           ` Peter Rosin
2016-10-21  7:17             ` jic23
     [not found]               ` <736c146284d93633a4692b1102eaadaf-tko9wxEg+fIOOJlXag/Snyp2UmYkHbXO@public.gmane.org>
2016-10-21  8:24                 ` Peter Rosin
2016-10-21 22:58                 ` Peter Rosin
     [not found]                   ` <58b9c20d-6c3c-4693-b073-e5a8f9c4cb94-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2016-10-22 14:26                     ` Jonathan Cameron
2016-10-20  9:26 ` [PATCH 2/4] iio: dpot-dac: DAC driver based on a digital potentiometer Peter Rosin
2016-10-20 11:29   ` Peter Meerwald-Stadler
     [not found]     ` <alpine.DEB.2.02.1610201254370.19919-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>
2016-10-20 13:48       ` Peter Rosin
     [not found]         ` <22d07498-860d-29f8-07ef-ae2f5df6ab25-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2016-10-20 14:08           ` Peter Meerwald-Stadler
     [not found]             ` <alpine.DEB.2.02.1610201604280.22512-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>
2016-10-20 14:51               ` Peter Rosin
     [not found]   ` <1476955562-13673-3-git-send-email-peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2016-10-22 14:47     ` Jonathan Cameron
2016-10-20  9:26 ` [PATCH 4/4] iio: envelope-detector: ADC driver based on a DAC and a comparator Peter Rosin
     [not found]   ` <1476955562-13673-5-git-send-email-peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2016-10-22 15:03     ` 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=a97858d3-16b4-838c-c46c-a197318264bf@kernel.org \
    --to=jic23-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=knaack.h-Mmb7MZpHnFY@public.gmane.org \
    --cc=lars-Qo5EllUWu/uELgA04lAiVw@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=peda-koto5C5qi+TLoDKTGw+V6w@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).