[PATCH v4 2/3] hwmon: emc2305: Add OF support

florin.leotescu@oss.nxp.com posted 3 patches 9 months, 1 week ago
There is a newer version of this series
[PATCH v4 2/3] hwmon: emc2305: Add OF support
Posted by florin.leotescu@oss.nxp.com 9 months, 1 week ago
From: Florin Leotescu <florin.leotescu@nxp.com>

Introduce OF support for Microchip emc2305 pwm fan controller.

Signed-off-by: Florin Leotescu <florin.leotescu@nxp.com>
---
 drivers/hwmon/emc2305.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/hwmon/emc2305.c b/drivers/hwmon/emc2305.c
index 4d39fbd83769..f8a4c76fcadd 100644
--- a/drivers/hwmon/emc2305.c
+++ b/drivers/hwmon/emc2305.c
@@ -607,9 +607,16 @@ static void emc2305_remove(struct i2c_client *client)
 		emc2305_unset_tz(dev);
 }
 
+static const struct of_device_id of_emc2305_match_table[] = {
+	{ .compatible = "microchip,emc2305", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, of_emc2305_match_table);
+
 static struct i2c_driver emc2305_driver = {
 	.driver = {
 		.name = "emc2305",
+		.of_match_table = of_emc2305_match_table,
 	},
 	.probe = emc2305_probe,
 	.remove	  = emc2305_remove,
-- 
2.34.1
Re: [PATCH v4 2/3] hwmon: emc2305: Add OF support
Posted by Frank Li 9 months, 1 week ago
On Thu, Mar 13, 2025 at 02:57:45PM +0200, florin.leotescu@oss.nxp.com wrote:
> From: Florin Leotescu <florin.leotescu@nxp.com>
>
> Introduce OF support for Microchip emc2305 pwm fan controller.
>
> Signed-off-by: Florin Leotescu <florin.leotescu@nxp.com>

Reviewed-by: Frank Li <Frank.Li@nxp.com>

> ---
>  drivers/hwmon/emc2305.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/hwmon/emc2305.c b/drivers/hwmon/emc2305.c
> index 4d39fbd83769..f8a4c76fcadd 100644
> --- a/drivers/hwmon/emc2305.c
> +++ b/drivers/hwmon/emc2305.c
> @@ -607,9 +607,16 @@ static void emc2305_remove(struct i2c_client *client)
>  		emc2305_unset_tz(dev);
>  }
>
> +static const struct of_device_id of_emc2305_match_table[] = {
> +	{ .compatible = "microchip,emc2305", },
> +	{},
> +};
> +MODULE_DEVICE_TABLE(of, of_emc2305_match_table);
> +
>  static struct i2c_driver emc2305_driver = {
>  	.driver = {
>  		.name = "emc2305",
> +		.of_match_table = of_emc2305_match_table,
>  	},
>  	.probe = emc2305_probe,
>  	.remove	  = emc2305_remove,
> --
> 2.34.1
>