[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9ee20209-efba-44b1-9902-5885bacfb290@gmail.com>
Date: Sun, 5 Oct 2025 20:25:12 -0300
From: Marilene Andrade Garcia <marilene.agarcia@...il.com>
To: David Lechner <dlechner@...libre.com>
Cc: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, Kim Seer Paller <kimseer.paller@...log.com>,
Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Jonathan Cameron <jic23@...nel.org>, Nuno Sá
<nuno.sa@...log.com>, Andy Shevchenko <andy@...nel.org>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Marcelo Schmitt <marcelo.schmitt1@...il.com>,
Marcelo Schmitt <Marcelo.Schmitt@...log.com>,
Ceclan Dumitru <dumitru.ceclan@...log.com>,
Jonathan Santos <Jonathan.Santos@...log.com>,
Dragos Bogdan <dragos.bogdan@...log.com>
Subject: Re: [PATCH v12 2/3] iio: adc: max14001: New driver
On 01/10/2025 11:03, David Lechner wrote:
> On Mon, Sep 29, 2025 at 7:59 AM Marilene Andrade Garcia
> <marilene.agarcia@...il.com> wrote:
>>
>
...
>> +static int max14001_read_raw(struct iio_dev *indio_dev,
>> + struct iio_chan_spec const *chan,
>> + int *val, int *val2, long mask)
>> +{
>> + struct max14001_state *st = iio_priv(indio_dev);
>> + int ret;
>> +
>> + switch (mask) {
>> + case IIO_CHAN_INFO_RAW:
>> + ret = regmap_read(st->regmap, MAX14001_REG_ADC, val);
>> + if (ret)
>> + return ret;
>> +
>> + return IIO_VAL_INT;
>> + case IIO_CHAN_INFO_AVERAGE_RAW:
>> + ret = regmap_read(st->regmap, MAX14001_REG_FADC, val);
>
> I don't remember... did you give a reason why this should not be a
> separate channel? Or just use REG_FADC as the raw value and forget
> about REG_ADC? In any case we would want another attribute to control
> the filter window size.
...
Hello David,
Thank you for the review and suggestions.
Sorry for not adding any comments about that in v12. From what I
understood from our previous conversation, for now the code could have
one channel to keep things simple, since we’re not sure if anyone will
actually need to read both the filtered and unfiltered data at the same
time.
I was thinking of sending a separate set of commits to address that
after this one gets merged, as it will involve new code changes related
to adding a function to configure how many ADC readings are included in
the mean calculation, and adding a new attribute to sysfs.
Since both IIO_CHAN_INFO_RAW and IIO_CHAN_INFO_AVERAGE_RAW are currently
returning the same value, I could drop IIO_CHAN_INFO_AVERAGE_RAW in v13
and add it back in the next series of commits to implement the related
feature.
I would like to know your thoughts about it, because if you prefer, I
could change my plans and implement it in v13.
Best Regards,
Marilene
Powered by blists - more mailing lists