diff mbox series

iio: chemical: atlas-sensor: correct DO-SM channels

Message ID 20200419232847.32206-1-matt.ranostay@konsulko.com (mailing list archive)
State New, archived
Headers show
Series iio: chemical: atlas-sensor: correct DO-SM channels | expand

Commit Message

Matt Ranostay April 19, 2020, 11:28 p.m. UTC
IIO_CONCENTRATION channel for the DO-SM shouldn't be indexed as
there isn't more than one, and also ATLAS_CONCENTRATION_CHANNEL
macro scan_index define steps on the IIO_TIMESTAMP channel.

Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
---
 drivers/iio/chemical/atlas-sensor.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

Comments

Jonathan Cameron April 22, 2020, 5:27 p.m. UTC | #1
On Mon, 20 Apr 2020 02:28:47 +0300
Matt Ranostay <matt.ranostay@konsulko.com> wrote:

> IIO_CONCENTRATION channel for the DO-SM shouldn't be indexed as
> there isn't more than one, and also ATLAS_CONCENTRATION_CHANNEL
> macro scan_index define steps on the IIO_TIMESTAMP channel.
> 
> Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>

Fixes tag?

J
> ---
>  drivers/iio/chemical/atlas-sensor.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/chemical/atlas-sensor.c
> b/drivers/iio/chemical/atlas-sensor.c index
> 82d470561ad3..7b199ce16ecf 100644 ---
> a/drivers/iio/chemical/atlas-sensor.c +++
> b/drivers/iio/chemical/atlas-sensor.c @@ -194,7 +194,19 @@ static
> const struct iio_chan_spec atlas_orp_channels[] = { };
>  
>  static const struct iio_chan_spec atlas_do_channels[] = {
> -	ATLAS_CONCENTRATION_CHANNEL(0, ATLAS_REG_DO_DATA),
> +	{
> +		.type = IIO_CONCENTRATION,
> +		.address = ATLAS_REG_DO_DATA,
> +		.info_mask_separate =
> +			BIT(IIO_CHAN_INFO_RAW) |
> BIT(IIO_CHAN_INFO_SCALE),
> +		.scan_index = 0,
> +		.scan_type = {
> +			.sign = 'u',
> +			.realbits = 32,
> +			.storagebits = 32,
> +			.endianness = IIO_BE,
> +		},
> +	},
>  	IIO_CHAN_SOFT_TIMESTAMP(1),
>  	{
>  		.type = IIO_TEMP,
Matt Ranostay April 23, 2020, 3:42 a.m. UTC | #2
On Wed, Apr 22, 2020 at 10:27 AM Jonathan Cameron
<Jonathan.Cameron@huawei.com> wrote:
>
> On Mon, 20 Apr 2020 02:28:47 +0300
> Matt Ranostay <matt.ranostay@konsulko.com> wrote:
>
> > IIO_CONCENTRATION channel for the DO-SM shouldn't be indexed as
> > there isn't more than one, and also ATLAS_CONCENTRATION_CHANNEL
> > macro scan_index define steps on the IIO_TIMESTAMP channel.
> >

Fixes: 1a881ed8a43b  (iio: chemical: atlas-sensor: add RTD-SM module support)

> > Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
>
> Fixes tag?
>
> J
> > ---
> >  drivers/iio/chemical/atlas-sensor.c | 14 +++++++++++++-
> >  1 file changed, 13 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/chemical/atlas-sensor.c
> > b/drivers/iio/chemical/atlas-sensor.c index
> > 82d470561ad3..7b199ce16ecf 100644 ---
> > a/drivers/iio/chemical/atlas-sensor.c +++
> > b/drivers/iio/chemical/atlas-sensor.c @@ -194,7 +194,19 @@ static
> > const struct iio_chan_spec atlas_orp_channels[] = { };
> >
> >  static const struct iio_chan_spec atlas_do_channels[] = {
> > -     ATLAS_CONCENTRATION_CHANNEL(0, ATLAS_REG_DO_DATA),
> > +     {
> > +             .type = IIO_CONCENTRATION,
> > +             .address = ATLAS_REG_DO_DATA,
> > +             .info_mask_separate =
> > +                     BIT(IIO_CHAN_INFO_RAW) |
> > BIT(IIO_CHAN_INFO_SCALE),
> > +             .scan_index = 0,
> > +             .scan_type = {
> > +                     .sign = 'u',
> > +                     .realbits = 32,
> > +                     .storagebits = 32,
> > +                     .endianness = IIO_BE,
> > +             },
> > +     },
> >       IIO_CHAN_SOFT_TIMESTAMP(1),
> >       {
> >               .type = IIO_TEMP,
>
Matt Ranostay April 23, 2020, 3:43 a.m. UTC | #3
On Wed, Apr 22, 2020 at 8:42 PM Matt Ranostay
<matt.ranostay@konsulko.com> wrote:
>
> On Wed, Apr 22, 2020 at 10:27 AM Jonathan Cameron
> <Jonathan.Cameron@huawei.com> wrote:
> >
> > On Mon, 20 Apr 2020 02:28:47 +0300
> > Matt Ranostay <matt.ranostay@konsulko.com> wrote:
> >
> > > IIO_CONCENTRATION channel for the DO-SM shouldn't be indexed as
> > > there isn't more than one, and also ATLAS_CONCENTRATION_CHANNEL
> > > macro scan_index define steps on the IIO_TIMESTAMP channel.
> > >
>
> Fixes: 1a881ed8a43b  (iio: chemical: atlas-sensor: add RTD-SM module support)

Oops wrong change for Fixes tag. Sorry about that..

Fixes: a751b8e48018 (iio: chemical: atlas-sensor: add DO-SM module support)

>
> > > Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
> >
> > Fixes tag?
> >
> > J
> > > ---
> > >  drivers/iio/chemical/atlas-sensor.c | 14 +++++++++++++-
> > >  1 file changed, 13 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/iio/chemical/atlas-sensor.c
> > > b/drivers/iio/chemical/atlas-sensor.c index
> > > 82d470561ad3..7b199ce16ecf 100644 ---
> > > a/drivers/iio/chemical/atlas-sensor.c +++
> > > b/drivers/iio/chemical/atlas-sensor.c @@ -194,7 +194,19 @@ static
> > > const struct iio_chan_spec atlas_orp_channels[] = { };
> > >
> > >  static const struct iio_chan_spec atlas_do_channels[] = {
> > > -     ATLAS_CONCENTRATION_CHANNEL(0, ATLAS_REG_DO_DATA),
> > > +     {
> > > +             .type = IIO_CONCENTRATION,
> > > +             .address = ATLAS_REG_DO_DATA,
> > > +             .info_mask_separate =
> > > +                     BIT(IIO_CHAN_INFO_RAW) |
> > > BIT(IIO_CHAN_INFO_SCALE),
> > > +             .scan_index = 0,
> > > +             .scan_type = {
> > > +                     .sign = 'u',
> > > +                     .realbits = 32,
> > > +                     .storagebits = 32,
> > > +                     .endianness = IIO_BE,
> > > +             },
> > > +     },
> > >       IIO_CHAN_SOFT_TIMESTAMP(1),
> > >       {
> > >               .type = IIO_TEMP,
> >
Jonathan Cameron April 25, 2020, 1:37 p.m. UTC | #4
On Wed, 22 Apr 2020 20:43:15 -0700
Matt Ranostay <matt.ranostay@konsulko.com> wrote:

> On Wed, Apr 22, 2020 at 8:42 PM Matt Ranostay
> <matt.ranostay@konsulko.com> wrote:
> >
> > On Wed, Apr 22, 2020 at 10:27 AM Jonathan Cameron
> > <Jonathan.Cameron@huawei.com> wrote:  
> > >
> > > On Mon, 20 Apr 2020 02:28:47 +0300
> > > Matt Ranostay <matt.ranostay@konsulko.com> wrote:
> > >  
> > > > IIO_CONCENTRATION channel for the DO-SM shouldn't be indexed as
> > > > there isn't more than one, and also ATLAS_CONCENTRATION_CHANNEL
> > > > macro scan_index define steps on the IIO_TIMESTAMP channel.
> > > >  
> >
> > Fixes: 1a881ed8a43b  (iio: chemical: atlas-sensor: add RTD-SM module support)  
> 
> Oops wrong change for Fixes tag. Sorry about that..
> 
> Fixes: a751b8e48018 (iio: chemical: atlas-sensor: add DO-SM module support)

So the index thing isn't really a fix as such. It's perfectly valid for
a single channel to be indexed even if not required.  Still it's your
driver so if you prefer it this way fair enough.

The other bit obviously is a fix so I'll just take this whole thing as a
fix.  Applied to the fixes-togreg branch of iio.git

Thanks,

Jonathan

> 
> >  
> > > > Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>  
> > >
> > > Fixes tag?
> > >
> > > J  
> > > > ---
> > > >  drivers/iio/chemical/atlas-sensor.c | 14 +++++++++++++-
> > > >  1 file changed, 13 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/iio/chemical/atlas-sensor.c
> > > > b/drivers/iio/chemical/atlas-sensor.c index
> > > > 82d470561ad3..7b199ce16ecf 100644 ---
> > > > a/drivers/iio/chemical/atlas-sensor.c +++
> > > > b/drivers/iio/chemical/atlas-sensor.c @@ -194,7 +194,19 @@ static
> > > > const struct iio_chan_spec atlas_orp_channels[] = { };
> > > >
> > > >  static const struct iio_chan_spec atlas_do_channels[] = {
> > > > -     ATLAS_CONCENTRATION_CHANNEL(0, ATLAS_REG_DO_DATA),
> > > > +     {
> > > > +             .type = IIO_CONCENTRATION,
> > > > +             .address = ATLAS_REG_DO_DATA,
> > > > +             .info_mask_separate =
> > > > +                     BIT(IIO_CHAN_INFO_RAW) |
> > > > BIT(IIO_CHAN_INFO_SCALE),
> > > > +             .scan_index = 0,
> > > > +             .scan_type = {
> > > > +                     .sign = 'u',
> > > > +                     .realbits = 32,
> > > > +                     .storagebits = 32,
> > > > +                     .endianness = IIO_BE,
> > > > +             },
> > > > +     },
> > > >       IIO_CHAN_SOFT_TIMESTAMP(1),
> > > >       {
> > > >               .type = IIO_TEMP,  
> > >
diff mbox series

Patch

diff --git a/drivers/iio/chemical/atlas-sensor.c b/drivers/iio/chemical/atlas-sensor.c
index 82d470561ad3..7b199ce16ecf 100644
--- a/drivers/iio/chemical/atlas-sensor.c
+++ b/drivers/iio/chemical/atlas-sensor.c
@@ -194,7 +194,19 @@  static const struct iio_chan_spec atlas_orp_channels[] = {
 };
 
 static const struct iio_chan_spec atlas_do_channels[] = {
-	ATLAS_CONCENTRATION_CHANNEL(0, ATLAS_REG_DO_DATA),
+	{
+		.type = IIO_CONCENTRATION,
+		.address = ATLAS_REG_DO_DATA,
+		.info_mask_separate =
+			BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),
+		.scan_index = 0,
+		.scan_type = {
+			.sign = 'u',
+			.realbits = 32,
+			.storagebits = 32,
+			.endianness = IIO_BE,
+		},
+	},
 	IIO_CHAN_SOFT_TIMESTAMP(1),
 	{
 		.type = IIO_TEMP,