From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Jonathan Cameron <jic23@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Frank Rowand <frowand.list@gmail.com>
Cc: kernel@pengutronix.de, Geert Uytterhoeven <geert@glider.be>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org
Subject: enabling a regulator before doing an ADC measurement
Date: Wed, 19 Feb 2020 11:32:35 +0100 [thread overview]
Message-ID: <20200219103235.u2roy3uchlrxqgqw@pengutronix.de> (raw)
Hello,
I have a hardware setup that looks as follows:
,-------------------.
,---------. ,---/ -------| current-regulator |
| ADC | | `-------------------'
| CH0--------+
| | |
`.........' ,-----.
|PT100|
`-----'
|
⏚
So the idea is that I enable the regulator and then measure the adc's
input to determine the resistance of the PT100 and so its temperature.
I wonder if/how I should represent that in my device's device tree. I
discussed this already a bit with Geert on irc and he came up with
something like:
adc {
...
channel@0 {
reg = <0>;
supply = <&myregulator>;
};
};
with the intention that the adc driver enables myregulator before
starting a measurement on channel 0.
Does this sound sensible? Does something like this maybe even already
exist and I missed it?
What is a bit special here is that usually a regulator is used to supply
a device and it's just enabled at probe time (or when the device is
started to be used) and disabled when done. Here the regulator is
supposed to be enabled only during a measurement[1] to yield the reference
current and doesn't supply a device. So maybe better use another
property name instead of plain "supply", maybe "reference-supply"?
Best regards
Uwe
[1] When the current measurement is done, the regulator must be swiched
off again to not warm up the PT100 and so fudge future measurements.
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
next reply other threads:[~2020-02-19 10:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-19 10:32 Uwe Kleine-König [this message]
2020-02-21 10:15 ` enabling a regulator before doing an ADC measurement 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=20200219103235.u2roy3uchlrxqgqw@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=geert@glider.be \
--cc=jic23@kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-iio@vger.kernel.org \
--cc=robh+dt@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;
as well as URLs for NNTP newsgroup(s).