Skip to contentSkip to conversation

iio: atlas-ezo: Fix humidity channel read support

PATCH In review Nikhil Gautam 5 participants 11 messages Oct 12 – Oct 18 IIO

lore
Share & tools
lore
#0 lore raw

cover iio: atlas-ezo: Fix humidity channel read support

The atlas_ezo_read_raw() function currently rejects channels whose type is not IIO_CONCENTRATION. As a result, the relative humidity channel cannot access the raw or scale values, even though the driver defines support for IIO_HUMIDITYRELATIVE.

Remove the early channel type check so that both concentration and relative humidity channels can be handled by the existing mask-specific logic.

Nikhil Gautam (1):
iio: atlas-ezo: Fix humidity channel read support

 drivers/iio/chemical/atlas-ezo-sensor.c | 3 ---
 1 file changed, 3 deletions(-)
Signature · 1 line
2.39.5
#1 lore raw

PATCH 1/1 iio: atlas-ezo: Fix humidity channel read support

The atlas_ezo_read_raw() function rejects channels that are not of type IIO_CONCENTRATION, preventing the relative humidity channel from reading raw and scale values.

Remove the early channel type check to allow both concentration and relative humidity channels to reach the mask-specific handling.

---
 drivers/iio/chemical/atlas-ezo-sensor.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/iio/chemical/atlas-ezo-sensor.c +0 -3
index de0b87edd188..ee939e74bdae 100644
@@ -117,9 +117,6 @@ static int atlas_ezo_read_raw(struct iio_dev *indio_dev,
 	struct atlas_ezo_data *data = iio_priv(indio_dev);
 	struct i2c_client *client = data->client;
 
-	if (chan->type != IIO_CONCENTRATION)
-		return -EINVAL;
-
 	switch (mask) {
 	case IIO_CHAN_INFO_RAW: {
 		int ret;
Signature · 1 line
2.39.5
Reviewed-by on v1 1/1
#2 lore raw
Quoted 9 lines · On Mon, 12 Oct 2026 17:15:53 +0530 Nikhil Gautam <[email protected]> wrote:

The atlas_ezo_read_raw() function rejects channels that are not of type IIO_CONCENTRATION, preventing the relative humidity channel from reading raw and scale values.

Remove the early channel type check to allow both concentration and relative humidity channels to reach the mask-specific handling.

---

What a weird check...

Additionally, Sashiko found a potential I2C read issue, please check it out.

https://sashiko.dev/#/patchset/20261012114553.3327-1-nikhilgtr%40gmail.com

Signature · 2 lines
Kind regards,
Joshua Crofts
#3 lore raw
In reply to Nikhil Gautam
Quoted 6 lines · Nikhil Gautam

The atlas_ezo_read_raw() function rejects channels that are not of type IIO_CONCENTRATION, preventing the relative humidity channel from reading raw and scale values.

Remove the early channel type check to allow both concentration and relative humidity channels to reach the mask-specific handling.

Have you checked the Git history on this change? Anything interesting there?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#4 lore raw

Hi Joshua, Andy,

Thanks for the review and feedback.

I checked the Git history and found that the channel type check was already present in commit dc3ebfc ("iio: chemical: atlas-ezo-sensor: add humidity sensor support"). It was not removed when humidity sensor support was introduced, and
I couldn't find any commit message explaining the original intent of the check.

Regarding the potential I2C read issue reported by Sashiko, I'll investigate it and address it in a separate patch series.

I'll also omit the cover letter for future single-patch submissions.

Thanks,
Nikhil

Quoted 9 lines · Andy Shevchenko
Quoted 6 lines · Nikhil Gautam

The atlas_ezo_read_raw() function rejects channels that are not of type IIO_CONCENTRATION, preventing the relative humidity channel from reading raw and scale values.

Remove the early channel type check to allow both concentration and relative humidity channels to reach the mask-specific handling.

Have you checked the Git history on this change? Anything interesting there?

maintainer
#5 lore raw
Quoted 12 lines · On Tue, 13 Oct 2026 22:15:23 +0530 Nikhil Gautam <[email protected]> wrote:

Hi Joshua, Andy,

Thanks for the review and feedback.

I checked the Git history and found that the channel type check was already present
in commit dc3ebfc ("iio: chemical: atlas-ezo-sensor: add humidity sensor support").
It was not removed when humidity sensor support was introduced, and I couldn't find any commit message explaining the original intent of the check.

Quoted 4 lines

Regarding the potential I2C read issue reported by Sashiko, I'll investigate it and address it in a separate patch series.

I'll also omit the cover letter for future single-patch submissions.

Matt normally gets back reasonably quickly so +CC but I'll assume this is just one of those last minute editing errors and apply the fix in the meantime.

So applied to the fxies-togreg branch of iio.git and marked for stable.

Thanks,

Jonathan

Quoted 15 lines

Thanks,
Nikhil

Quoted 9 lines · Andy Shevchenko
Quoted 6 lines · Nikhil Gautam

The atlas_ezo_read_raw() function rejects channels that are not of type IIO_CONCENTRATION, preventing the relative humidity channel from reading raw and scale values.

Remove the early channel type check to allow both concentration and relative humidity channels to reach the mask-specific handling.

Have you checked the Git history on this change? Anything interesting there?

maintainer
#6 lore raw
Quoted 18 lines · On Sun, 18 Oct 2026 00:31:29 +0100 Jonathan Cameron <[email protected]> wrote:
Quoted 15 lines · On Tue, 13 Oct 2026 22:15:23 +0530 Nikhil Gautam <[email protected]> wrote:

Hi Joshua, Andy,

Thanks for the review and feedback.

I checked the Git history and found that the channel type check was already present
in commit dc3ebfc ("iio: chemical: atlas-ezo-sensor: add humidity sensor support").
It was not removed when humidity sensor support was introduced, and I couldn't find any commit message explaining the original intent of the check.

Regarding the potential I2C read issue reported by Sashiko, I'll investigate it and address it in a separate patch series.

Quoted 7 lines
Quoted 1 line

I'll also omit the cover letter for future single-patch submissions.

Matt normally gets back reasonably quickly so +CC but I'll assume this is just one of those last minute editing errors and apply the fix in the meantime.

So applied to the fxies-togreg branch of iio.git and marked for stable.

fixes-togreg that is.

I also added the missing fixes tag to point to the introduction of the humidity sensor.

J

Quoted 22 lines

Thanks,

Jonathan

Quoted 15 lines

Thanks,
Nikhil

Quoted 9 lines · Andy Shevchenko
Quoted 6 lines · Nikhil Gautam

The atlas_ezo_read_raw() function rejects channels that are not of type IIO_CONCENTRATION, preventing the relative humidity channel from reading raw and scale values.

Remove the early channel type check to allow both concentration and relative humidity channels to reach the mask-specific handling.

Have you checked the Git history on this change? Anything interesting there?

Reviewed-by
#7 lore raw
In reply to Jonathan Cameron
Quoted 15 lines · Jonathan Cameron
Quoted 12 lines · On Tue, 13 Oct 2026 22:15:23 +0530 Nikhil Gautam <[email protected]> wrote:

Hi Joshua, Andy,

Thanks for the review and feedback.

I checked the Git history and found that the channel type check was already present
in commit dc3ebfc ("iio: chemical: atlas-ezo-sensor: add humidity sensor support").
It was not removed when humidity sensor support was introduced, and I couldn't find any commit message explaining the original intent of the check.

Quoted 8 lines
Quoted 4 lines

Regarding the potential I2C read issue reported by Sashiko, I'll investigate it and address it in a separate patch series.

I'll also omit the cover letter for future single-patch submissions.

Matt normally gets back reasonably quickly so +CC but I'll assume this is just one of those last minute editing errors and apply the fix in the meantime.

Yeah this was probably an oversight on my part. Since the humidity sensor support came later, and don't think I actually ever had this EVO sensor. So the patch LGTM.

Quoted 24 lines

So applied to the fxies-togreg branch of iio.git and marked for stable.

Thanks,

Jonathan

Quoted 15 lines

Thanks,
Nikhil

Quoted 9 lines · Andy Shevchenko
Quoted 6 lines · Nikhil Gautam

The atlas_ezo_read_raw() function rejects channels that are not of type IIO_CONCENTRATION, preventing the relative humidity channel from reading raw and scale values.

Remove the early channel type check to allow both concentration and relative humidity channels to reach the mask-specific handling.

Have you checked the Git history on this change? Anything interesting there?

maintainer
#8 lore raw
Quoted 22 lines · On Sun, 18 Oct 2026 02:28:01 +0000 Matt Ranostay <[email protected]> wrote:
Quoted 20 lines · Jonathan Cameron
Quoted 16 lines · On Tue, 13 Oct 2026 22:15:23 +0530 Nikhil Gautam <[email protected]> wrote:

Hi Joshua, Andy,

Thanks for the review and feedback.

I checked the Git history and found that the channel type check was already present
in commit dc3ebfc ("iio: chemical: atlas-ezo-sensor: add humidity sensor support").
It was not removed when humidity sensor support was introduced, and I couldn't find any commit message explaining the original intent of the check.

Regarding the potential I2C read issue reported by Sashiko, I'll investigate it and address it in a separate patch series.

I'll also omit the cover letter for future single-patch submissions.

Quoted 8 lines
Quoted 3 lines

Matt normally gets back reasonably quickly so +CC but I'll assume this is just one of those last minute editing errors and apply the fix in the meantime.

Yeah this was probably an oversight on my part. Since the humidity sensor support came later, and don't think I actually ever had this EVO sensor. So the patch LGTM.

Thanks and tag added.

J

Quoted 25 lines
Quoted 25 lines

So applied to the fxies-togreg branch of iio.git and marked for stable.

Thanks,

Jonathan

Quoted 15 lines

Thanks,
Nikhil

Quoted 9 lines · Andy Shevchenko
Quoted 6 lines · Nikhil Gautam

The atlas_ezo_read_raw() function rejects channels that are not of type IIO_CONCENTRATION, preventing the relative humidity channel from reading raw and scale values.

Remove the early channel type check to allow both concentration and relative humidity channels to reach the mask-specific handling.

Have you checked the Git history on this change? Anything interesting there?

#9 lore raw
In reply to Nikhil Gautam
Quoted 5 lines · On Mon, 12 Oct 2026 17:15:52 +0530 Nikhil Gautam <[email protected]> wrote:

The atlas_ezo_read_raw() function currently rejects channels whose type is not IIO_CONCENTRATION. As a result, the relative humidity channel cannot access the raw or scale values, even though the driver defines support for IIO_HUMIDITYRELATIVE.

Quoted 9 lines

Remove the early channel type check so that both concentration and relative humidity channels can be handled by the existing mask-specific logic.

Nikhil Gautam (1):
iio: atlas-ezo: Fix humidity channel read support

 drivers/iio/chemical/atlas-ezo-sensor.c | 3 ---
 1 file changed, 3 deletions(-)

No need to add a cover letter if you're just sending one patch.

Thanks.

Signature · 2 lines
Kind regards,
Joshua Crofts
#10 lore raw
In reply to Nikhil Gautam
Quoted 7 lines · Nikhil Gautam

The atlas_ezo_read_raw() function currently rejects channels whose type is not IIO_CONCENTRATION. As a result, the relative humidity channel cannot access the raw or scale values, even though the driver defines support for IIO_HUMIDITYRELATIVE.

Remove the early channel type check so that both concentration and relative humidity channels can be handled by the existing mask-specific logic.

Cover letter is not required for a single patch. Anything you want to say can be added in the comment block (after '---' cutter line).

Signature · 2 lines
With Best Regards,
Andy Shevchenko