From: Jonathan Cameron <jic23@kernel.org>
To: Chris Morgan <macroalpha82@gmail.com>
Cc: linux-iio@vger.kernel.org, andy@kernel.org, nuno.sa@analog.com,
dlechner@baylibre.com, 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, andriy.shevchenko@intel.com,
Chris Morgan <macromorgan@hotmail.com>
Subject: Re: [PATCH V12 3/9] iio: imu: inv_icm42607: Add inv_icm42607 Core Driver
Date: Sun, 14 Jun 2026 17:18:47 +0100 [thread overview]
Message-ID: <20260614171847.3c412ca3@jic23-huawei> (raw)
In-Reply-To: <20260611202607.85376-4-macroalpha82@gmail.com>
On Thu, 11 Jun 2026 15:26:00 -0500
Chris Morgan <macroalpha82@gmail.com> wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
>
> Add the core component of a new inv_icm42607 driver. This includes
> a few setup functions and the full register definition in the
> header file, as well as the bits necessary to compile and probe the
> device when used on an i2c bus.
>
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Hi Chris,
Given this is nearly ready to merge I took a look at Sashiko and
seems it has found a few more things.
Other than those, looks good to me.
Jonathan
> diff --git a/drivers/iio/imu/inv_icm42607/inv_icm42607.h b/drivers/iio/imu/inv_icm42607/inv_icm42607.h
> new file mode 100644
> index 000000000000..c85d3b74166f
> --- /dev/null
> +++ b/drivers/iio/imu/inv_icm42607/inv_icm42607.h
> +#define INV_ICM42607_REG_INTF_CONFIG0 0x35
> +#define INV_ICM42607_INTF_CONFIG0_FIFO_COUNT_FORMAT BIT(6)
> +#define INV_ICM42607_INTF_CONFIG0_FIFO_COUNT_ENDIAN BIT(5)
> +#define INV_ICM42607_INTF_CONFIG0_SENSOR_DATA_ENDIAN BIT(4)
> +#define INV_ICM42607_INTF_CONFIG0_UI_SIFS_CFG_MASK GENMASK(1, 0)
> +#define INV_ICM42607_INTF_CONFIG0_UI_SIFS_CFG_SPI_DIS \
> + FIELD_PREP(INV_ICM42607_INTF_CONFIG0_UI_SIFS_CFG_MASK, 2)
Define this as simply 2.
> +#define INV_ICM42607_INTF_CONFIG0_UI_SIFS_CFG_I2C_DIS \
> + FIELD_PREP(INV_ICM42607_INTF_CONFIG0_UI_SIFS_CFG_MASK, 3)
and 3
not the FIELD_PREPified version
Sashiko correctly called out that it is field_prepped again at
the callsite. As the mask includes lowest bit this is will 'work'
but definitely isn't what you intended!
> diff --git a/drivers/iio/imu/inv_icm42607/inv_icm42607_core.c b/drivers/iio/imu/inv_icm42607/inv_icm42607_core.c
> new file mode 100644
> index 000000000000..5d40f1ee53d6
> --- /dev/null
> +++ b/drivers/iio/imu/inv_icm42607/inv_icm42607_core.c
> +static bool inv_icm42607_is_readable_reg(struct device *dev, unsigned int reg)
> +{
> + switch (reg) {
> + case INV_ICM42607_REG_MCLK_RDY ... INV_ICM42607_REG_INT_CONFIG:
> + case INV_ICM42607_REG_TEMP_DATA1 ... INV_ICM42607_REG_TMST_FSYNCL:
> + case INV_ICM42607_REG_APEX_DATA4 ... INV_ICM42607_REG_INTF_CONFIG1:
> + case INV_ICM42607_REG_INT_STATUS_DRDY ... INV_ICM42607_REG_FIFO_DATA:
Sashiko pointed out that the WOM_ registers, 4b to 4d are in the defines, but
not readable or writeable which seems like an omission.
So far only matters for debug, but perhaps better to add them from the start.
> + case INV_ICM42607_REG_WHOAMI:
> + return true;
> + }
> +
> + return false;
> +}
> +
> +static bool inv_icm42607_is_writeable_reg(struct device *dev, unsigned int reg)
> +{
> + switch (reg) {
> + case INV_ICM42607_REG_DEVICE_CONFIG ... INV_ICM42607_REG_INT_CONFIG:
> + case INV_ICM42607_REG_PWR_MGMT0 ... INV_ICM42607_REG_INT_SOURCE4:
> + case INV_ICM42607_REG_INTF_CONFIG0 ... INV_ICM42607_REG_INTF_CONFIG1:
> + return true;
> + }
> +
> + return false;
> +}
next prev parent reply other threads:[~2026-06-14 16:18 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 20:25 [PATCH V12 0/9] Add Invensense ICM42607 Chris Morgan
2026-06-11 20:25 ` [PATCH V12 1/9] dt-bindings: iio: imu: icm42600: Add mount-matrix to icm42600 Chris Morgan
2026-06-11 20:25 ` [PATCH V12 2/9] dt-bindings: iio: imu: icm42600: Add icm42607 Chris Morgan
2026-06-11 20:26 ` [PATCH V12 3/9] iio: imu: inv_icm42607: Add inv_icm42607 Core Driver Chris Morgan
2026-06-11 20:39 ` sashiko-bot
2026-06-14 16:18 ` Jonathan Cameron [this message]
2026-06-15 2:12 ` Chris Morgan
2026-06-11 20:26 ` [PATCH V12 4/9] iio: imu: inv_icm42607: Add SPI For icm42607 Chris Morgan
2026-06-11 20:41 ` sashiko-bot
2026-06-15 10:23 ` Andy Shevchenko
2026-06-11 20:26 ` [PATCH V12 5/9] iio: imu: inv_icm42607: Add PM support for icm42607 Chris Morgan
2026-06-11 20:46 ` sashiko-bot
2026-06-15 10:28 ` Andy Shevchenko
2026-06-15 14:49 ` Chris Morgan
2026-06-11 20:26 ` [PATCH V12 6/9] iio: imu: inv_icm42607: Add Temp Support in icm42607 Chris Morgan
2026-06-11 20:46 ` sashiko-bot
2026-06-14 16:34 ` Jonathan Cameron
2026-06-11 20:26 ` [PATCH V12 7/9] iio: imu: inv_icm42607: Add Accelerometer for icm42607 Chris Morgan
2026-06-14 16:43 ` Jonathan Cameron
2026-06-15 11:21 ` Andy Shevchenko
2026-06-15 14:51 ` Chris Morgan
2026-06-15 15:07 ` Andy Shevchenko
2026-06-15 16:40 ` Chris Morgan
2026-06-16 7:07 ` Andy Shevchenko
2026-06-11 20:26 ` [PATCH V12 8/9] iio: imu: inv_icm42607: Add Gyroscope to icm42607 Chris Morgan
2026-06-11 20:44 ` sashiko-bot
2026-06-11 20:26 ` [PATCH V12 9/9] arm64: dts: rockchip: Add icm42607p IMU for RG-DS 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=20260614171847.3c412ca3@jic23-huawei \
--to=jic23@kernel.org \
--cc=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=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