Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Jean-Baptiste Maneyrol via B4 Relay
	<devnull+jean-baptiste.maneyrol.tdk.com@kernel.org>
Cc: jean-baptiste.maneyrol@tdk.com,
	"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,
	stable@vger.kernel.org
Subject: Re: [PATCH] iio: imu: inv_icm42600: fix timestamp clock period by using lower value
Date: Fri, 3 Jul 2026 20:02:24 +0100	[thread overview]
Message-ID: <20260703200224.69d60475@jic23-huawei> (raw)
In-Reply-To: <20260623-inv-icm42600-fix-timestamp-clock-period-v1-1-82184d2429f4@tdk.com>

On Tue, 23 Jun 2026 16:22:15 +0200
Jean-Baptiste Maneyrol via B4 Relay <devnull+jean-baptiste.maneyrol.tdk.com@kernel.org> wrote:

> From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
> 
Sorry for delay - I'm finally getting back on top of my emails (for IIO anyway!)

> Clock period value is used for computing periods of sampling. There is
> no need for it to be higher than the maximum odr, otherwise we are
> losing precision in the computation for nothing.

Silly question - what are the user visible results of that precision loss?

Less accurate time stamp estimates, or something else?

Jonathan


> 
> Switch clock period value to maximum odr period (8kHz).
> 
> Fixes: 0ecc363ccea7 ("iio: make invensense timestamp module generic")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>


> ---
>  drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 4 ++--
>  drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c  | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c
> index 532d5fdffaf8..7df920ef3cf0 100644
> --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c
> +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c
> @@ -1170,10 +1170,10 @@ struct iio_dev *inv_icm42600_accel_init(struct inv_icm42600_state *st)
>  	accel_st->filter = INV_ICM42600_FILTER_AVG_16X;
>  
>  	/*
> -	 * clock period is 32kHz (31250ns)
> +	 * clock period is 8kHz (125000ns)
>  	 * jitter is +/- 2% (20 per mille)
>  	 */
> -	ts_chip.clock_period = 31250;
> +	ts_chip.clock_period = 125000;
>  	ts_chip.jitter = 20;
>  	ts_chip.init_period = inv_icm42600_odr_to_period(st->conf.accel.odr);
>  	inv_sensors_timestamp_init(&accel_st->ts, &ts_chip);
> diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c
> index 11339ddf1da3..a18dcac93929 100644
> --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c
> +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c
> @@ -755,10 +755,10 @@ struct iio_dev *inv_icm42600_gyro_init(struct inv_icm42600_state *st)
>  	}
>  
>  	/*
> -	 * clock period is 32kHz (31250ns)
> +	 * clock period is 8kHz (125000ns)
>  	 * jitter is +/- 2% (20 per mille)
>  	 */
> -	ts_chip.clock_period = 31250;
> +	ts_chip.clock_period = 125000;
>  	ts_chip.jitter = 20;
>  	ts_chip.init_period = inv_icm42600_odr_to_period(st->conf.accel.odr);
>  	inv_sensors_timestamp_init(&gyro_st->ts, &ts_chip);
> 
> ---
> base-commit: cc746297b23e89bd5df9f91f3a0ca209e8991763
> change-id: 20260623-inv-icm42600-fix-timestamp-clock-period-931338a848c3
> 
> Best regards,
> --  
> Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
> 
> 


      parent reply	other threads:[~2026-07-03 19:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23 14:22 [PATCH] iio: imu: inv_icm42600: fix timestamp clock period by using lower value Jean-Baptiste Maneyrol via B4 Relay
2026-07-03 15:41 ` Jean-Baptiste Maneyrol
2026-07-03 19:02 ` Jonathan Cameron [this message]

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=20260703200224.69d60475@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=devnull+jean-baptiste.maneyrol.tdk.com@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jean-baptiste.maneyrol@tdk.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=stable@vger.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