public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Francesco Lavra <flavra@baylibre.com>
Cc: "Lorenzo Bianconi" <lorenzo@kernel.org>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"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 2/3] iio: imu: st_lsm6dsx: set FIFO ODR for accelerometer and magnetometer only
Date: Fri, 9 Jan 2026 21:09:08 +0200	[thread overview]
Message-ID: <aWFSVKBCYzjuZzic@smile.fi.intel.com> (raw)
In-Reply-To: <20260109181528.154127-3-flavra@baylibre.com>

On Fri, Jan 09, 2026 at 07:15:27PM +0100, Francesco Lavra wrote:
> The st_lsm6dsx_set_fifo_odr() function, which is called when enabling and
> disabling the hardware FIFO, checks the contents of the hw->settings->batch
> array at index sensor->id, and then sets the current ODR value in sensor
> registers that depend on whether the register address is set in the above
> array element. This logic is valid for internal sensors only, i.e. the
> accelerometer and magnetometer; however, since commit c91c1c844ebd ("iio:
> imu: st_lsm6dsx: add i2c embedded controller support"), this function is
> called also when configuring the hardware FIFO for external sensors (i.e.
> sensors accessed through the sensor hub functionality), which can result in
> unrelated device registers being written.
> 
> Add a check to the beginning of st_lsm6dsx_set_fifo_odr() so that it does
> not touch any registers unless it is called for internal sensors.

...

>  	const struct st_lsm6dsx_reg *batch_reg;
>  	u8 data;
>  
> +	/* Only accel and gyro have batch registers. */
> +	if (sensor->id >= ARRAY_SIZE(hw->settings->batch))
> +		return 0;

+ Blank line.

>  	batch_reg = &hw->settings->batch[sensor->id];

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-01-09 19:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-09 18:15 [PATCH 0/3] imu: st_lsm6dsx: Add support for rotation sensor Francesco Lavra
2026-01-09 18:15 ` [PATCH 1/3] iio: imu: st_lsm6dsx: set buffer sampling frequency for accelerometer only Francesco Lavra
2026-01-11 16:18   ` Jonathan Cameron
2026-01-12 17:10     ` Francesco Lavra
2026-01-16 18:03       ` Jonathan Cameron
2026-01-16 19:06         ` Francesco Lavra
2026-01-16 20:35           ` Jonathan Cameron
2026-01-09 18:15 ` [PATCH 2/3] iio: imu: st_lsm6dsx: set FIFO ODR for accelerometer and magnetometer only Francesco Lavra
2026-01-09 19:09   ` Andy Shevchenko [this message]
2026-01-11 16:23   ` Jonathan Cameron
2026-01-11 16:26     ` Jonathan Cameron
2026-01-12 17:37       ` Francesco Lavra
2026-01-09 18:15 ` [PATCH 3/3] iio: imu: st_lsm6dsx: add support for rotation sensor Francesco Lavra
2026-01-09 19:22   ` Andy Shevchenko
2026-01-11 19:39     ` Jonathan Cameron
2026-01-11 16:46   ` Jonathan Cameron
2026-01-13  9:48     ` Francesco Lavra
2026-01-16 18:27       ` Jonathan Cameron
2026-01-16 19:26         ` Francesco Lavra

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=aWFSVKBCYzjuZzic@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=flavra@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo@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