From: Jonathan Cameron <jic23@kernel.org>
To: Frank Li <Frank.Li@nxp.com>
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
Jean Delvare <jdelvare@suse.com>,
Guenter Roeck <linux@roeck-us.net>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
Krzysztof Kozlowski <krzk@kernel.org>,
linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v2 3/4] hwmon: tmp108: Add support for I3C device
Date: Sat, 9 Nov 2024 13:16:04 +0000 [thread overview]
Message-ID: <20241109131604.5d8b701a@jic23-huawei> (raw)
In-Reply-To: <20241108-p3t1085-v2-3-6a8990a59efd@nxp.com>
On Fri, 08 Nov 2024 17:26:57 -0500
Frank Li <Frank.Li@nxp.com> wrote:
> Add support for I3C device in the tmp108 driver to handle the P3T1085
> sensor. Register the I3C device driver to enable I3C functionality for the
> sensor.
>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> drivers/hwmon/tmp108.c | 31 +++++++++++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
>
> diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c
> index bfbea6349a95f..83d6847cb542c 100644
> --- a/drivers/hwmon/tmp108.c
> +++ b/drivers/hwmon/tmp108.c
> @@ -13,6 +13,8 @@
> #include <linux/mutex.h>
> #include <linux/of.h>
> #include <linux/i2c.h>
> +#include <linux/i3c/device.h>
> +#include <linux/i3c/master.h>
Seems odd you need master.h in a device driver.
I'll guess that's because you should be using i3cdev_to_device()
and not looking in the i3c_device structure at all.
> #include <linux/init.h>
> #include <linux/jiffies.h>
> #include <linux/regmap.h>
> @@ -442,6 +444,35 @@ static struct i2c_driver tmp108_driver = {
>
> module_i2c_driver(tmp108_driver);
>
> +#ifdef CONFIG_REGMAP_I3C
> +static const struct i3c_device_id p3t1085_i3c_ids[] = {
> + I3C_DEVICE(0x011b, 0x1529, NULL),
> + {},
Trivial, but no trailing comma needed here as nothing can come after
this terminator entry. That is also consistent with existing similar
tables in this driver.
> +};
> +MODULE_DEVICE_TABLE(i3c, p3t1085_i3c_ids);
> +
> +static int p3t1085_i3c_probe(struct i3c_device *i3cdev)
> +{
> + struct regmap *regmap;
> +
> + regmap = devm_regmap_init_i3c(i3cdev, &tmp108_regmap_config);
> + if (IS_ERR(regmap))
> + return dev_err_probe(&i3cdev->dev, PTR_ERR(regmap),
> + "Failed to register i3c regmap\n");
> +
> + return tmp108_common_probe(&i3cdev->dev, regmap, "p3t1085_i3c");
> +}
> +
> +static struct i3c_driver p3t1085_driver = {
> + .driver = {
> + .name = "p3t1085_i3c",
> + },
> + .probe = p3t1085_i3c_probe,
> + .id_table = p3t1085_i3c_ids,
> +};
> +module_i3c_driver(p3t1085_driver);
> +#endif
> +
> MODULE_AUTHOR("John Muir <john@jmuir.com>");
> MODULE_DESCRIPTION("Texas Instruments TMP108 temperature sensor driver");
> MODULE_LICENSE("GPL");
>
next prev parent reply other threads:[~2024-11-09 13:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-08 22:26 [PATCH v2 0/4] iio: temperature: Add support for P3T1085 Frank Li
2024-11-08 22:26 ` [PATCH v2 1/4] dt-bindings: hwmon: ti,tmp108: Add nxp,p3t1085 compatible string Frank Li
2024-11-09 10:37 ` Krzysztof Kozlowski
2024-11-08 22:26 ` [PATCH v2 2/4] hwmon: tmp108: Add help function tmp108_common_probe() Frank Li
2024-11-08 23:55 ` Guenter Roeck
2024-11-09 0:11 ` Guenter Roeck
2024-11-08 22:26 ` [PATCH v2 3/4] hwmon: tmp108: Add support for I3C device Frank Li
2024-11-09 0:10 ` Guenter Roeck
2024-11-09 13:16 ` Jonathan Cameron [this message]
2024-11-09 14:53 ` Guenter Roeck
2024-11-09 15:15 ` Jonathan Cameron
2024-11-09 16:18 ` Guenter Roeck
2024-11-11 15:08 ` Frank Li
2024-11-08 22:26 ` [PATCH v2 4/4] arm64: dts: imx93-9x9-qsb: add temp-sensor nxp,p3t1085 Frank Li
2024-11-08 23:56 ` [PATCH v2 0/4] iio: temperature: Add support for P3T1085 Guenter Roeck
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=20241109131604.5d8b701a@jic23-huawei \
--to=jic23@kernel.org \
--cc=Frank.Li@nxp.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=jdelvare@suse.com \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=krzk@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@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