Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1239120

Re: [PATCH 3/3] iio: ad5064: Always use external vref if there is no internal vref

From Jonathan Cameron <jic23@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 3/3] iio: ad5064: Always use external vref if there is no internal vref
Date 2015-10-04 16:00 +0200
Message-ID <qfRZv-27w-1@gated-at.bofh.it> (permalink)
References <qfRZw-27w-3@gated-at.bofh.it> <qfRZw-27w-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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);
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH 3/3] iio: ad5064: Always use external vref if there is no  internal vref Jonathan Cameron <jic23@kernel.org> - 2015-10-04 16:00 +0200

csiph-web