linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Lesiak <chris.lesiak@licor.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	Guenter Roeck <linux@roeck-us.net>
Cc: Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, Peter Rosin <peda@axentia.se>,
	Jonathan Cameron <jic23@cam.ac.uk>,
	linux-iio <linux-iio@vger.kernel.org>
Subject: Re: [PATCH] hwmon: (ntc_thermistor): try reading processed
Date: Wed, 23 Dec 2020 16:39:12 -0600	[thread overview]
Message-ID: <16895f93-d717-9213-9ed2-21531673d41b@licor.com> (raw)
In-Reply-To: <CACRpkdZTVAoDbbJqTJbxv1ZDyAMsB_h9TAdKKbxqBYGp4-b_jg@mail.gmail.com>

First, let me apologize if some of you may have received an
earlier version as HTML.

I forgot that I was in my web email client.


On 12/23/20 3:08 PM, Linus Walleij wrote:
> Then commit 0315253b19bbc63eedad2f6125c21e280c76e29b
> "hwmon: (ntc_thermistor) fix iio raw to microvolts conversion"
> calls iio_convert_raw_to_processed() to get around the 12
> bit assumption, instead adding a 1000x scale assumption
> on the value passed in from the raw read. This just looks
> wrong, why would it be 1000 and not 1 like the IIO core does
> when we call iio_read_channel_processed()? It looks like it is
> actually compensating for a bug in the ADC returning
> the wrong scale: the author may have used a buggy ADC
> driver return a scaling to volts instead of millivolts and then this
> was a trial-and-error solution to that bug in the ADC
> driver.
>
> In that case it would be nice to know which ADC driver,
> so we can fix it! I suspect maybe an out-of-tree ADC?

I'm the author ofcommit 0315253b19bbc63eedad2f6125c21e280c76e29b
"hwmon: (ntc_thermistor) fix iio raw to microvolts conversion".

The 1000X scaling was not to get around a bad ADC driver that returns
volts instead of millivolts; it was to convert millivolts to microvolts.
The function ntc_adc_iio_read needs to return microvolts.


  parent reply	other threads:[~2020-12-23 22:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-19 22:41 [PATCH] hwmon: (ntc_thermistor): try reading processed Linus Walleij
2020-12-21 16:15 ` Guenter Roeck
2020-12-23 21:08   ` Linus Walleij
2020-12-23 21:42     ` Guenter Roeck
2020-12-24  0:47       ` Linus Walleij
2020-12-23 22:39     ` Chris Lesiak [this message]
     [not found]     ` <SN6PR08MB5565DD42F17BA93D362DB95B9ADE0@SN6PR08MB5565.namprd08.prod.outlook.com>
2020-12-24  0:39       ` Linus Walleij

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=16895f93-d717-9213-9ed2-21531673d41b@licor.com \
    --to=chris.lesiak@licor.com \
    --cc=jdelvare@suse.com \
    --cc=jic23@cam.ac.uk \
    --cc=linus.walleij@linaro.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=peda@axentia.se \
    /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 NNTP newsgroup(s).