From: Marilene Andrade Garcia <marilene.agarcia@gmail.com>
To: David Lechner <dlechner@baylibre.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org,
"Kim Seer Paller" <kimseer.paller@analog.com>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Marcelo Schmitt" <marcelo.schmitt1@gmail.com>,
"Marcelo Schmitt" <Marcelo.Schmitt@analog.com>,
"Ceclan Dumitru" <dumitru.ceclan@analog.com>,
"Jonathan Santos" <Jonathan.Santos@analog.com>,
"Dragos Bogdan" <dragos.bogdan@analog.com>
Subject: Re: [PATCH v12 2/3] iio: adc: max14001: New driver
Date: Sun, 5 Oct 2025 20:25:12 -0300 [thread overview]
Message-ID: <9ee20209-efba-44b1-9902-5885bacfb290@gmail.com> (raw)
In-Reply-To: <CAMknhBHt9JVkaf1Kq76BKFM-Ff38-7ws6gaq+5fwy=pAih-fww@mail.gmail.com>
On 01/10/2025 11:03, David Lechner wrote:
> On Mon, Sep 29, 2025 at 7:59 AM Marilene Andrade Garcia
> <marilene.agarcia@gmail.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
next prev parent reply other threads:[~2025-10-05 23:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-29 5:58 [PATCH v12 1/3] dt-bindings: iio: adc: add max14001 Marilene Andrade Garcia
2025-09-29 5:59 ` [PATCH v12 2/3] iio: adc: max14001: New driver Marilene Andrade Garcia
2025-10-01 14:03 ` David Lechner
2025-10-02 7:05 ` Andy Shevchenko
2025-10-05 23:25 ` Marilene Andrade Garcia [this message]
2025-10-06 15:48 ` David Lechner
2025-10-04 15:04 ` Jonathan Cameron
2025-10-06 1:52 ` Marcelo Schmitt
2025-09-29 17:40 ` [PATCH v12 1/3] dt-bindings: iio: adc: add max14001 Conor Dooley
2025-10-06 1:58 ` Marcelo Schmitt
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=9ee20209-efba-44b1-9902-5885bacfb290@gmail.com \
--to=marilene.agarcia@gmail.com \
--cc=Jonathan.Santos@analog.com \
--cc=Marcelo.Schmitt@analog.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=dragos.bogdan@analog.com \
--cc=dumitru.ceclan@analog.com \
--cc=jic23@kernel.org \
--cc=kimseer.paller@analog.com \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.schmitt1@gmail.com \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
/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