linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: mxs-lradc: fix iio channel map regression
@ 2015-01-01 19:11 Stefan Wahren
  2015-01-03 16:53 ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Wahren @ 2015-01-01 19:11 UTC (permalink / raw)
  To: jic23
  Cc: knaack.h, lars, pmeerw, marex, fabio.estevam, alexandre.belloni,
	linux-iio, Stefan Wahren

Since commit c8231a9af8147f8a ("iio: mxs-lradc: compute temperature
from channel 8 and 9") with the removal of adc channel 9 there is
no 1-1 mapping in the channel spec.

All hwmon channel values above 9 are accessible via there index minus
one. So add a "bogus" iio channel 9 to fix this issue.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 drivers/staging/iio/adc/mxs-lradc.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
index d9d6fad..126a07b 100644
--- a/drivers/staging/iio/adc/mxs-lradc.c
+++ b/drivers/staging/iio/adc/mxs-lradc.c
@@ -1413,6 +1413,7 @@ static const struct iio_chan_spec mxs_lradc_chan_spec[] = {
 		.channel = 8,
 		.scan_type = {.sign = 'u', .realbits = 18, .storagebits = 32,},
 	},
+	MXS_ADC_CHAN(9, IIO_VOLTAGE),
 	MXS_ADC_CHAN(10, IIO_VOLTAGE),	/* VDDIO */
 	MXS_ADC_CHAN(11, IIO_VOLTAGE),	/* VTH */
 	MXS_ADC_CHAN(12, IIO_VOLTAGE),	/* VDDA */
--
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: mxs-lradc: fix iio channel map regression
  2015-01-01 19:11 [PATCH] iio: mxs-lradc: fix iio channel map regression Stefan Wahren
@ 2015-01-03 16:53 ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2015-01-03 16:53 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: jic23, knaack.h, lars, pmeerw, marex, fabio.estevam, linux-iio

Hi,

On 01/01/2015 at 19:11:17 +0000, Stefan Wahren wrote :
> Since commit c8231a9af8147f8a ("iio: mxs-lradc: compute temperature
> from channel 8 and 9") with the removal of adc channel 9 there is
> no 1-1 mapping in the channel spec.
> 
> All hwmon channel values above 9 are accessible via there index minus
> one. So add a "bogus" iio channel 9 to fix this issue.
> 

I think the preferred way of doing that was explained there:

https://lkml.org/lkml/2014/6/14/69

Can you take care of that? 

Thanks!

> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> ---
>  drivers/staging/iio/adc/mxs-lradc.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
> index d9d6fad..126a07b 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -1413,6 +1413,7 @@ static const struct iio_chan_spec mxs_lradc_chan_spec[] = {
>  		.channel = 8,
>  		.scan_type = {.sign = 'u', .realbits = 18, .storagebits = 32,},
>  	},
> +	MXS_ADC_CHAN(9, IIO_VOLTAGE),
>  	MXS_ADC_CHAN(10, IIO_VOLTAGE),	/* VDDIO */
>  	MXS_ADC_CHAN(11, IIO_VOLTAGE),	/* VTH */
>  	MXS_ADC_CHAN(12, IIO_VOLTAGE),	/* VDDA */
> --
> 1.7.9.5
> 

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-03 16:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-01 19:11 [PATCH] iio: mxs-lradc: fix iio channel map regression Stefan Wahren
2015-01-03 16:53 ` Alexandre Belloni

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