Linux-IIO Archive mirror
 help / color / mirror / Atom feed
From: Marc Ferland <marc.ferland@gmail.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org,
	 linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Marc Ferland <marc.ferland@sonatest.com>
Subject: Re: [PATCH] iio: dac: ad5592r: fix temperature scale
Date: Tue, 30 Apr 2024 10:26:38 -0400	[thread overview]
Message-ID: <CAMRMzCBva+o5Mgkxue5F3o5AnAokDAXMhCNXqacPOPTGWwisCQ@mail.gmail.com> (raw)
In-Reply-To: <20240430145935.0000055d@Huawei.com>

On Tue, Apr 30, 2024 at 9:59 AM Jonathan Cameron
<Jonathan.Cameron@huawei.com> wrote:
>
> On Tue, 30 Apr 2024 09:13:30 -0400
> marc.ferland@gmail.com wrote:
>
> > From: Marc Ferland <marc.ferland@sonatest.com>
> >
> > For temperature readings, the remainder is returned as nano Celsius
> > _but_ we mark it as IIO_VAL_INT_PLUS_MICRO. This results in incorrect
> > temperature reporting through hwmon for example. I have a board here
> > which reports the following when running 'sensors':
> >
> > iio_hwmon-isa-0000
> > Adapter: ISA adapter
> > temp1:        +93.3°C
> >
> > With the patch applied, it returns the correct temperature:
> >
> > iio_hwmon-isa-0000
> > Adapter: ISA adapter
> > temp1:        +30.5°C
> >
> > Signed-off-by: Marc Ferland <marc.ferland@sonatest.com>
>
> IIO temperature units are milli celcius, so I'm not following
> the argument here.  The driver might be reporting in pico celcius
> I suppose?  Call out that this is the scale factor though, so
> it corresponds to 1LSB hence a small number is certainly plausible..
>
> Reasonable to argue it's taking the integer and dividing by 10^9 hence
> INT_PLUS_NANO is the right answer, but it isn't nano celsius.
>

Oups! you're obviously right. I'll update my commit message and resend.
Marc

      reply	other threads:[~2024-04-30 14:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-30 13:13 [PATCH] iio: dac: ad5592r: fix temperature scale marc.ferland
2024-04-30 13:59 ` Jonathan Cameron
2024-04-30 14:26   ` Marc Ferland [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMRMzCBva+o5Mgkxue5F3o5AnAokDAXMhCNXqacPOPTGWwisCQ@mail.gmail.com \
    --to=marc.ferland@gmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.ferland@sonatest.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).