From: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
To: Gabriel Shahrouzi <gshahrouzi@gmail.com>
Cc: himanshujha199640@gmail.com, jic23@kernel.org, lars@metafoo.de,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
Michael.Hennerich@analog.com, skhan@linuxfoundation.org,
linux-kernel-mentees@lists.linux.dev, stable@vger.kernel.org
Subject: Re: [PATCH] iio: adis16201: Correct accelerometer scale factor
Date: Sat, 19 Apr 2025 15:14:24 -0300 [thread overview]
Message-ID: <aAPoAESnjjyNsHI2@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <20250419125413.679290-1-gshahrouzi@gmail.com>
LGTM. Minor comments inline.
On 04/19, Gabriel Shahrouzi wrote:
> The IIO_CHAN_INFO_SCALE previously reported for accelerometer channels
> used 0.4624 mg/LSB. This value matches the datasheet specification for
> the offset calibration registers (X/YACCL_OFFS_REG, pg 18).
>
> However, the scale should reflect the sensor output data registers
> (X/YACCL_OUT, pg 15, Tables 7 & 8), which use 0.4625 mg/LSB. This is
> also consistent with the typical sensitivity in Table 1 (1 / 2.162 ≈
> 0.4625).
>
> Fixes: 57f9386405a2 ("Staging: iio: accel: adis16201: Add comments about units in read_raw()")
> Cc: stable@vger.kernel.org
> Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com>
> ---
> drivers/iio/accel/adis16201.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/accel/adis16201.c b/drivers/iio/accel/adis16201.c
> index 8601b9a8b8e75..982b33f6eccac 100644
> --- a/drivers/iio/accel/adis16201.c
> +++ b/drivers/iio/accel/adis16201.c
> @@ -133,7 +133,7 @@ static int adis16201_read_raw(struct iio_dev *indio_dev,
> * 1 LSB represents 0.244 mg.
Maybe also update the comment?
> */
> *val = 0;
> - *val2 = IIO_G_TO_M_S_2(462400);
> + *val2 = IIO_G_TO_M_S_2(462500);
If we do the math with more decimal digitis we have 1 / 2.162 == 0.46253469010176
Would it make sense to do
*val2 = IIO_G_TO_M_S_2(462535);
?
> return IIO_VAL_INT_PLUS_NANO;
> case IIO_INCLI:
> *val = 0;
next prev parent reply other threads:[~2025-04-19 18:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-19 12:54 [PATCH] iio: adis16201: Correct accelerometer scale factor Gabriel Shahrouzi
2025-04-19 18:14 ` Marcelo Schmitt [this message]
2025-04-20 0:57 ` Gabriel Shahrouzi
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=aAPoAESnjjyNsHI2@debian-BULLSEYE-live-builder-AMD64 \
--to=marcelo.schmitt1@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=gshahrouzi@gmail.com \
--cc=himanshujha199640@gmail.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=skhan@linuxfoundation.org \
--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