[PATCH 04/13] ASoC: mediatek: mt6359-accdet: Add compatible property

Nícolas F. R. A. Prado posted 13 patches 10 months, 1 week ago
There is a newer version of this series
[PATCH 04/13] ASoC: mediatek: mt6359-accdet: Add compatible property
Posted by Nícolas F. R. A. Prado 10 months, 1 week ago
Add a compatible property and add it to the module device table for the
mt6359-accdet platform driver to allow automatic module loading and
probing when the compatible is present in DT.

Co-developed-by: Andrew Perepech <andrew.perepech@mediatek.com>
Signed-off-by: Andrew Perepech <andrew.perepech@mediatek.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
---
 sound/soc/codecs/mt6359-accdet.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sound/soc/codecs/mt6359-accdet.c b/sound/soc/codecs/mt6359-accdet.c
index ed34cc15b80e856356c07fd53af22207124e0d19..6f07db879c6a56ce4843954f51bb9602373e4aa5 100644
--- a/sound/soc/codecs/mt6359-accdet.c
+++ b/sound/soc/codecs/mt6359-accdet.c
@@ -1047,9 +1047,19 @@ static int mt6359_accdet_probe(struct platform_device *pdev)
 	return ret;
 }
 
+const struct of_device_id accdet_of_match[] = {
+	{
+		.compatible = "mediatek,mt6359-accdet",
+	}, {
+		/* sentinel */
+	},
+};
+MODULE_DEVICE_TABLE(of, accdet_of_match);
+
 static struct platform_driver mt6359_accdet_driver = {
 	.driver = {
 		.name = "pmic-codec-accdet",
+		.of_match_table = accdet_of_match,
 	},
 	.probe = mt6359_accdet_probe,
 };

-- 
2.48.1

Re: [PATCH 04/13] ASoC: mediatek: mt6359-accdet: Add compatible property
Posted by AngeloGioacchino Del Regno 10 months ago
Il 14/02/25 18:18, Nícolas F. R. A. Prado ha scritto:
> Add a compatible property and add it to the module device table for the
> mt6359-accdet platform driver to allow automatic module loading and
> probing when the compatible is present in DT.
> 
> Co-developed-by: Andrew Perepech <andrew.perepech@mediatek.com>
> Signed-off-by: Andrew Perepech <andrew.perepech@mediatek.com>
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> ---
>   sound/soc/codecs/mt6359-accdet.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 
> diff --git a/sound/soc/codecs/mt6359-accdet.c b/sound/soc/codecs/mt6359-accdet.c
> index ed34cc15b80e856356c07fd53af22207124e0d19..6f07db879c6a56ce4843954f51bb9602373e4aa5 100644
> --- a/sound/soc/codecs/mt6359-accdet.c
> +++ b/sound/soc/codecs/mt6359-accdet.c
> @@ -1047,9 +1047,19 @@ static int mt6359_accdet_probe(struct platform_device *pdev)
>   	return ret;
>   }
>   
> +const struct of_device_id accdet_of_match[] = {
> +	{
> +		.compatible = "mediatek,mt6359-accdet",
> +	}, {
> +		/* sentinel */
> +	},

Compress that stuff please...

	{ .compatible .. },
	{ /* sentinel */ }
};

after which:

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

> +};
> +MODULE_DEVICE_TABLE(of, accdet_of_match);
> +
>   static struct platform_driver mt6359_accdet_driver = {
>   	.driver = {
>   		.name = "pmic-codec-accdet",
> +		.of_match_table = accdet_of_match,
>   	},
>   	.probe = mt6359_accdet_probe,
>   };
>