LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: humidity: hdc3020: fix temperature offset
@ 2024-01-25 10:26 Dimitri Fedrau
  2024-01-25 10:49 ` Nuno Sá
  0 siblings, 1 reply; 4+ messages in thread
From: Dimitri Fedrau @ 2024-01-25 10:26 UTC (permalink / raw
  Cc: Dimitri Fedrau, 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.

Signed-off-by: Dimitri Fedrau <dima.fedrau@gmail.com>
---
 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] 4+ messages in thread

* Re: [PATCH] iio: humidity: hdc3020: fix temperature offset
  2024-01-25 10:26 [PATCH] iio: humidity: hdc3020: fix temperature offset Dimitri Fedrau
@ 2024-01-25 10:49 ` Nuno Sá
  2024-01-25 11:08   ` Dimitri Fedrau
  0 siblings, 1 reply; 4+ messages in thread
From: Nuno Sá @ 2024-01-25 10:49 UTC (permalink / raw
  To: Dimitri Fedrau
  Cc: Javier Carrasco, Li peiyu, Jonathan Cameron, Lars-Peter Clausen,
	linux-iio, linux-kernel

Hi Dimitri,

On Thu, 2024-01-25 at 11:26 +0100, Dimitri Fedrau wrote:
> The temperature offset should be negative according to the datasheet.
> Adding a minus to the existing offset results in correct temperature
> calculations.
> 
> Signed-off-by: Dimitri Fedrau <dima.fedrau@gmail.com>
> ---

This is a fix. You're missing a Fixes: tag in your commit message.
git log --grep="Fixes:" should give you some examples...

With that, feel free to add:

Reviewed-by: Nuno Sa <nuno.sa@analog.com>

>  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] 4+ messages in thread

* Re: [PATCH] iio: humidity: hdc3020: fix temperature offset
  2024-01-25 10:49 ` Nuno Sá
@ 2024-01-25 11:08   ` Dimitri Fedrau
  2024-01-27 14:37     ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Dimitri Fedrau @ 2024-01-25 11:08 UTC (permalink / raw
  To: Nuno Sá
  Cc: Javier Carrasco, Li peiyu, Jonathan Cameron, Lars-Peter Clausen,
	linux-iio, linux-kernel

Am Thu, Jan 25, 2024 at 11:49:25AM +0100 schrieb Nuno Sá:
> Hi Dimitri,
>
Hi Nuno,

> On Thu, 2024-01-25 at 11:26 +0100, Dimitri Fedrau wrote:
> > The temperature offset should be negative according to the datasheet.
> > Adding a minus to the existing offset results in correct temperature
> > calculations.
> > 
> > Signed-off-by: Dimitri Fedrau <dima.fedrau@gmail.com>
> > ---
> 
> This is a fix. You're missing a Fixes: tag in your commit message.
> git log --grep="Fixes:" should give you some examples...
>
Will fix this and resend the patch. Thanks for your help.

Best regards,
Dimitri
> With that, feel free to add:
> 
> Reviewed-by: Nuno Sa <nuno.sa@analog.com>
> 
> >  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] 4+ messages in thread

* Re: [PATCH] iio: humidity: hdc3020: fix temperature offset
  2024-01-25 11:08   ` Dimitri Fedrau
@ 2024-01-27 14:37     ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2024-01-27 14:37 UTC (permalink / raw
  To: Dimitri Fedrau
  Cc: Nuno Sá, Javier Carrasco, Li peiyu, Lars-Peter Clausen,
	linux-iio, linux-kernel

On Thu, 25 Jan 2024 12:08:53 +0100
Dimitri Fedrau <dima.fedrau@gmail.com> wrote:

> Am Thu, Jan 25, 2024 at 11:49:25AM +0100 schrieb Nuno Sá:
> > Hi Dimitri,
> >  
> Hi Nuno,
> 
> > On Thu, 2024-01-25 at 11:26 +0100, Dimitri Fedrau wrote:  
> > > The temperature offset should be negative according to the datasheet.
> > > Adding a minus to the existing offset results in correct temperature
> > > calculations.
> > > 
> > > Signed-off-by: Dimitri Fedrau <dima.fedrau@gmail.com>
> > > ---  
> > 
> > This is a fix. You're missing a Fixes: tag in your commit message.
> > git log --grep="Fixes:" should give you some examples...
> >  
> Will fix this and resend the patch. Thanks for your help.
For future reference, you can just send the Fixes tag in a reply
and the b4 tooling most maintainers now use will pick it up
automatically.

Thanks,

Jonathan

> 
> Best regards,
> Dimitri
> > With that, feel free to add:
> > 
> > Reviewed-by: Nuno Sa <nuno.sa@analog.com>
> >   
> > >  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] 4+ messages in thread

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-25 10:26 [PATCH] iio: humidity: hdc3020: fix temperature offset Dimitri Fedrau
2024-01-25 10:49 ` Nuno Sá
2024-01-25 11:08   ` Dimitri Fedrau
2024-01-27 14:37     ` Jonathan Cameron

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 read-only IMAP folder(s) and NNTP newsgroup(s).