From: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
To: Antoni Pokusinski <apokusinski01@gmail.com>
Cc: jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com,
andy@kernel.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] iio: mpl3115: add ctrl_reg4 to mpl3115_data
Date: Wed, 29 Oct 2025 14:20:42 -0300 [thread overview]
Message-ID: <aQJM6u9pGSdds0X3@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <20251028213351.77368-2-apokusinski01@gmail.com>
Hi Antoni,
The patch itself looks good to me.
I just wonder if it would make more sense to squash it with patch 2 since part
of the code here is changed again in that patch (the mpl3115_set_trigger_state()).
On 10/28, Antoni Pokusinski wrote:
> Cache the value of CTRL_REG4 in the mpl3115_data structure. This is a
> preparation for adding support for the threshold events.
>
> Signed-off-by: Antoni Pokusinski <apokusinski01@gmail.com>
> ---
> drivers/iio/pressure/mpl3115.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iio/pressure/mpl3115.c b/drivers/iio/pressure/mpl3115.c
> index c212dfdf59ff..4cc103e20a39 100644
> --- a/drivers/iio/pressure/mpl3115.c
> +++ b/drivers/iio/pressure/mpl3115.c
> @@ -83,6 +83,7 @@ struct mpl3115_data {
> struct iio_trigger *drdy_trig;
> struct mutex lock;
> u8 ctrl_reg1;
> + u8 ctrl_reg4;
I think this ...
> };
>
> enum mpl3115_irq_pin {
> @@ -376,6 +377,7 @@ static int mpl3115_config_interrupt(struct mpl3115_data *data,
> goto reg1_cleanup;
>
> data->ctrl_reg1 = ctrl_reg1;
> + data->ctrl_reg4 = ctrl_reg4;
>
> return 0;
>
> @@ -390,12 +392,15 @@ static int mpl3115_set_trigger_state(struct iio_trigger *trig, bool state)
> struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig);
> struct mpl3115_data *data = iio_priv(indio_dev);
> u8 ctrl_reg1 = data->ctrl_reg1;
> - u8 ctrl_reg4 = state ? MPL3115_CTRL4_INT_EN_DRDY : 0;
> + u8 ctrl_reg4 = data->ctrl_reg4;
and also this is changed again in patch 2.
I don't see much advantage in having it separated from patch 2.
Might be simpler to just squash patch 1 and 2.
>
> - if (state)
> + if (state) {
> ctrl_reg1 |= MPL3115_CTRL1_ACTIVE;
> - else
> + ctrl_reg4 |= MPL3115_CTRL4_INT_EN_DRDY;
> + } else {
> ctrl_reg1 &= ~MPL3115_CTRL1_ACTIVE;
> + ctrl_reg4 &= ~MPL3115_CTRL4_INT_EN_DRDY;
> + }
>
> guard(mutex)(&data->lock);
>
> --
> 2.25.1
>
next prev parent reply other threads:[~2025-10-29 17:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 21:33 [PATCH 0/2] iio: mpl3115: support for events Antoni Pokusinski
2025-10-28 21:33 ` [PATCH 1/2] iio: mpl3115: add ctrl_reg4 to mpl3115_data Antoni Pokusinski
2025-10-29 17:20 ` Marcelo Schmitt [this message]
2025-10-28 21:33 ` [PATCH 2/2] iio: mpl3115: add threshold events support Antoni Pokusinski
2025-10-29 8:24 ` Andy Shevchenko
2025-10-29 22:46 ` Antoni Pokusinski
2025-10-30 9:18 ` Andy Shevchenko
2025-10-29 17:13 ` 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=aQJM6u9pGSdds0X3@debian-BULLSEYE-live-builder-AMD64 \
--to=marcelo.schmitt1@gmail.com \
--cc=andy@kernel.org \
--cc=apokusinski01@gmail.com \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--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