From: Jonathan Cameron <jic23@kernel.org>
To: Paul Cercueil <paul.cercueil@analog.com>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Hartmut Knaack <knaack.h@gmx.de>,
Peter Meerwald <pmeerw@pmeerw.net>,
Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org
Subject: Re: [PATCH 3/3] iio: ad5064: Always use external vref if there is no internal vref
Date: Sun, 4 Oct 2015 14:52:22 +0100 [thread overview]
Message-ID: <56112F16.5090307@kernel.org> (raw)
In-Reply-To: <1443789702-24945-3-git-send-email-paul.cercueil@analog.com>
On 02/10/15 13:41, Paul Cercueil wrote:
> If the device does not have an internal reference, there is no
> other choice but to use the external reference. In that case,
> it does not make much sense to have to specify it.
>
> This patch ensures that the external reference is used if the
> device does not feature an internal reference.
>
> Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Other than the issue the autobuilder found I'm happy enough
with the series.
Given it is Lars' driver I'd like him to take a look as well
before I apply it.
Thanks,
Jonathan
> ---
> drivers/iio/dac/ad5064.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/iio/dac/ad5064.c b/drivers/iio/dac/ad5064.c
> index 7146f42..daee39e 100644
> --- a/drivers/iio/dac/ad5064.c
> +++ b/drivers/iio/dac/ad5064.c
> @@ -464,7 +464,9 @@ static int ad5064_probe(struct device *dev, enum ad5064_type type,
> for (i = 0; i < ad5064_num_vref(st); ++i)
> st->vref_reg[i].supply = ad5064_vref_name(st, i);
>
> - if (dev->of_node) {
> + if (!st->chip_info->internal_vref) {
> + ext_vref = true;
> + } else if (dev->of_node) {
> for (i = 0; ext_vref && i < ad5064_num_vref(st); ++i)
> ext_vref = of_property_read_bool(dev->of_node,
> ad5064_vref_name(st, i));
> @@ -483,11 +485,6 @@ static int ad5064_probe(struct device *dev, enum ad5064_type type,
> if (ret)
> return ret;
> } else {
> - if (!st->chip_info->internal_vref) {
> - dev_err(dev, "No vref available\n");
> - return -ENXIO;
> - }
> -
> st->use_internal_vref = true;
> ret = ad5064_write(st, AD5064_CMD_CONFIG, 0,
> AD5064_CONFIG_INT_VREF_ENABLE, 0);
>
WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Paul Cercueil <paul.cercueil-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>
Cc: Michael Hennerich
<Michael.Hennerich-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>,
Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>,
Hartmut Knaack <knaack.h-Mmb7MZpHnFY@public.gmane.org>,
Peter Meerwald <pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
Ian Campbell
<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 3/3] iio: ad5064: Always use external vref if there is no internal vref
Date: Sun, 4 Oct 2015 14:52:22 +0100 [thread overview]
Message-ID: <56112F16.5090307@kernel.org> (raw)
In-Reply-To: <1443789702-24945-3-git-send-email-paul.cercueil-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>
On 02/10/15 13:41, Paul Cercueil wrote:
> If the device does not have an internal reference, there is no
> other choice but to use the external reference. In that case,
> it does not make much sense to have to specify it.
>
> This patch ensures that the external reference is used if the
> device does not feature an internal reference.
>
> Signed-off-by: Paul Cercueil <paul.cercueil-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>
Other than the issue the autobuilder found I'm happy enough
with the series.
Given it is Lars' driver I'd like him to take a look as well
before I apply it.
Thanks,
Jonathan
> ---
> drivers/iio/dac/ad5064.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/iio/dac/ad5064.c b/drivers/iio/dac/ad5064.c
> index 7146f42..daee39e 100644
> --- a/drivers/iio/dac/ad5064.c
> +++ b/drivers/iio/dac/ad5064.c
> @@ -464,7 +464,9 @@ static int ad5064_probe(struct device *dev, enum ad5064_type type,
> for (i = 0; i < ad5064_num_vref(st); ++i)
> st->vref_reg[i].supply = ad5064_vref_name(st, i);
>
> - if (dev->of_node) {
> + if (!st->chip_info->internal_vref) {
> + ext_vref = true;
> + } else if (dev->of_node) {
> for (i = 0; ext_vref && i < ad5064_num_vref(st); ++i)
> ext_vref = of_property_read_bool(dev->of_node,
> ad5064_vref_name(st, i));
> @@ -483,11 +485,6 @@ static int ad5064_probe(struct device *dev, enum ad5064_type type,
> if (ret)
> return ret;
> } else {
> - if (!st->chip_info->internal_vref) {
> - dev_err(dev, "No vref available\n");
> - return -ENXIO;
> - }
> -
> st->use_internal_vref = true;
> ret = ad5064_write(st, AD5064_CMD_CONFIG, 0,
> AD5064_CONFIG_INT_VREF_ENABLE, 0);
>
next prev parent reply other threads:[~2015-10-04 13:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-02 12:41 [PATCH 1/3] Documentation: ad5064: Added devicetree bindings documentation Paul Cercueil
2015-10-02 12:41 ` Paul Cercueil
2015-10-02 12:41 ` [PATCH 2/3] iio: ad5064: Explicitly configure whether to use external supply Paul Cercueil
2015-10-02 12:41 ` Paul Cercueil
2015-10-02 13:29 ` kbuild test robot
2015-10-02 13:29 ` kbuild test robot
2015-10-02 12:41 ` [PATCH 3/3] iio: ad5064: Always use external vref if there is no internal vref Paul Cercueil
2015-10-02 12:41 ` Paul Cercueil
2015-10-04 13:52 ` Jonathan Cameron [this message]
2015-10-04 13:52 ` 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=56112F16.5090307@kernel.org \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--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=paul.cercueil@analog.com \
--cc=pawel.moll@arm.com \
--cc=pmeerw@pmeerw.net \
--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 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.