From: "Nuno Sá" <noname.nuno@gmail.com>
To: Robert Budai <robert.budai@analog.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Nuno Sa <nuno.sa@analog.com>,
Ramona Gradinariu <ramona.gradinariu@analog.com>,
Antoniu Miclaus <antoniu.miclaus@analog.com>,
Jonathan Cameron <jic23@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [RESEND PATCH v8 5/6] iio: imu: adis16550: add adis16550 support
Date: Thu, 20 Feb 2025 08:21:56 +0000 [thread overview]
Message-ID: <aee93ef96e71adf70a48ee5877bd75966d9c78c1.camel@gmail.com> (raw)
In-Reply-To: <20250217105753.605465-6-robert.budai@analog.com>
On Mon, 2025-02-17 at 12:57 +0200, Robert Budai wrote:
> The ADIS16550 is a complete inertial system that includes a triaxis
> gyroscope and a triaxis accelerometer. Each inertial sensor in the
> ADIS16550 combines industry leading MEMS only technology with signal
> conditioning that optimizes dynamic performance. The factory calibration
> characterizes each sensor for sensitivity, bias, and alignment. As a
> result, each sensor has its own dynamic compensation formulas that
> provide accurate sensor measurements.
>
> Co-developed-by: Ramona Gradinariu <ramona.gradinariu@analog.com>
> Signed-off-by: Ramona Gradinariu <ramona.gradinariu@analog.com>
> Co-developed-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> Signed-off-by: Robert Budai <robert.budai@analog.com>
> ---
>
I guess it would make sense a Co-developed-by: for Robert?
Anyways, all looks good except for one thing that I just spotted...
> v8:
> - removed __aligned from struct adis16550, as suggested
> - crc buffer extraction into the crc check function
> - passed buffer into crc validation as original, __be32 and performed check
> using be32_to_cpu conversion of the buffer
> - added trailing comma to line 993
> - removed trailing comma from line 877
>
> drivers/iio/imu/Kconfig | 13 +
> drivers/iio/imu/Makefile | 1 +
> drivers/iio/imu/adis16550.c | 1149 +++++++++++++++++++++++++++++++++++
> 3 files changed, 1163 insertions(+)
> create mode 100644 drivers/iio/imu/adis16550.c
>
...
>
> +static int adis16550_set_freq_hz(struct adis16550 *st, u32 freq_hz)
> +{
> + u16 dec;
> + int ret;
> + u32 sample_rate = st->clk_freq_hz;
> + /*
> + * The optimal sample rate for the supported IMUs is between
> + * int_clk - 1000 and int_clk + 500.
> + */
> + u32 max_sample_rate = st->info->int_clk * 1000 + 500000;
> + u32 min_sample_rate = st->info->int_clk * 1000 - 1000000;
> +
> + if (!freq_hz)
> + return -EINVAL;
> +
> + adis_dev_auto_lock(&st->adis);
> +
> + if (st->sync_mode == ADIS16550_SYNC_MODE_SCALED) {
> + unsigned long scaled_rate = lcm(st->clk_freq_hz, freq_hz);
> + int sync_scale;
> +
> + if (scaled_rate > max_sample_rate)
> + scaled_rate = max_sample_rate / st->clk_freq_hz * st-
> >clk_freq_hz;
> + else
> + scaled_rate = max_sample_rate / scaled_rate *
> scaled_rate;
> +
> + if (scaled_rate < min_sample_rate)
> + scaled_rate = roundup(min_sample_rate, st-
> >clk_freq_hz);
> +
I would imagine the above is the same deal as in other devices [1] or do you
know for a fact this one is different? Maybe it's simple enough for Jonathan to
tweak while applying...
[1]: https://elixir.bootlin.com/linux/v6.13.3/source/drivers/iio/imu/adis16475.c#L364
- Nuno Sá
next prev parent reply other threads:[~2025-02-20 8:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-17 10:57 [RESEND PATCH v8 0/6] Add support for ADIS16550 Robert Budai
2025-02-17 10:57 ` [RESEND PATCH v8 1/6] iio: imu: adis: Add custom ops struct Robert Budai
2025-02-17 10:57 ` [RESEND PATCH v8 2/6] iio: imu: adis: Add reset to custom ops Robert Budai
2025-02-17 10:57 ` [RESEND PATCH v8 3/6] iio: imu: adis: Add DIAG_STAT register Robert Budai
2025-02-17 10:57 ` [RESEND PATCH v8 4/6] dt-bindings: iio: Add adis16550 bindings Robert Budai
2025-02-19 23:17 ` Rob Herring (Arm)
2025-02-17 10:57 ` [RESEND PATCH v8 5/6] iio: imu: adis16550: add adis16550 support Robert Budai
2025-02-20 8:21 ` Nuno Sá [this message]
2025-02-20 13:43 ` Budai, Robert
2025-02-22 12:38 ` Jonathan Cameron
2025-02-25 9:26 ` Nuno Sá
2025-02-17 10:57 ` [RESEND PATCH v8 6/6] docs: iio: add documentation for adis16550 driver Robert Budai
2025-02-17 14:33 ` [RESEND PATCH v8 0/6] Add support for ADIS16550 Jonathan Cameron
2025-02-22 12:40 ` Jonathan Cameron
2025-03-04 13:17 ` Jonathan Cameron
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=aee93ef96e71adf70a48ee5877bd75966d9c78c1.camel@gmail.com \
--to=noname.nuno@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=antoniu.miclaus@analog.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-doc@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=ramona.gradinariu@analog.com \
--cc=robert.budai@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;
as well as URLs for NNTP newsgroup(s).