Skip to contentSkip to conversation

iio: humidity: hdc3020: fix temperature offset

PATCH Applied Dimitri Fedrau 2 participants 3 messages Jan 26, 2024 – Jan 27, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 iio: humidity: hdc3020: fix temperature offset

The temperature offset should be negative according to the datasheet. Adding a minus to the existing offset results in correct temperature calculations.

Fixes <c9180b8e39be> ("iio: humidity: Add driver for ti HDC302x humidity sensors")

---
Changes in V2:
- Added Fixes: tag

 drivers/iio/humidity/hdc3020.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/humidity/hdc3020.c +1 -1
index 4e3311170725..ed70415512f6 100644
@@ -322,7 +322,7 @@ static int hdc3020_read_raw(struct iio_dev *indio_dev,
 		if (chan->type != IIO_TEMP)
 			return -EINVAL;
 
-		*val = 16852;
+		*val = -16852;
 		return IIO_VAL_INT;
 
 	default:
Signature · 1 line
2.39.2
maintainer Applied
#1 lore raw
Quoted 5 lines · On Fri, 26 Jan 2024 14:52:26 +0100 Dimitri Fedrau <[email protected]> wrote:

The temperature offset should be negative according to the datasheet. Adding a minus to the existing offset results in correct temperature calculations.

Fixes <c9180b8e39be> ("iio: humidity: Add driver for ti HDC302x humidity sensors")

<> are not part of the fixes tag syntax. I guess you saw the one case of that which was in my tree earlier in the week and I've now fixed up?

I've fixed it up here as well.

Applied to the fixes-togreg branch of iio.git.

Jonathan

Quoted 22 lines

---
Changes in V2:
- Added Fixes: tag

 drivers/iio/humidity/hdc3020.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/humidity/hdc3020.c +1 -1
index 4e3311170725..ed70415512f6 100644
@@ -322,7 +322,7 @@ static int hdc3020_read_raw(struct iio_dev *indio_dev,
 		if (chan->type != IIO_TEMP)
 			return -EINVAL;
 
-		*val = 16852;
+		*val = -16852;
 		return IIO_VAL_INT;
 
 	default:
#2 lore raw

Am Sat, Jan 27, 2024 at 02:40:55PM +0000 schrieb Jonathan Cameron:

Quoted 7 lines
Quoted 4 lines · On Fri, 26 Jan 2024 14:52:26 +0100 Dimitri Fedrau <[email protected]> wrote:

The temperature offset should be negative according to the datasheet. Adding a minus to the existing offset results in correct temperature calculations.

Quoted 6 lines
Quoted 1 line
Fixes <c9180b8e39be> ("iio: humidity: Add driver for ti HDC302x humidity sensors")

<> are not part of the fixes tag syntax. I guess you saw the one case of that which was in my tree earlier in the week and I've now fixed up?

Yes, picked up the only commit with <>. It is fixed now.

Quoted 2 lines

I've fixed it up here as well.

Thanks.

Quoted 4 lines

Applied to the fixes-togreg branch of iio.git.

Jonathan

Dimitri