[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240224174246.63598681@jic23-huawei>
Date: Sat, 24 Feb 2024 17:42:46 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Dumitru Ceclan <mitrutzceclan@...il.com>
Cc: Lars-Peter Clausen <lars@...afoo.de>, Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>, Conor Dooley
<conor+dt@...nel.org>, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org, Ceclan Dumitru
<dumitru.ceclan@...log.com>
Subject: Re: [PATCH v5 3/5] iio: amplifiers: hmc425a: move conversion logic
On Tue, 20 Feb 2024 17:34:49 +0200
Dumitru Ceclan <mitrutzceclan@...il.com> wrote:
> Move gain-dB<->code conversion logic from read_raw and write_raw to
> chip_info callbacks.
>
> Signed-off-by: Dumitru Ceclan <mitrutzceclan@...il.com>
I've made a small tweak whilst applying this one.
> @@ -100,36 +155,15 @@ static int hmc425a_write_raw(struct iio_dev *indio_dev,
> int val2, long mask)
> {
> mutex_lock(&st->lock);
> switch (mask) {
> case IIO_CHAN_INFO_HARDWAREGAIN:
> + ret = gain_dB_to_code(st, val, val2, &code);
> + if (ret)
> + break;
> st->gain = code;
> -
Check your patches for unrelated white space changes.
They make things a little less reviewable and they create
noise in the history etc.
If you want to tidy up whitespace, a single patch just doing that
is the way to go.
> ret = hmc425a_write(indio_dev, st->gain);
> break;
> default:
> @@ -189,6 +223,8 @@ static struct hmc425a_chip_info hmc425a_chip_info_tbl[] = {
> .gain_min = -31500,
> .gain_max = 0,
> .default_gain = -0x40, /* set default gain -31.5db*/
Powered by blists - more mailing lists