[PATCH 2/2] ASoC: codecs: aw88261: Add devicetree support

Luca Weiss posted 2 patches 1 month ago
[PATCH 2/2] ASoC: codecs: aw88261: Add devicetree support
Posted by Luca Weiss 1 month ago
Add the compatible "awinic,aw88261" so that module autoloading will work
based on the compatible from devicetree.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
 sound/soc/codecs/aw88261.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sound/soc/codecs/aw88261.c b/sound/soc/codecs/aw88261.c
index ceea0c8c60b1..810c90f5e783 100644
--- a/sound/soc/codecs/aw88261.c
+++ b/sound/soc/codecs/aw88261.c
@@ -1269,9 +1269,16 @@ static const struct i2c_device_id aw88261_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, aw88261_i2c_id);
 
+static const struct of_device_id aw88261_of_table[] = {
+	{ .compatible = "awinic,aw88261" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, aw88261_of_table);
+
 static struct i2c_driver aw88261_i2c_driver = {
 	.driver = {
 		.name = "aw88261",
+		.of_match_table = aw88261_of_table,
 	},
 	.probe = aw88261_i2c_probe,
 	.id_table = aw88261_i2c_id,

-- 
2.52.0
Re: [PATCH 2/2] ASoC: codecs: aw88261: Add devicetree support
Posted by Bhushan Shah 1 month ago
On Friday, 9 January 2026 20:32:06 IST Luca Weiss wrote:
> Add the compatible "awinic,aw88261" so that module autoloading will work
> based on the compatible from devicetree.
> 
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>

Tested-by: Bhushan Shah <bhushan.shah@machinesoul.in>

> ---
>  sound/soc/codecs/aw88261.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/sound/soc/codecs/aw88261.c b/sound/soc/codecs/aw88261.c
> index ceea0c8c60b1..810c90f5e783 100644
> --- a/sound/soc/codecs/aw88261.c
> +++ b/sound/soc/codecs/aw88261.c
> @@ -1269,9 +1269,16 @@ static const struct i2c_device_id aw88261_i2c_id[] =
> { };
>  MODULE_DEVICE_TABLE(i2c, aw88261_i2c_id);
> 
> +static const struct of_device_id aw88261_of_table[] = {
> +	{ .compatible = "awinic,aw88261" },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(of, aw88261_of_table);
> +
>  static struct i2c_driver aw88261_i2c_driver = {
>  	.driver = {
>  		.name = "aw88261",
> +		.of_match_table = aw88261_of_table,
>  	},
>  	.probe = aw88261_i2c_probe,
>  	.id_table = aw88261_i2c_id,