Devicetree
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Kanak Shilledar <kanak.shilledar@axis.com>
Cc: "Henrik Grimler" <henrik.grimler@axis.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Jean-Baptiste Maneyrol" <jean-baptiste.maneyrol@tdk.com>,
	"Joshua Crofts" <joshua.crofts1@gmail.com>,
	"Marcelo Schmitt" <marcelo.schmitt1@gmail.com>,
	"Chris Morgan" <macromorgan@hotmail.com>,
	kernel@axis.com, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 5/6] iio: imu: inv_icm42607: Implement MREGx register access
Date: Sun, 18 Oct 2026 03:52:21 +0100	[thread overview]
Message-ID: <20261018035221.55fac14d@jic23-hlaptop> (raw)
In-Reply-To: <20261009-b4-inv_icm42370p-v6-5-e53884f185ff@axis.com>

Just a couple of trivial notes.
The regmap on regmap solution is quite nice.
Might be worth making sure you run tests with lockdep
though just in case there are any nasties hiding in doing that!

Jonathan

> diff --git a/drivers/iio/imu/inv_icm42607/inv_icm42607_core.c b/drivers/iio/imu/inv_icm42607/inv_icm42607_core.c
> index 75c9617e5d1e7..a4393b54cc108 100644
> --- a/drivers/iio/imu/inv_icm42607/inv_icm42607_core.c
> +++ b/drivers/iio/imu/inv_icm42607/inv_icm42607_core.c
> @@ -18,63 +18,255 @@
>  #include <linux/time.h>
>  #include <linux/timekeeping.h>
>  #include <linux/types.h>
> +#include <linux/unaligned.h>
>  
>  #include <asm/byteorder.h>
>  
>  #include "inv_icm42607.h"
>  
> -static bool inv_icm42607_is_readable_reg(struct device *dev, unsigned int reg)
> +static int inv_icm42607_mclk_get(struct regmap *map, bool *idle_set)
>  {
> -	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:
> -	case INV_ICM42607_REG_WHOAMI:
> -		return true;
> +	unsigned int val;
> +	int ret, ret2;
> +
> +	*idle_set = false;
> +
> +	ret = regmap_test_bits(map, INV_ICM42607_REG_MCLK_RDY,
> +		       INV_ICM42607_MCLK_RDY_BIT);
Align as:
	ret = regmap_test_bits(map, INV_ICM42607_REG_MCLK_RDY,
			       INV_ICM42607_MCLK_RDY_BIT);
I think you lost a tab somewhere!

> +	if (ret < 0)
> +		return ret;
> +	if (ret)


> diff --git a/drivers/iio/imu/inv_icm42607/inv_icm42607_i2c.c b/drivers/iio/imu/inv_icm42607/inv_icm42607_i2c.c
> index 9f34199ce2949..61705b162f86f 100644
> --- a/drivers/iio/imu/inv_icm42607/inv_icm42607_i2c.c
> +++ b/drivers/iio/imu/inv_icm42607/inv_icm42607_i2c.c
> @@ -12,6 +12,12 @@
>  
>  #include "inv_icm42607.h"
>  
> +const struct regmap_config inv_icm42607_regmap_config = {
> +	.reg_bits = 8,
> +	.val_bits = 8,
> +};
> +EXPORT_SYMBOL_NS_GPL(inv_icm42607_regmap_config, "IIO_ICM42607");
I think sashiko had a comment on this being used from the SPI code
which is a problem if so.

Jonathan

  parent reply	other threads:[~2026-10-18  2:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09 14:12 [PATCH v6 0/6] Add support for InvenSense ICM-42370-P accelerometer Kanak Shilledar
2026-10-09 14:12 ` [PATCH v6 1/6] dt-bindings: iio: imu: icm42600: Add ICM-42670-P Kanak Shilledar
2026-10-12  8:58   ` Krzysztof Kozlowski
2026-10-12 10:43     ` Kanak Shilledar
2026-10-12 10:46       ` Krzysztof Kozlowski
2026-10-12 22:03         ` Marcelo Schmitt
2026-10-13  7:42           ` Jean-Baptiste Maneyrol
2026-10-16  7:18             ` Kanak Shilledar
2026-10-18  2:41               ` Jonathan Cameron
2026-10-09 14:12 ` [PATCH v6 2/6] iio: imu: inv_icm42607: Simplify IIO channel macros Kanak Shilledar
2026-10-09 14:12 ` [PATCH v6 3/6] iio: imu: inv_icm42607: Initialize gyro based on chip_info Kanak Shilledar
2026-10-09 14:24   ` sashiko-bot
2026-10-12 21:48   ` Marcelo Schmitt
2026-10-13  6:48   ` Andy Shevchenko
2026-10-09 14:12 ` [PATCH v6 4/6] iio: imu: inv_icm42607: Add support for ICM-42370-P Kanak Shilledar
2026-10-09 14:12 ` [PATCH v6 5/6] iio: imu: inv_icm42607: Implement MREGx register access Kanak Shilledar
2026-10-09 14:24   ` sashiko-bot
2026-10-18  2:52   ` Jonathan Cameron [this message]
2026-10-09 14:12 ` [PATCH v6 6/6] iio: imu: inv_icm42607: Add accelerometer calibbias support Kanak Shilledar
2026-10-12 21:55   ` Marcelo Schmitt
2026-10-18  3:01     ` 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=20261018035221.55fac14d@jic23-hlaptop \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=henrik.grimler@axis.com \
    --cc=jean-baptiste.maneyrol@tdk.com \
    --cc=joshua.crofts1@gmail.com \
    --cc=kanak.shilledar@axis.com \
    --cc=kernel@axis.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macromorgan@hotmail.com \
    --cc=marcelo.schmitt1@gmail.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