All of
 help / color / mirror / Atom feed
From: Linus Walleij <>
To: Chris Lesiak <>
Cc: Jean Delvare <>,
	Guenter Roeck <>,
	"" <>,
	Peter Rosin <>, Jonathan Cameron <>,
	"" <>
Subject: Re: [PATCH v2] hwmon: (ntc_thermistor): try reading processed
Date: Sun, 27 Dec 2020 22:47:47 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Sun, Dec 27, 2020 at 7:54 PM Chris Lesiak <> wrote:
> Linus Walleij <> wrote:
> > But do you agree with the general stance that we should
> > give precedence to using iio_read_channel_processed()
> > and multiply the result with 1000? It should work with
> > any driver I think.
> In order to preserve resolution of the microVolt value for existing code,

Aha you mean that iio_read_channel_processed() loses
precision when converting raw to scaled?

> I'd prefer a solution similar to the existing implementation of
> iio_read_channel_processed.

That seems like the wrong way to work around a problem in
the core.

If iio_read_channel_processed() loses precision we should
fix iio_read_channel_processed() and not try to work around
the problem in the consumers.

It's fine to fix all the consumers in the kernel.

What about changing the signature of:

int iio_read_channel_processed(struct iio_channel *chan, int *val)


int iio_read_channel_processed(struct iio_channel *chan, int *val,
unsigned int scale)

And just augment all calls to pass 1 except the ntc driver
which then passes 1000 in the last argument?

If Jonathan agrees I can fix a patch to alter all the ~50
call sites like this and include the change to this NTC

Linus Walleij

  reply	other threads:[~2020-12-27 21:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-24  1:16 [PATCH v2] hwmon: (ntc_thermistor): try reading processed Linus Walleij
2020-12-24  1:39 ` Chris Lesiak
2020-12-24  3:15   ` Chris Lesiak
2020-12-25 23:01     ` Linus Walleij
2020-12-25 22:55   ` Linus Walleij
2020-12-26  1:45     ` Chris Lesiak
2020-12-27 13:46       ` Linus Walleij
2020-12-27 18:54         ` Chris Lesiak
2020-12-27 21:47           ` Linus Walleij [this message]
2020-12-27 22:08             ` Chris Lesiak
2020-12-29 14:25               ` Jonathan Cameron
2020-12-29 16:33                 ` Guenter Roeck
2020-12-29 16:53                   ` Jonathan Cameron

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:

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

  git send-email \
    --in-reply-to='' \ \ \ \ \ \ \ \ \

* 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.