linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] iio: humidity: hdc3020: fix temperature offset
@ 2024-01-26 13:52 Dimitri Fedrau
  2024-01-27 14:40 ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Dimitri Fedrau @ 2024-01-26 13:52 UTC (permalink / raw)
  Cc: Dimitri Fedrau, Nuno Sa, Javier Carrasco, Li peiyu,
	Jonathan Cameron, Lars-Peter Clausen, linux-iio, linux-kernel

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")
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: Dimitri Fedrau <dima.fedrau@gmail.com>
---
Changes in V2:
- Added Fixes: tag

 drivers/iio/humidity/hdc3020.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/humidity/hdc3020.c b/drivers/iio/humidity/hdc3020.c
index 4e3311170725..ed70415512f6 100644
--- a/drivers/iio/humidity/hdc3020.c
+++ b/drivers/iio/humidity/hdc3020.c
@@ -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.39.2


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

* Re: [PATCH v2] iio: humidity: hdc3020: fix temperature offset
  2024-01-26 13:52 [PATCH v2] iio: humidity: hdc3020: fix temperature offset Dimitri Fedrau
@ 2024-01-27 14:40 ` Jonathan Cameron
  2024-01-27 21:16   ` Dimitri Fedrau
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2024-01-27 14:40 UTC (permalink / raw)
  To: Dimitri Fedrau
  Cc: Nuno Sa, Javier Carrasco, Li peiyu, Lars-Peter Clausen, linux-iio,
	linux-kernel

On Fri, 26 Jan 2024 14:52:26 +0100
Dimitri Fedrau <dima.fedrau@gmail.com> 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

> Reviewed-by: Nuno Sa <nuno.sa@analog.com>
> Signed-off-by: Dimitri Fedrau <dima.fedrau@gmail.com>
> ---
> Changes in V2:
> - Added Fixes: tag
> 
>  drivers/iio/humidity/hdc3020.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/humidity/hdc3020.c b/drivers/iio/humidity/hdc3020.c
> index 4e3311170725..ed70415512f6 100644
> --- a/drivers/iio/humidity/hdc3020.c
> +++ b/drivers/iio/humidity/hdc3020.c
> @@ -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:


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

* Re: [PATCH v2] iio: humidity: hdc3020: fix temperature offset
  2024-01-27 14:40 ` Jonathan Cameron
@ 2024-01-27 21:16   ` Dimitri Fedrau
  0 siblings, 0 replies; 3+ messages in thread
From: Dimitri Fedrau @ 2024-01-27 21:16 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Nuno Sa, Javier Carrasco, Li peiyu, Lars-Peter Clausen, linux-iio,
	linux-kernel

Am Sat, Jan 27, 2024 at 02:40:55PM +0000 schrieb Jonathan Cameron:
> On Fri, 26 Jan 2024 14:52:26 +0100
> Dimitri Fedrau <dima.fedrau@gmail.com> 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?
>
Yes, picked up the only commit with <>. It is fixed now.
> I've fixed it up here as well.
> 
Thanks.

> Applied to the fixes-togreg branch of iio.git.
> 
> Jonathan
>
Dimitri

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

end of thread, other threads:[~2024-01-27 21:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-26 13:52 [PATCH v2] iio: humidity: hdc3020: fix temperature offset Dimitri Fedrau
2024-01-27 14:40 ` Jonathan Cameron
2024-01-27 21:16   ` Dimitri Fedrau

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