Devicetree
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Remi Buisson via B4 Relay <devnull+remi.buisson.tdk.com@kernel.org>
Cc: remi.buisson@tdk.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>,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v3 7/8] iio: imu: inv_icm45600: add I3C driver for inv_icm45600 driver
Date: Thu, 24 Jul 2025 17:18:11 +0100	[thread overview]
Message-ID: <20250724171811.55b0bc0b@jic23-huawei> (raw)
In-Reply-To: <20250717-add_newport_driver-v3-7-c6099e02c562@tdk.com>

On Thu, 17 Jul 2025 13:25:59 +0000
Remi Buisson via B4 Relay <devnull+remi.buisson.tdk.com@kernel.org> wrote:

> From: Remi Buisson <remi.buisson@tdk.com>
> 
> Add I3C driver for InvenSense ICM-45600 devices.
> 
> Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
A few more trivial things in here.

Thanks,

Jonathan

> diff --git a/drivers/iio/imu/inv_icm45600/inv_icm45600_i3c.c b/drivers/iio/imu/inv_icm45600/inv_icm45600_i3c.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..9db249ca53ec3fecb0f85792a353d05463f52acb
> --- /dev/null
> +++ b/drivers/iio/imu/inv_icm45600/inv_icm45600_i3c.c
> @@ -0,0 +1,82 @@

> +};
> +
> +static const struct i3c_device_id inv_icm45600_i3c_ids[] = {
> +	I3C_DEVICE_EXTRA_INFO(0x0235, 0x0000, 0x0011, (void *)NULL),
> +	I3C_DEVICE_EXTRA_INFO(0x0235, 0x0000, 0x0084, (void *)NULL),
> +	{ /* sentinel */ },

no comma on sentinels.


> +static int inv_icm45600_i3c_probe(struct i3c_device *i3cdev)
> +{
> +	int ret;
> +	unsigned int whoami;
> +	struct regmap *regmap;
> +	const int nb_chip = ARRAY_SIZE(i3c_chip_info);
> +	int chip;
> +
> +	regmap = devm_regmap_init_i3c(i3cdev, &inv_icm45600_regmap_config);
> +	if (IS_ERR(regmap)) {
> +		dev_err(&i3cdev->dev, "Failed to register i3c regmap %ld\n", PTR_ERR(regmap));
> +		return PTR_ERR(regmap);
Use return dev_err_probe() for all error messages in probe.

> +	}
> +
> +	ret = regmap_read(regmap, INV_ICM45600_REG_WHOAMI, &whoami);
> +	if (ret) {
> +		dev_err(&i3cdev->dev, "Failed to read part id %d\n", whoami);
> +		return ret;
> +	}
> +
> +	for (chip = 0; chip < nb_chip; chip++) {
> +		if (whoami == i3c_chip_info[chip]->whoami)
> +			break;
> +	}
> +
> +	if (chip == nb_chip) {
> +		dev_err(&i3cdev->dev, "Failed to match part id %d\n", whoami);
> +		return -ENODEV;
> +	}
> +
> +	return inv_icm45600_core_probe(regmap, i3c_chip_info[chip], false, NULL);
> +}

> 


  reply	other threads:[~2025-07-24 16:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-17 13:25 [PATCH v3 0/8] iio: imu: new inv_icm45600 driver Remi Buisson via B4 Relay
2025-07-17 13:25 ` [PATCH v3 1/8] dt-bindings: iio: imu: Add inv_icm45600 Remi Buisson via B4 Relay
2025-07-18  7:21   ` Krzysztof Kozlowski
2025-07-17 13:25 ` [PATCH v3 2/8] iio: imu: inv_icm45600: add new inv_icm45600 driver Remi Buisson via B4 Relay
2025-07-24 15:56   ` Jonathan Cameron
2025-08-13 10:06     ` Remi Buisson
2025-07-17 13:25 ` [PATCH v3 3/8] iio: imu: inv_icm45600: add buffer support in iio devices Remi Buisson via B4 Relay
2025-07-24 16:05   ` Jonathan Cameron
2025-08-13 10:08     ` Remi Buisson
2025-07-17 13:25 ` [PATCH v3 4/8] iio: imu: inv_icm45600: add IMU IIO devices Remi Buisson via B4 Relay
2025-07-24 16:15   ` Jonathan Cameron
2025-08-13 10:10     ` Remi Buisson
2025-07-17 13:25 ` [PATCH v3 5/8] iio: imu: inv_icm45600: add I2C driver for inv_icm45600 driver Remi Buisson via B4 Relay
2025-07-24 16:16   ` Jonathan Cameron
2025-07-17 13:25 ` [PATCH v3 6/8] iio: imu: inv_icm45600: add SPI " Remi Buisson via B4 Relay
2025-07-17 13:25 ` [PATCH v3 7/8] iio: imu: inv_icm45600: add I3C " Remi Buisson via B4 Relay
2025-07-24 16:18   ` Jonathan Cameron [this message]
2025-08-13 10:11     ` Remi Buisson
2025-07-17 13:26 ` [PATCH v3 8/8] MAINTAINERS: add entry for inv_icm45600 6-axis imu sensor Remi Buisson via B4 Relay

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=20250724171811.55b0bc0b@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=devnull+remi.buisson.tdk.com@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=remi.buisson@tdk.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