Skip to contentSkip to conversation

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

PATCH In review Matt Ranostay 3 participants 5 messages Apr 19, 2020 – Apr 25, 2020 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: chemical: atlas-sensor: correct DO-SM channels

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.

---
 drivers/iio/chemical/atlas-sensor.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/iio/chemical/atlas-sensor.c +13 -1
index 82d470561ad3..7b199ce16ecf 100644
@@ -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,
Signature · 1 line
2.20.1
#1 lore raw
Quoted 5 lines · On Mon, 20 Apr 2020 02:28:47 +0300 Matt Ranostay <[email protected]>…

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 tag?

J

Quoted 30 lines
---
 drivers/iio/chemical/atlas-sensor.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

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[] = {

drivers/iio/chemical/atlas-sensor.c +5 -1
-	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),

drivers/iio/chemical/atlas-sensor.c +8 -0
+		.scan_index = 0,
+		.scan_type = {
+			.sign = 'u',
+			.realbits = 32,
+			.storagebits = 32,
+			.endianness = IIO_BE,
+		},
+	},
 	IIO_CHAN_SOFT_TIMESTAMP(1),
 	{
 		.type = IIO_TEMP,
#2 lore raw
Quoted 8 lines · Jonathan Cameron
Quoted 4 lines · On Mon, 20 Apr 2020 02:28:47 +0300 Matt Ranostay <[email protected]>…

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)
Quoted 36 lines
Quoted 1 line

Fixes tag?

J

Quoted 30 lines
---
 drivers/iio/chemical/atlas-sensor.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

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[] = {

drivers/iio/chemical/atlas-sensor.c +5 -1
-     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),

drivers/iio/chemical/atlas-sensor.c +8 -0
+             .scan_index = 0,
+             .scan_type = {
+                     .sign = 'u',
+                     .realbits = 32,
+                     .storagebits = 32,
+                     .endianness = IIO_BE,
+             },
+     },
      IIO_CHAN_SOFT_TIMESTAMP(1),
      {
              .type = IIO_TEMP,
#3 lore raw
Quoted 7 lines · Matt Ranostay
Quoted 4 lines · Jonathan Cameron

On Mon, 20 Apr 2020 02:28:47 +0300
Matt Ranostay <[email protected]> wrote:

Quoted 6 lines
Quoted 4 lines
Quoted 4 lines

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)
Quoted 37 lines
Quoted 37 lines
Quoted 2 lines

Fixes tag?

J

Quoted 30 lines
---
 drivers/iio/chemical/atlas-sensor.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

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[] = {

drivers/iio/chemical/atlas-sensor.c +5 -1
-     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),

drivers/iio/chemical/atlas-sensor.c +8 -0
+             .scan_index = 0,
+             .scan_type = {
+                     .sign = 'u',
+                     .realbits = 32,
+                     .storagebits = 32,
+                     .endianness = IIO_BE,
+             },
+     },
      IIO_CHAN_SOFT_TIMESTAMP(1),
      {
              .type = IIO_TEMP,
maintainer
#4 lore raw
Quoted 14 lines · On Wed, 22 Apr 2020 20:43:15 -0700 Matt Ranostay <[email protected]>…
Quoted 12 lines · Matt Ranostay
Quoted 8 lines · Jonathan Cameron
Quoted 4 lines · On Mon, 20 Apr 2020 02:28:47 +0300 Matt Ranostay <[email protected]>…

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.

Quoted 5 lines
Quoted 1 line
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

Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
Quoted 3 lines

Fixes tag?

J

Quoted 30 lines
---
 drivers/iio/chemical/atlas-sensor.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

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[] = {

drivers/iio/chemical/atlas-sensor.c +5 -1
-     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),

drivers/iio/chemical/atlas-sensor.c +8 -0
+             .scan_index = 0,
+             .scan_type = {
+                     .sign = 'u',
+                     .realbits = 32,
+                     .storagebits = 32,
+                     .endianness = IIO_BE,
+             },
+     },
      IIO_CHAN_SOFT_TIMESTAMP(1),
      {
              .type = IIO_TEMP,