From: Keguang Zhang Date: Wed, 9 Apr 2025 10:29:34 +0000 (+0800) Subject: ASoC: ac97: Add DT support X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=436a3cc8afbf34bb68166c2c5c19ca5113c0c756;p=users%2Fjedix%2Flinux-maple.git ASoC: ac97: Add DT support Add an of_match_table with 'realtek,alc203' to provide DT support for the AC97 generic codec driver. Signed-off-by: Keguang Zhang Link: https://patch.msgid.link/20250409-loongson1-ac97-v2-4-65d5db96a046@gmail.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c index 0e013edfe63d7..d8444a083af2e 100644 --- a/sound/soc/codecs/ac97.c +++ b/sound/soc/codecs/ac97.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -127,9 +128,18 @@ static int ac97_probe(struct platform_device *pdev) &soc_component_dev_ac97, &ac97_dai, 1); } +#ifdef CONFIG_OF +static const struct of_device_id ac97_codec_of_match[] = { + { .compatible = "realtek,alc203", }, + { } +}; +MODULE_DEVICE_TABLE(of, ac97_codec_of_match); +#endif + static struct platform_driver ac97_codec_driver = { .driver = { .name = "ac97-codec", + .of_match_table = of_match_ptr(ac97_codec_of_match), }, .probe = ac97_probe,