linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: "Mylène Josserand" <mylene.josserand@bootlin.com>,
	"jic23@kernel.org" <jic23@kernel.org>,
	"knaack.h@gmx.de" <knaack.h@gmx.de>,
	"lars@metafoo.de" <lars@metafoo.de>,
	"pmeerw@pmeerw.net" <pmeerw@pmeerw.net>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"thomas.petazzoni@bootlin.com" <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH v1 3/3] dt-bindings: iio: afe: Add hwmon example
Date: Tue, 11 Jun 2019 11:14:10 +0000	[thread overview]
Message-ID: <89820e72-dcdc-67a8-b83d-5657d66d910a@axentia.se> (raw)
In-Reply-To: <20190611095659.29845-4-mylene.josserand@bootlin.com>

On 2019-06-11 11:56, Mylène Josserand wrote:
> With the support of CHAN_INFO_PROCESSED in voltage-divider,
> it is possible to read the processed values directly from iio's
> sysfs entries or by using iio-hwmon. Add an example for this last
> use case.

As I wrote in response to the cover letter, I think iio-hwmon
could "consume" voltage dividers just fine before adding the
processed channel, and while more examples might be good,
there is really no specific relation between iio-hwmon and
voltage dividers. Adding iio-hwmon examples to each and every
iio binding seems pointless. So, I see little reason to add
such examples here.

But if everyone else wants it, don't let me stand in the way...

Cheers,
Peter

> Signed-off-by: Mylène Josserand <mylene.josserand@bootlin.com>
> ---
>  .../bindings/iio/afe/voltage-divider.txt           | 24 ++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/afe/voltage-divider.txt b/Documentation/devicetree/bindings/iio/afe/voltage-divider.txt
> index b452a8406107..f7e1c7cb2744 100644
> --- a/Documentation/devicetree/bindings/iio/afe/voltage-divider.txt
> +++ b/Documentation/devicetree/bindings/iio/afe/voltage-divider.txt
> @@ -51,3 +51,27 @@ sysv {
>  		spi-max-frequency = <1000000>;
>  	};
>  };
> +
> +It is also possible to retrieve the processed values using hwmon node:
> +
> +div0: div0 {
> +	compatible = "voltage-divider";
> +	io-channels = <&adc0 0>; /* Channel 0 of the ADC */
> +	output-ohms = <47>; /* R2 */
> +	full-ohms = <73>; /* R1 (26) + R2 (47) */
> +	#io-channel-cells = <1>;
> +};
> +
> +div1: div1 {
> +	compatible = "voltage-divider";
> +	io-channels = <&adc0 1>; /* Channel 1 of the ADC */
> +	output-ohms = <47>; /* R2 */
> +	full-ohms = <115>; /* R1 (68) + R2 (47) */
> +	#io-channel-cells = <1>;
> +};
> +
> +iio-hwmon {
> +	compatible = "iio-hwmon";
> +	io-channels = <&div0 0>, <&div1 0>;
> +	io-channel-names = "3v3", "usb";
> +};
> 


  reply	other threads:[~2019-06-11 11:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-11  9:56 [PATCH v1 0/3] iio: afe: rescale: Add INFO_PROCESSED support Mylène Josserand
2019-06-11  9:56 ` [PATCH v1 1/3] iio: afe: rescale: Move scale conversion to new function Mylène Josserand
2019-06-11 11:03   ` Peter Rosin
2019-06-11  9:56 ` [PATCH v1 2/3] iio: afe: rescale: Add support of CHAN_INFO_PROCESSED Mylène Josserand
2019-06-11  9:56 ` [PATCH v1 3/3] dt-bindings: iio: afe: Add hwmon example Mylène Josserand
2019-06-11 11:14   ` Peter Rosin [this message]
2019-06-11 11:02 ` [PATCH v1 0/3] iio: afe: rescale: Add INFO_PROCESSED support Peter Rosin
2019-06-11 11:44   ` 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=89820e72-dcdc-67a8-b83d-5657d66d910a@axentia.se \
    --to=peda@axentia.se \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mylene.josserand@bootlin.com \
    --cc=pmeerw@pmeerw.net \
    --cc=robh+dt@kernel.org \
    --cc=thomas.petazzoni@bootlin.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 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).