linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] iio: mxs-lradc: fix iio channel map regression
@ 2015-01-03 20:34 Stefan Wahren
  2015-01-03 21:08 ` Alexandre Belloni
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Stefan Wahren @ 2015-01-03 20:34 UTC (permalink / raw)
  To: jic23
  Cc: knaack.h, lars, pmeerw, marex, fabio.estevam, alexandre.belloni,
	robert.hodaszi, 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 hidden iio channel 9 to fix this issue.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
Changes in V2:
- define hidden channel instead of a bogus one

 drivers/staging/iio/adc/mxs-lradc.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
index d9d6fad..594684d 100644
--- a/drivers/staging/iio/adc/mxs-lradc.c
+++ b/drivers/staging/iio/adc/mxs-lradc.c
@@ -1413,6 +1413,13 @@ static const struct iio_chan_spec mxs_lradc_chan_spec[] = {
 		.channel = 8,
 		.scan_type = {.sign = 'u', .realbits = 18, .storagebits = 32,},
 	},
+	/* Hidden channel to keep indexes */
+	{
+		.type = IIO_TEMP,
+		.indexed = 1,
+		.scan_index = -1,
+		.channel = 9,
+	},
 	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] 7+ messages in thread

* Re: [PATCH V2] iio: mxs-lradc: fix iio channel map regression
  2015-01-03 20:34 [PATCH V2] iio: mxs-lradc: fix iio channel map regression Stefan Wahren
@ 2015-01-03 21:08 ` Alexandre Belloni
  2015-01-04  0:02 ` Marek Vasut
  2015-01-04 11:04 ` Jonathan Cameron
  2 siblings, 0 replies; 7+ messages in thread
From: Alexandre Belloni @ 2015-01-03 21:08 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: jic23, knaack.h, lars, pmeerw, marex, fabio.estevam,
	robert.hodaszi, linux-iio

Hi,

On 03/01/2015 at 20:34:12 +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 hidden iio channel 9 to fix this issue.
> 
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>

Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

Thanks!

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

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

* Re: [PATCH V2] iio: mxs-lradc: fix iio channel map regression
  2015-01-03 20:34 [PATCH V2] iio: mxs-lradc: fix iio channel map regression Stefan Wahren
  2015-01-03 21:08 ` Alexandre Belloni
@ 2015-01-04  0:02 ` Marek Vasut
  2015-01-04 11:04 ` Jonathan Cameron
  2 siblings, 0 replies; 7+ messages in thread
From: Marek Vasut @ 2015-01-04  0:02 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: jic23, knaack.h, lars, pmeerw, fabio.estevam, alexandre.belloni,
	robert.hodaszi, linux-iio

On Saturday, January 03, 2015 at 09:34:12 PM, 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 hidden iio channel 9 to fix this issue.
> 
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>

Reviewed-by: Marek Vasut <marex@denx.de>

Thanks for spotting this!

Best regards,
Marek Vasut

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

* Re: [PATCH V2] iio: mxs-lradc: fix iio channel map regression
  2015-01-03 20:34 [PATCH V2] iio: mxs-lradc: fix iio channel map regression Stefan Wahren
  2015-01-03 21:08 ` Alexandre Belloni
  2015-01-04  0:02 ` Marek Vasut
@ 2015-01-04 11:04 ` Jonathan Cameron
  2015-01-04 11:39   ` Stefan Wahren
  2 siblings, 1 reply; 7+ messages in thread
From: Jonathan Cameron @ 2015-01-04 11:04 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: knaack.h, lars, pmeerw, marex, fabio.estevam, alexandre.belloni,
	robert.hodaszi, linux-iio

On 03/01/15 20:34, 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 hidden iio channel 9 to fix this issue.
> 
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
I'll have to hold this for a bit.  I'm running rather behind with
pull requests so my fixes tree is still pre the last release and
hence doesn't have the patch that caused the problem yet...

Should unwind that this week.

Jonathan
> ---
> Changes in V2:
> - define hidden channel instead of a bogus one
> 
>  drivers/staging/iio/adc/mxs-lradc.c |    7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
> index d9d6fad..594684d 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -1413,6 +1413,13 @@ static const struct iio_chan_spec mxs_lradc_chan_spec[] = {
>  		.channel = 8,
>  		.scan_type = {.sign = 'u', .realbits = 18, .storagebits = 32,},
>  	},
> +	/* Hidden channel to keep indexes */
> +	{
> +		.type = IIO_TEMP,
> +		.indexed = 1,
> +		.scan_index = -1,
> +		.channel = 9,
> +	},
>  	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
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


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

* Re: [PATCH V2] iio: mxs-lradc: fix iio channel map regression
  2015-01-04 11:04 ` Jonathan Cameron
@ 2015-01-04 11:39   ` Stefan Wahren
  2015-02-01 10:14     ` Jonathan Cameron
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Wahren @ 2015-01-04 11:39 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: pmeerw, robert.hodaszi, knaack.h, lars, alexandre.belloni,
	fabio.estevam, linux-iio, marex

Hi Jonathan,

> Jonathan Cameron <jic23@kernel.org> hat am 4. Januar 2015 um 12:04
> geschrieben:
>
>
> On 03/01/15 20:34, 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 hidden iio channel 9 to fix this issue.
> >
> > Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> I'll have to hold this for a bit. I'm running rather behind with
> pull requests so my fixes tree is still pre the last release and
> hence doesn't have the patch that caused the problem yet...
>
> Should unwind that this week.

i forgot to mention this patch in version 2 is the solution of this old
discussion:

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

So the problem should be in your fixes tree. Sorry for the confusion.

Stefan

>
> Jonathan
> > ---
> > Changes in V2:
> > - define hidden channel instead of a bogus one
> >
> > drivers/staging/iio/adc/mxs-lradc.c | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/drivers/staging/iio/adc/mxs-lradc.c
> > b/drivers/staging/iio/adc/mxs-lradc.c
> > index d9d6fad..594684d 100644
> > --- a/drivers/staging/iio/adc/mxs-lradc.c
> > +++ b/drivers/staging/iio/adc/mxs-lradc.c
> > @@ -1413,6 +1413,13 @@ static const struct iio_chan_spec
> > mxs_lradc_chan_spec[] = {
> > .channel = 8,
> > .scan_type = {.sign = 'u', .realbits = 18, .storagebits = 32,},
> > },
> > + /* Hidden channel to keep indexes */
> > + {
> > + .type = IIO_TEMP,
> > + .indexed = 1,
> > + .scan_index = -1,
> > + .channel = 9,
> > + },
> > 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
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
>

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

* Re: [PATCH V2] iio: mxs-lradc: fix iio channel map regression
  2015-01-04 11:39   ` Stefan Wahren
@ 2015-02-01 10:14     ` Jonathan Cameron
  2015-02-01 17:21       ` Stefan Wahren
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Cameron @ 2015-02-01 10:14 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: pmeerw, robert.hodaszi, knaack.h, lars, alexandre.belloni,
	fabio.estevam, linux-iio, marex

On 04/01/15 11:39, Stefan Wahren wrote:
> Hi Jonathan,
> 
>> Jonathan Cameron <jic23@kernel.org> hat am 4. Januar 2015 um 12:04
>> geschrieben:
>>
>>
>> On 03/01/15 20:34, 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 hidden iio channel 9 to fix this issue.
>>>
>>> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
>> I'll have to hold this for a bit. I'm running rather behind with
>> pull requests so my fixes tree is still pre the last release and
>> hence doesn't have the patch that caused the problem yet...
>>
>> Should unwind that this week.
> 
> i forgot to mention this patch in version 2 is the solution of this old
> discussion:
> 
> https://lkml.org/lkml/2014/6/14/69
> 
> So the problem should be in your fixes tree. Sorry for the confusion.
> 
> Stefan
Being totally useless I seem to have forgotten to apply this.  Given
timing the fastest route now will be to send it out just after the coming
merge window marked for stable.  Applied to the fixes-togreg branch of
iio.git

Thanks and sorry for the delay,

Jonathan
> 
>>
>> Jonathan
>>> ---
>>> Changes in V2:
>>> - define hidden channel instead of a bogus one
>>>
>>> drivers/staging/iio/adc/mxs-lradc.c | 7 +++++++
>>> 1 file changed, 7 insertions(+)
>>>
>>> diff --git a/drivers/staging/iio/adc/mxs-lradc.c
>>> b/drivers/staging/iio/adc/mxs-lradc.c
>>> index d9d6fad..594684d 100644
>>> --- a/drivers/staging/iio/adc/mxs-lradc.c
>>> +++ b/drivers/staging/iio/adc/mxs-lradc.c
>>> @@ -1413,6 +1413,13 @@ static const struct iio_chan_spec
>>> mxs_lradc_chan_spec[] = {
>>> .channel = 8,
>>> .scan_type = {.sign = 'u', .realbits = 18, .storagebits = 32,},
>>> },
>>> + /* Hidden channel to keep indexes */
>>> + {
>>> + .type = IIO_TEMP,
>>> + .indexed = 1,
>>> + .scan_index = -1,
>>> + .channel = 9,
>>> + },
>>> 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
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


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

* Re: [PATCH V2] iio: mxs-lradc: fix iio channel map regression
  2015-02-01 10:14     ` Jonathan Cameron
@ 2015-02-01 17:21       ` Stefan Wahren
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Wahren @ 2015-02-01 17:21 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: pmeerw, robert.hodaszi, knaack.h, lars, alexandre.belloni,
	fabio.estevam, linux-iio, marex

> Jonathan Cameron <jic23@kernel.org> hat am 1. Februar 2015 um 11:14
> geschrieben:
>
>
> On 04/01/15 11:39, Stefan Wahren wrote:
> > Hi Jonathan,
> >
> >> Jonathan Cameron <jic23@kernel.org> hat am 4. Januar 2015 um 12:04
> >> geschrieben:
> >>
> >>
> >> On 03/01/15 20:34, 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 hidden iio channel 9 to fix this issue.
> >>>
> >>> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> >> I'll have to hold this for a bit. I'm running rather behind with
> >> pull requests so my fixes tree is still pre the last release and
> >> hence doesn't have the patch that caused the problem yet...
> >>
> >> Should unwind that this week.
> >
> > i forgot to mention this patch in version 2 is the solution of this old
> > discussion:
> >
> > https://lkml.org/lkml/2014/6/14/69
> >
> > So the problem should be in your fixes tree. Sorry for the confusion.
> >
> > Stefan
> Being totally useless I seem to have forgotten to apply this. Given
> timing the fastest route now will be to send it out just after the coming
> merge window marked for stable. Applied to the fixes-togreg branch of
> iio.git
>
> Thanks and sorry for the delay,
>
> Jonathan
 
Thanks

Stefan

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

end of thread, other threads:[~2015-02-01 17:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-03 20:34 [PATCH V2] iio: mxs-lradc: fix iio channel map regression Stefan Wahren
2015-01-03 21:08 ` Alexandre Belloni
2015-01-04  0:02 ` Marek Vasut
2015-01-04 11:04 ` Jonathan Cameron
2015-01-04 11:39   ` Stefan Wahren
2015-02-01 10:14     ` Jonathan Cameron
2015-02-01 17:21       ` Stefan Wahren

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