Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Akshay Jindal <akshayaj.lkd@gmail.com>
Cc: dan@dlrobertson.com, dlechner@baylibre.com, nuno.sa@analog.com,
	andy@kernel.org, shuah@kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/5] iio: accel: bma400: Use index-based register addressing and lookup
Date: Sat, 4 Oct 2025 14:08:09 +0100	[thread overview]
Message-ID: <20251004140809.5a629545@jic23-huawei> (raw)
In-Reply-To: <20251002184120.495193-4-akshayaj.lkd@gmail.com>

On Fri,  3 Oct 2025 00:11:04 +0530
Akshay Jindal <akshayaj.lkd@gmail.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@gmail.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.

> +};


  reply	other threads:[~2025-10-04 13:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-02 18:41 [PATCH v3 0/5] iio: accel: bma400: Refactor GENINTR config and register macros Akshay Jindal
2025-10-02 18:41 ` [PATCH v3 1/5] iio: accel: bma400: Reorganize and rename register and field macros Akshay Jindal
2025-10-04 12:53   ` Jonathan Cameron
2025-10-07  6:39     ` Akshay Jindal
2025-10-12 14:02       ` Jonathan Cameron
2025-10-02 18:41 ` [PATCH v3 2/5] iio: accel: bma400: Use macros for generic event configuration values Akshay Jindal
2025-10-04 12:58   ` Jonathan Cameron
2025-10-07  6:46     ` Akshay Jindal
2025-10-12 14:04       ` Jonathan Cameron
2025-10-02 18:41 ` [PATCH v3 3/5] iio: accel: bma400: Use index-based register addressing and lookup Akshay Jindal
2025-10-04 13:08   ` Jonathan Cameron [this message]
2025-10-07  6:45     ` Akshay Jindal
2025-10-02 18:41 ` [PATCH v3 4/5] iio: accel: bma400: Rename activity_event_en() to generic_event_en() Akshay Jindal
2025-10-02 18:41 ` [PATCH v3 5/5] iio: accel: bma400: Add detail to comments in GEN INTR configuration Akshay Jindal

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=20251004140809.5a629545@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=akshayaj.lkd@gmail.com \
    --cc=andy@kernel.org \
    --cc=dan@dlrobertson.com \
    --cc=dlechner@baylibre.com \
    --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