[PATCH] mfd: max77620: publish I2C and OF module aliases

hpp.iscas posted 1 patch 2 weeks, 6 days ago
drivers/mfd/max77620.c | 10 ++++++++++
1 file changed, 10 insertions(+)
[PATCH] mfd: max77620: publish I2C and OF module aliases
Posted by hpp.iscas 2 weeks, 6 days ago
MFD_MAX77620 became tristate without publishing any module alias for the
I2C driver. Device Tree I2C clients emit OF modaliases, while legacy
board-info clients use the existing I2C IDs, so both supported
enumeration paths need module metadata.

Publish the I2C table and add an OF table for the three documented
compatibles. Keep i2c_client_get_device_id() as the source of chip data
and leave MFD child registration unchanged.

Fixes: 0d084ee9ba87 ("mfd: max77620: Allow building as a module")
Signed-off-by: hpp.iscas <hppiscas@163.com>
---
 drivers/mfd/max77620.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/mfd/max77620.c b/drivers/mfd/max77620.c
index c4f89a9..6a624e6 100644
--- a/drivers/mfd/max77620.c
+++ b/drivers/mfd/max77620.c
@@ -699,6 +699,15 @@ static const struct i2c_device_id max77620_id[] = {
 	{"max77663", MAX77663},
 	{},
 };
+MODULE_DEVICE_TABLE(i2c, max77620_id);
+
+static const struct of_device_id max77620_of_match[] = {
+	{ .compatible = "maxim,max77620" },
+	{ .compatible = "maxim,max20024" },
+	{ .compatible = "maxim,max77663" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, max77620_of_match);
 
 static DEFINE_SIMPLE_DEV_PM_OPS(max77620_pm_ops,
 				max77620_i2c_suspend, max77620_i2c_resume);
@@ -706,6 +715,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(max77620_pm_ops,
 static struct i2c_driver max77620_driver = {
 	.driver = {
 		.name = "max77620",
+		.of_match_table = max77620_of_match,
 		.pm = pm_sleep_ptr(&max77620_pm_ops),
 	},
 	.probe = max77620_probe,
Re: [PATCH] mfd: max77620: publish I2C and OF module aliases
Posted by Lee Jones 2 weeks, 1 day ago
On Sat, 05 Sep 2026, hpp.iscas wrote:

> MFD_MAX77620 became tristate without publishing any module alias for the
> I2C driver. Device Tree I2C clients emit OF modaliases, while legacy
> board-info clients use the existing I2C IDs, so both supported
> enumeration paths need module metadata.
> 
> Publish the I2C table and add an OF table for the three documented
> compatibles. Keep i2c_client_get_device_id() as the source of chip data
> and leave MFD child registration unchanged.
> 
> Fixes: 0d084ee9ba87 ("mfd: max77620: Allow building as a module")
> Signed-off-by: hpp.iscas <hppiscas@163.com>

Real name please.

> ---
>  drivers/mfd/max77620.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/mfd/max77620.c b/drivers/mfd/max77620.c
> index c4f89a9..6a624e6 100644
> --- a/drivers/mfd/max77620.c
> +++ b/drivers/mfd/max77620.c
> @@ -699,6 +699,15 @@ static const struct i2c_device_id max77620_id[] = {
>  	{"max77663", MAX77663},
>  	{},
>  };
> +MODULE_DEVICE_TABLE(i2c, max77620_id);
> +
> +static const struct of_device_id max77620_of_match[] = {
> +	{ .compatible = "maxim,max77620" },
> +	{ .compatible = "maxim,max20024" },
> +	{ .compatible = "maxim,max77663" },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(of, max77620_of_match);
>  
>  static DEFINE_SIMPLE_DEV_PM_OPS(max77620_pm_ops,
>  				max77620_i2c_suspend, max77620_i2c_resume);
> @@ -706,6 +715,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(max77620_pm_ops,
>  static struct i2c_driver max77620_driver = {
>  	.driver = {
>  		.name = "max77620",
> +		.of_match_table = max77620_of_match,
>  		.pm = pm_sleep_ptr(&max77620_pm_ops),
>  	},
>  	.probe = max77620_probe,
> 

-- 
Lee Jones