From: Jonathan Cameron <jic23@kernel.org>
To: Gregor Boirie <gregor.boirie@parrot.com>, linux-iio@vger.kernel.org
Cc: Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald <pmeerw@pmeerw.net>,
Tomasz Duszynski <tduszyns@gmail.com>,
Daniel Baluta <daniel.baluta@intel.com>,
Krzysztof Kozlowski <k.kozlowski@samsung.com>,
Mark Brown <broonie@kernel.org>, "Andrew F. Davis" <afd@ti.com>
Subject: Re: [PATCH v3 3/6] iio:pressure:ms5611: power regulator support
Date: Sun, 21 Feb 2016 20:53:50 +0000 [thread overview]
Message-ID: <56CA23DE.80301@kernel.org> (raw)
In-Reply-To: <62baa1cc0a865049bdd23e03b24a6051463ccc7b.1455731233.git.gregor.boirie@parrot.com>
On 17/02/16 17:52, Gregor Boirie wrote:
> From: Grégor Boirie <gregor.boirie@parrot.com>
>
> Add support for an optional regulator which, if found into device-tree,
> will power on device at probing time.
> The regulator is declared into ms5611 DTS entry as a "vdd-supply" property.
>
> Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
This usually only gets done when it first matters to someone. Guessing it
matters to you!
Applied to the togreg branch of iio.git
Thanks,
Jonathan
> ---
> drivers/iio/pressure/ms5611_core.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/iio/pressure/ms5611_core.c b/drivers/iio/pressure/ms5611_core.c
> index acd8e37..992ad8d 100644
> --- a/drivers/iio/pressure/ms5611_core.c
> +++ b/drivers/iio/pressure/ms5611_core.c
> @@ -16,6 +16,7 @@
> #include <linux/module.h>
> #include <linux/iio/iio.h>
> #include <linux/delay.h>
> +#include <linux/regulator/consumer.h>
>
> #include <linux/iio/buffer.h>
> #include <linux/iio/triggered_buffer.h>
> @@ -290,6 +291,18 @@ static const struct iio_info ms5611_info = {
> static int ms5611_init(struct iio_dev *indio_dev)
> {
> int ret;
> + struct regulator *vdd = devm_regulator_get(indio_dev->dev.parent,
> + "vdd");
> +
> + /* Enable attached regulator if any. */
> + if (!IS_ERR(vdd)) {
> + ret = regulator_enable(vdd);
> + if (ret) {
> + dev_err(indio_dev->dev.parent,
> + "failed to enable Vdd supply: %d\n", ret);
> + return ret;
> + }
> + }
>
> ret = ms5611_reset(indio_dev);
> if (ret < 0)
>
next prev parent reply other threads:[~2016-02-21 20:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-17 17:52 [PATCH v3 0/6] iio:pressure:ms5611: fix and enhancements Gregor Boirie
2016-02-17 17:52 ` [PATCH v3 1/6] iio:pressure:ms5611: fix ms5607 temp compensation Gregor Boirie
2016-02-21 20:51 ` Jonathan Cameron
2016-02-17 17:52 ` [PATCH v3 2/6] iio:pressure:ms5611: use probed device name Gregor Boirie
2016-02-21 20:52 ` Jonathan Cameron
2016-02-17 17:52 ` [PATCH v3 3/6] iio:pressure:ms5611: power regulator support Gregor Boirie
2016-02-21 20:53 ` Jonathan Cameron [this message]
2016-02-17 17:52 ` [PATCH v3 4/6] iio:pressure:ms5611: DT bindings documentation Gregor Boirie
2016-02-21 21:00 ` Jonathan Cameron
2016-02-17 17:52 ` [PATCH v3 5/6] iio:pressure:ms5611: oversampling rate support Gregor Boirie
2016-02-21 21:02 ` Jonathan Cameron
2016-02-17 17:52 ` [PATCH v3 6/6] iio:pressure:ms5611: continuous sampling support Gregor Boirie
2016-02-17 21:09 ` Jonathan Cameron
2016-02-18 10:18 ` Gregor Boirie
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=56CA23DE.80301@kernel.org \
--to=jic23@kernel.org \
--cc=afd@ti.com \
--cc=broonie@kernel.org \
--cc=daniel.baluta@intel.com \
--cc=gregor.boirie@parrot.com \
--cc=k.kozlowski@samsung.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=tduszyns@gmail.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.