]> git.ipfire.org Git - thirdparty/linux.git/commit
iio: accel: bma400: Use index-based register addressing and lookup
authorAkshay Jindal <akshayaj.lkd@gmail.com>
Sun, 12 Oct 2025 18:06:10 +0000 (23:36 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 19 Oct 2025 10:59:23 +0000 (11:59 +0100)
commite03d213848b045aa370af57da559b49b5ab3c966
tree535a36fc24087b1e45f5c7c5684b7a7834ca6073
parenta2ef0af1923ba3fa0b46adfd8fb01d5920906980
iio: accel: bma400: Use index-based register addressing and lookup

Introduce formula-based macros to compute GEN INTR configuration register
addresses from the interrupt number and register index. This reduces the
need for 22 explicit register macros to three base definitions.

Add a centralized lookup table keyed by IIO event direction and replace
get_gen_config_reg() with a helper integrated with this table.

Apply these changes across the affected callbacks to ensure consistent
access to generic interrupt registers.

No functional changes are intended.

Signed-off-by: Akshay Jindal <akshayaj.lkd@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/bma400.h
drivers/iio/accel/bma400_core.c