public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Keguang Zhang via B4 Relay <devnull+keguang.zhang.gmail.com@kernel.org>
To: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,  Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	Jaroslav Kysela <perex@perex.cz>,  Takashi Iwai <tiwai@suse.com>
Cc: linux-mips@vger.kernel.org, linux-sound@vger.kernel.org,
	 devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Keguang Zhang <keguang.zhang@gmail.com>
Subject: [PATCH v2 4/4] ASoC: ac97: Add DT support
Date: Wed, 09 Apr 2025 18:29:34 +0800	[thread overview]
Message-ID: <20250409-loongson1-ac97-v2-4-65d5db96a046@gmail.com> (raw)
In-Reply-To: <20250409-loongson1-ac97-v2-0-65d5db96a046@gmail.com>

From: Keguang Zhang <keguang.zhang@gmail.com>

Add an of_match_table with 'realtek,alc203' to provide
DT support for the AC97 generic codec driver.

Signed-off-by: Keguang Zhang <keguang.zhang@gmail.com>
---
 sound/soc/codecs/ac97.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c
index 0e013edfe63d..d8444a083af2 100644
--- a/sound/soc/codecs/ac97.c
+++ b/sound/soc/codecs/ac97.c
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/device.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/ac97_codec.h>
@@ -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,

-- 
2.43.0



  parent reply	other threads:[~2025-04-09 10:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09 10:29 [PATCH v2 0/4] Add support for Loongson-1 AC97 Keguang Zhang via B4 Relay
2025-04-09 10:29 ` [PATCH v2 1/4] ASoC: dt-bindings: Add Loongson-1 AC97 Controller Keguang Zhang via B4 Relay
2025-04-09 10:29 ` [PATCH v2 2/4] ASoC: dt-bindings: Add Realtek ALC203 Codec Keguang Zhang via B4 Relay
2025-04-10  5:58   ` Krzysztof Kozlowski
2025-04-09 10:29 ` [PATCH v2 3/4] ASoC: loongson: Add Loongson-1 AC97 Driver Keguang Zhang via B4 Relay
2025-04-09 10:29 ` Keguang Zhang via B4 Relay [this message]
2025-04-14 13:56 ` [PATCH v2 0/4] Add support for Loongson-1 AC97 Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250409-loongson1-ac97-v2-4-65d5db96a046@gmail.com \
    --to=devnull+keguang.zhang.gmail.com@kernel.org \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=keguang.zhang@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox