mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Antoniu Miclaus" <antoniu.miclaus@analog.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/5] iio: amplifiers: ada4250: use devm_regulator_get_enable_read_voltage()
Date: Thu, 12 Jun 2025 10:31:04 -0500	[thread overview]
Message-ID: <fcd1af23-7d8b-4a0f-bae1-5a60f8876269@baylibre.com> (raw)
In-Reply-To: <aErQEn5sdf25Vlvi@smile.fi.intel.com>

On 6/12/25 8:03 AM, Andy Shevchenko wrote:
> On Wed, Jun 11, 2025 at 04:33:03PM -0500, David Lechner wrote:
>> Use devm_regulator_get_enable_read_voltage() to simplify the code.
>>
>> Replace 1000000 with MICRO while we are touching this for better
>> readability.
> 
> ...
> 
>> -	voltage_v = DIV_ROUND_CLOSEST(voltage_v, 1000000);
>> +	voltage_v = DIV_ROUND_CLOSEST(st->avdd_uv, MICRO);
> 
> Side note. I'm always worry about CLOSEST choice when it's related to voltage
> or current. Imagine the table which gives you 5, 3.3, and 1.2. If it happens to
> be closest to higher value, it may damage HW forever.
> 

The rounding to volts seems strange to me too, but I could not find a public
datasheet for this part, so I wasn't able to determine what the "right" thing
to do is. It sounds like this is just some sort of small gain/offset calibration,
so I don't think there is any serious problem here, like it could damage the part.
So I will have to leave it to someone with the part and the datasheet to figure
out if there is actually a problem here.

  reply	other threads:[~2025-06-12 15:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-11 21:33 [PATCH v3 0/5] iio: amplifiers: ada4250: various cleanups David Lechner
2025-06-11 21:33 ` [PATCH v3 1/5] iio: amplifiers: ada4250: used dev local variable David Lechner
2025-06-11 21:33 ` [PATCH v3 2/5] iio: amplifiers: ada4250: don't fail on bad chip ID David Lechner
2025-06-11 21:33 ` [PATCH v3 3/5] iio: amplifiers: ada4250: use devm_regulator_get_enable_read_voltage() David Lechner
2025-06-12 13:03   ` Andy Shevchenko
2025-06-12 15:31     ` David Lechner [this message]
2025-06-11 21:33 ` [PATCH v3 4/5] iio: amplifiers: ada4250: move offset_uv in struct David Lechner
2025-06-12 13:04   ` Andy Shevchenko
2025-06-12 15:31     ` David Lechner
2025-06-12 18:34       ` Andy Shevchenko
2025-06-12 18:45         ` David Lechner
2025-06-12 18:58           ` Andy Shevchenko
2025-06-11 21:33 ` [PATCH v3 5/5] iio: amplifiers: ada4250: use dev_err_probe() David Lechner
2025-06-12 13:05   ` Andy Shevchenko
2025-06-12 15:33     ` David Lechner
2025-06-12 13:07 ` [PATCH v3 0/5] iio: amplifiers: ada4250: various cleanups Andy Shevchenko
2025-06-14 12:07   ` 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:
  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=fcd1af23-7d8b-4a0f-bae1-5a60f8876269@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=antoniu.miclaus@analog.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.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

all inboxes | Powered by JetHome®