From: Akshay Jindal <akshayaj.lkd@gmail.com>
To: dan@dlrobertson.com, jic23@kernel.org, dlechner@baylibre.com,
nuno.sa@analog.com, andy@kernel.org
Cc: Akshay Jindal <akshayaj.lkd@gmail.com>,
shuah@kernel.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v5 0/6] iio: accel: bma400: Refactor GENINTR config and register macros
Date: Sun, 12 Oct 2025 23:36:07 +0530 [thread overview]
Message-ID: <20251012180619.195244-1-akshayaj.lkd@gmail.com> (raw)
This series refactors the BMA400 driver with a focus on generic interrupt
configuration and related register usage. The main changes reduce
usage of hard-coded values by introducing macros and formula-based
register addressing, and add a centralized lookup indexed on iio event
direction.
Alongside these updates, the series also reorganizes and renames register
and field macros for consistency with the datasheet, and extends comments
for additional clarity.
All patches are pure refactoring. No functional changes are intended.
Akshay Jindal (6):
iio: accel: bma400: Reorganize and rename register and field macros
iio: accel: bma400: Use macros for generic event configuration values
iio: accel: bma400: Use index-based register addressing and lookup
iio: accel: bma400: Replace bit shifts with FIELD_PREP() and FIELD_GET()
iio: accel: bma400: Rename activity_event_en() to generic_event_en()
iio: accel: bma400: Add detail to comments in GEN INTR configuration
Changes since v4:
- Add INT_STATx field macros corresponding to used INT_CONFIGx fields.
- Make INT_STATx field macro names consistent with others.
- Tied the INT_STATx field to correct INT_STAT register.
- Modified changelog of PATCH 1/6 due to addition of INT_STATx fields.
- Modified changelog of PATCH 4/6.
Changes since v3:
- Insert a new patch into the patch series for replacing explicit bit
shifts with FIELD_GET and FIELD_PREP macros
- Assigned explicit values to reg field enums introduced.
Changes since v2:
- Split single patch into five smaller patches as suggested
- Addressed review comments related to trailing comma [Patch 2/5]
- Extended renaming of macros to TAP_CONFIG registers [Patch 1/5]
- Addressed review comment received regarding write then replace in
activity_event_en() [Patch 3/5]
Testing Summary:
- Tested on raspberrypi 4b and 7-semi bma400 sensor breakout board.
- Since no functional impact is there, so before functionality is
expected to be equal to after change functionality.
- Tested mapping of GEN1 and GEN2 both on INT1 pin as before.
- Tested both activity and inactivity detection by setting attributes
events/in_accel_mag_falling_en as well as events/in_accel_mag_rising_en.
- Did read and writes on various attributes such that write_event_config(),
write_event_value() and read_event_value() callbacks are triggered.
drivers/iio/accel/bma400.h | 155 +++++++++-----
drivers/iio/accel/bma400_core.c | 349 ++++++++++++++++++--------------
2 files changed, 292 insertions(+), 212 deletions(-)
--
2.43.0
next reply other threads:[~2025-10-12 18:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-12 18:06 Akshay Jindal [this message]
2025-10-12 18:06 ` [PATCH v5 1/6] iio: accel: bma400: Reorganize and rename register and field macros Akshay Jindal
2025-10-12 18:06 ` [PATCH v5 2/6] iio: accel: bma400: Use macros for generic event configuration values Akshay Jindal
2025-10-12 18:06 ` [PATCH v5 3/6] iio: accel: bma400: Use index-based register addressing and lookup Akshay Jindal
2025-10-12 18:06 ` [PATCH v5 4/6] iio: accel: bma400: Replace bit shifts with FIELD_PREP() and FIELD_GET() Akshay Jindal
2025-10-12 18:06 ` [PATCH v5 5/6] iio: accel: bma400: Rename activity_event_en() to generic_event_en() Akshay Jindal
2025-10-12 18:06 ` [PATCH v5 6/6] iio: accel: bma400: Add detail to comments in GEN INTR configuration Akshay Jindal
2025-10-18 15:06 ` [PATCH v5 0/6] iio: accel: bma400: Refactor GENINTR config and register macros Jonathan Cameron
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=20251012180619.195244-1-akshayaj.lkd@gmail.com \
--to=akshayaj.lkd@gmail.com \
--cc=andy@kernel.org \
--cc=dan@dlrobertson.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 \
--cc=shuah@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;
as well as URLs for NNTP newsgroup(s).