[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251004140809.5a629545@jic23-huawei>
Date: Sat, 4 Oct 2025 14:08:09 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Akshay Jindal <akshayaj.lkd@...il.com>
Cc: dan@...obertson.com, dlechner@...libre.com, nuno.sa@...log.com,
andy@...nel.org, shuah@...nel.org, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 3/5] iio: accel: bma400: Use index-based register
addressing and lookup
On Fri, 3 Oct 2025 00:11:04 +0530
Akshay Jindal <akshayaj.lkd@...il.com> wrote:
> 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@...il.com>
> ---
> drivers/iio/accel/bma400.h | 17 +++--
> drivers/iio/accel/bma400_core.c | 131 +++++++++++++++++++-------------
> 2 files changed, 88 insertions(+), 60 deletions(-)
>
> diff --git a/drivers/iio/accel/bma400.h b/drivers/iio/accel/bma400.h
> index 13fe2e5a3175..48fcaeeb553d 100644
> --- a/drivers/iio/accel/bma400.h
> +++ b/drivers/iio/accel/bma400.h
> @@ -91,6 +91,11 @@
> #define BMA400_INT_CONFIG0_GEN2_MASK BIT(3)
> #define BMA400_INT_CONFIG0_DRDY_MASK BIT(7)
>
> +enum bma400_generic_intr {
> + BMA400_GEN1_INTR = 1,
> + BMA400_GEN2_INTR,
Given the values matter, specify them both.
> +};
Powered by blists - more mailing lists