From: Jonathan Cameron <jic23@kernel.org>
To: Gustavo Silva <gustavograzs@gmail.com>
Cc: "Alex Lanzano" <lanzano.alex@gmail.com>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] iio: imu: bmi270: add step counter watermark event
Date: Sat, 7 Jun 2025 16:54:57 +0100 [thread overview]
Message-ID: <20250607165457.3e886c62@jic23-huawei> (raw)
In-Reply-To: <20250605-bmi270-events-v2-2-8b2c07d0c213@gmail.com>
On Thu, 05 Jun 2025 19:05:02 -0300
Gustavo Silva <gustavograzs@gmail.com> wrote:
> Add support for generating events when the step counter reaches the
> configurable watermark.
>
> Reviewed-by: Andy Shevchenko <andy@kernel.org>
> Signed-off-by: Gustavo Silva <gustavograzs@gmail.com>
Trivial stuff inline given you are going to be doing a v3.
> +
> +static int bmi270_step_wtrmrk_en(struct bmi270_data *data, bool state)
> +{
> + int ret, reg;
> +
> + guard(mutex)(&data->mutex);
> + if (!data->steps_enabled)
> + return -EINVAL;
> +
> + reg = bmi270_int_map_reg(data->irq_pin);
> + if (reg < 0)
> + return reg;
> +
> + ret = regmap_update_bits(data->regmap, reg,
> + BMI270_INT_MAP_FEAT_STEP_CNT_WTRMRK_MSK,
> + FIELD_PREP(BMI270_INT_MAP_FEAT_STEP_CNT_WTRMRK_MSK,
> + state));
> + if (ret)
> + return ret;
> +
> + return 0;
return regmap_update_bits()
and save a couple of lines.
> +}
> +static const struct iio_event_spec bmi270_step_wtrmrk_event = {
> + .type = IIO_EV_TYPE_CHANGE,
> + .dir = IIO_EV_DIR_NONE,
> + .mask_shared_by_type = BIT(IIO_EV_INFO_ENABLE) |
> + BIT(IIO_EV_INFO_VALUE),
Could put those on one line as it's under 80 chars (just!)
> +};
next prev parent reply other threads:[~2025-06-07 15:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-05 22:05 [PATCH v2 0/3] BMI270: Add support for step counter and motion events Gustavo Silva
2025-06-05 22:05 ` [PATCH v2 1/3] iio: imu: bmi270: add channel for step counter Gustavo Silva
2025-06-06 7:43 ` kernel test robot
2025-06-06 9:14 ` Andy Shevchenko
2025-06-07 15:50 ` Jonathan Cameron
2025-06-08 20:03 ` Andy Shevchenko
2025-06-05 22:05 ` [PATCH v2 2/3] iio: imu: bmi270: add step counter watermark event Gustavo Silva
2025-06-07 15:54 ` Jonathan Cameron [this message]
2025-06-05 22:05 ` [PATCH v2 3/3] iio: imu: bmi270: add support for motion events Gustavo Silva
2025-06-07 16:02 ` Jonathan Cameron
2025-06-17 7:28 ` Lothar Rubusch
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=20250607165457.3e886c62@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=gustavograzs@gmail.com \
--cc=lanzano.alex@gmail.com \
--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