From: Jonathan Cameron <jic23@kernel.org>
To: Radu Sabau via B4 Relay <devnull+radu.sabau.analog.com@kernel.org>
Cc: radu.sabau@analog.com, Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Nuno Sa <nuno.sa@analog.com>,
David Lechner <dlechner@baylibre.com>,
Andy Shevchenko <andy@kernel.org>,
Alexandru Ardelean <alexandru.ardelean@analog.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, linux@analog.com
Subject: Re: [PATCH v5 7/8] iio: imu: adis16607: Add external clock sync support
Date: Sun, 8 Nov 2026 00:56:09 +0000 [thread overview]
Message-ID: <20261108005609.7e8823f1@jic23-hlaptop> (raw)
In-Reply-To: <20261102-adis16607-v5-7-4f98b0d271ac@analog.com>
On Mon, 02 Nov 2026 11:25:43 +0200
Radu Sabau via B4 Relay <devnull+radu.sabau.analog.com@kernel.org> wrote:
> From: Radu Sabau <radu.sabau@analog.com>
>
> Add support for an optional external clock (clocks property),
> selecting between SYNC_DIRECT (1 kHz to 8 kHz) and SYNC_SCALED (1 Hz
> to 400 Hz) depending on the supplied frequency, with the internal
> 8 kHz clock used as the default when no clock is provided.
>
> The clock rate is requested as exclusive since the sample period and
> the sync scale are derived from it. In scaled mode the sync scale is
> chosen when the sampling frequency is set, so that the requested rate
> is matched as closely as possible while keeping the clock multiplied
> at or below the internal rate. Loss of sync or of the PLL lock is
> reported from the trigger handler, as the device keeps sampling
> without it.
>
> Signed-off-by: Radu Sabau <radu.sabau@analog.com>
Hi,
Mostly a few stray changes that belong in earlier patches.
Make sure to check series for this stuff. It is easy to clean up
and patch tidiness issues like this can just slow down getting
your code merged.
Jonathan
>
> struct adis16607 {
> @@ -115,6 +138,9 @@ struct adis16607 {
> const struct adis16607_chip_info *info;
> unsigned long clk_freq_mHz;
> u64 sample_period_ns;
> + unsigned long ext_clk_Hz;
> + u32 sync_mode;
> + u16 sync_scale;
> u16 fifo_watermark;
> /* IIO buffer for reordered data - sized for max channels */
> IIO_DECLARE_BUFFER_WITH_TS(u8, data, ADIS16607_SCAN_DATA_SIZE);
> @@ -407,11 +433,18 @@ static void adis16607_fifo_drain(struct iio_dev *indio_dev, s64 irq_timestamp)
>
> adis_dev_auto_lock(&st->adis);
>
> - /* Check if FIFO threshold is met */
Move the comment in the earlier patch, not here. It is perfect
valid in its new location back in that patch, so why add to
the code churn here?
> ret = __adis_read_reg_16(&st->adis, ADIS16607_REG_DIAG_STAT, &diag_stat);
> if (ret)
> return;
>
> + /* The device keeps sampling without sync, so only warn about it */
> + if (diag_stat & ADIS16607_DIAG_SYNC_LOST)
> + dev_warn_ratelimited(&st->adis.spi->dev, "external sync lost\n");
> +
> + if (diag_stat & ADIS16607_DIAG_DPLL_UNLOCKED)
> + dev_warn_ratelimited(&st->adis.spi->dev, "sync PLL unlocked\n");
> +
> + /* Check if FIFO threshold is met */
> if (!(diag_stat & ADIS16607_FIFO_THR_MET_MASK))
> return;
> static int adis16607_config_clk(struct adis16607 *st)
> {
> + ret = adis_read_reg_16(&st->adis, ADIS16607_REG_DEC_RATE, &dec);
> + if (ret)
> + return ret;
> +
> + /*
> + * Sample period is (dec + 1) / clk_freq, with clk_freq_mHz in
> + * millihertz. Same u64-first scheme as adis16607_set_freq().
> + */
> + period_ns = NSEC_PER_SEC;
Move this in earlier patch to avoid churn here.
> period_ns *= MILLIHZ_PER_HZ;
> + period_ns *= dec + 1;
> st->sample_period_ns = DIV_ROUND_CLOSEST_ULL(period_ns,
> st->clk_freq_mHz);
> +
Unrelated change. Check for these and move to the correct patch.
> return 0;
> }
>
>
next prev parent reply other threads:[~2026-11-08 0:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 9:25 [PATCH v5 0/8] iio: imu: Add support for the ADI ADIS16607 Radu Sabau via B4 Relay
2026-11-02 9:25 ` [PATCH v5 1/8] iio: imu: adis: Fix custom reset dispatch in adislib Radu Sabau via B4 Relay
2026-11-02 9:25 ` [PATCH v5 2/8] iio: imu: adis: Add optional self_test callback Radu Sabau via B4 Relay
2026-11-02 9:25 ` [PATCH v5 3/8] iio: imu: adis: Add optional init callback Radu Sabau via B4 Relay
2026-11-02 9:25 ` [PATCH v5 4/8] dt-bindings: iio: imu: Add bindings for ADI ADIS16607 Radu Sabau via B4 Relay
2026-11-02 19:36 ` Conor Dooley
2026-11-03 10:55 ` Krzysztof Kozlowski
2026-11-03 12:15 ` Sabau, Radu bogdan
2026-11-03 18:21 ` Conor Dooley
2026-11-03 20:15 ` Rob Herring (Arm)
2026-11-02 9:25 ` [PATCH v5 5/8] iio: imu: Add driver for the " Radu Sabau via B4 Relay
2026-11-08 0:35 ` Jonathan Cameron
2026-11-02 9:25 ` [PATCH v5 6/8] iio: imu: adis16607: Add FIFO-based buffered/triggered capture Radu Sabau via B4 Relay
2026-11-08 0:52 ` Jonathan Cameron
2026-11-02 9:25 ` [PATCH v5 7/8] iio: imu: adis16607: Add external clock sync support Radu Sabau via B4 Relay
2026-11-08 0:56 ` Jonathan Cameron [this message]
2026-11-02 9:25 ` [PATCH v5 8/8] iio: imu: adis16607: Add calibration bias support for gyro/accel Radu Sabau via B4 Relay
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=20261108005609.7e8823f1@jic23-hlaptop \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=alexandru.ardelean@analog.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=devnull+radu.sabau.analog.com@kernel.org \
--cc=dlechner@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@analog.com \
--cc=nuno.sa@analog.com \
--cc=radu.sabau@analog.com \
--cc=robh@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
all inboxes | Powered by JetHome®