diff mbox series

[4/6] ASoC: codecs: jz4740: Add support for devicetree

Message ID 20190205031108.26171-4-paul@crapouillou.net (mailing list archive)
State New, archived
Headers show
Series [1/6] dt-bindings: sound: Document jz4740-codec bindings | expand

Commit Message

Paul Cercueil Feb. 5, 2019, 3:11 a.m. UTC
Add support for probing the driver from devicetree.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 sound/soc/codecs/jz4740.c | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/sound/soc/codecs/jz4740.c b/sound/soc/codecs/jz4740.c
index af57a7d6ec12..b5a1323f0883 100644
--- a/sound/soc/codecs/jz4740.c
+++ b/sound/soc/codecs/jz4740.c
@@ -347,10 +347,19 @@  static int jz4740_codec_probe(struct platform_device *pdev)
 	return ret;
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id jz4740_codec_of_matches[] = {
+	{ .compatible = "ingenic,jz4740-codec", },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, jz4740_codec_of_matches);
+#endif
+
 static struct platform_driver jz4740_codec_driver = {
 	.probe = jz4740_codec_probe,
 	.driver = {
 		.name = "jz4740-codec",
+		.of_match_table = of_match_ptr(jz4740_codec_of_matches),
 	},
 };