From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Chris Morgan <macromorgan@hotmail.com>
Cc: David Lechner <dlechner@baylibre.com>,
Chris Morgan <macroalpha82@gmail.com>,
linux-iio@vger.kernel.org, andy@kernel.org, nuno.sa@analog.com,
jic23@kernel.org, jean-baptiste.maneyrol@tdk.com,
linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org,
heiko@sntech.de, conor+dt@kernel.org, krzk+dt@kernel.org,
robh@kernel.org
Subject: Re: [PATCH V3 6/9] iio: imu: inv_icm42607: Add Accelerometer for icm42607
Date: Wed, 29 Apr 2026 22:46:59 +0300 [thread overview]
Message-ID: <afJgM5DhK6Repa1d@ashevche-desk.local> (raw)
In-Reply-To: <PH0PR19MB997338EE6A13BD08879C4B9B2BA5372@PH0PR19MB997338.namprd19.prod.outlook.com>
On Tue, Apr 28, 2026 at 09:01:12AM -0500, Chris Morgan wrote:
> On Fri, Apr 10, 2026 at 05:59:05PM -0500, David Lechner wrote:
> > On 3/30/26 2:58 PM, Chris Morgan wrote:
...
> > > +/* IIO format int + nano */
> >
> > Usually we make these 2-D arrays for readability and then cast to int * if needed.
> >
> > > +static const int inv_icm42607_accel_scale[] = {
> > > + /* +/- 16G => 0.004788403 m/s-2 */
> > > + [2 * INV_ICM42607_ACCEL_FS_16G] = 0,
> > > + [2 * INV_ICM42607_ACCEL_FS_16G + 1] = 4788403,
> > > + /* +/- 8G => 0.002394202 m/s-2 */
> > > + [2 * INV_ICM42607_ACCEL_FS_8G] = 0,
> > > + [2 * INV_ICM42607_ACCEL_FS_8G + 1] = 2394202,
> > > + /* +/- 4G => 0.001197101 m/s-2 */
> > > + [2 * INV_ICM42607_ACCEL_FS_4G] = 0,
> > > + [2 * INV_ICM42607_ACCEL_FS_4G + 1] = 1197101,
> > > + /* +/- 2G => 0.000598550 m/s-2 */
> > > + [2 * INV_ICM42607_ACCEL_FS_2G] = 0,
> > > + [2 * INV_ICM42607_ACCEL_FS_2G + 1] = 598550,
> > > +};
>
> I've gone through and implemented all of the changes everyone suggested, though
> this is one of the few on which I had a question. Obviously this driver was
> cobbled together from 2 different sources and checked to the best of my ability
> and tested/validated against the data sheet, but there are a few bits I'm not
> fully clear on such as this.
> What's the correct way to represent this data? Since it looks like one of the
> values is always 0, should I just assume it's always 0 and only represent the
> values that change in this scale?
Isn't the comment is clear about that? The first one is integer, the second one
is fraction. So, no, your assumption is wrong strictly speaking.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-04-29 19:47 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 19:58 [PATCH V3 0/9] Add Invensense ICM42607 Chris Morgan
2026-03-30 19:58 ` [PATCH V3 1/9] dt-bindings: iio: imu: icm42607: Add devicetree binding Chris Morgan
2026-04-08 13:19 ` Rob Herring
2026-04-08 14:31 ` Chris Morgan
2026-04-08 19:44 ` Rob Herring
2026-03-30 19:58 ` [PATCH V3 2/9] iio: imu: inv_icm42607: Add Core for inv_icm42607 Driver Chris Morgan
2026-04-10 22:06 ` David Lechner
2026-04-13 19:06 ` Jonathan Cameron
2026-04-14 7:14 ` Andy Shevchenko
2026-04-14 18:29 ` Jonathan Cameron
2026-03-30 19:58 ` [PATCH V3 3/9] iio: imu: inv_icm42607: Add I2C and SPI For icm42607 Chris Morgan
2026-04-10 22:21 ` David Lechner
2026-03-30 19:58 ` [PATCH V3 4/9] iio: imu: inv_icm42607: Add Buffer support functions to icm42607 Chris Morgan
2026-04-13 19:23 ` Jonathan Cameron
2026-03-30 19:58 ` [PATCH V3 5/9] iio: imu: inv_icm42607: Add Temperature Support in icm42607 Chris Morgan
2026-04-10 22:34 ` David Lechner
2026-03-30 19:58 ` [PATCH V3 6/9] iio: imu: inv_icm42607: Add Accelerometer for icm42607 Chris Morgan
2026-04-10 22:59 ` David Lechner
2026-04-28 14:01 ` Chris Morgan
2026-04-28 15:09 ` David Lechner
2026-04-29 19:46 ` Andy Shevchenko [this message]
2026-04-13 19:32 ` Jonathan Cameron
2026-03-30 19:58 ` [PATCH V3 7/9] iio: imu: inv_icm42607: Add Interrupt and Wake on Movement " Chris Morgan
2026-04-13 19:37 ` Jonathan Cameron
2026-03-30 19:58 ` [PATCH V3 8/9] iio: imu: inv_icm42607: Add Gyroscope to icm42607 Chris Morgan
2026-04-13 19:39 ` Jonathan Cameron
2026-03-30 19:58 ` [PATCH V3 9/9] arm64: dts: rockchip: Add icm42607p IMU for RG-DS Chris Morgan
2026-03-31 11:25 ` [PATCH V3 0/9] Add Invensense ICM42607 Andy Shevchenko
2026-03-31 15:15 ` Chris Morgan
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=afJgM5DhK6Repa1d@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=heiko@sntech.de \
--cc=jean-baptiste.maneyrol@tdk.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=macroalpha82@gmail.com \
--cc=macromorgan@hotmail.com \
--cc=nuno.sa@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