diff mbox series

[v2,2/3] ASoC: wm8961: add support for devicetree

Message ID 20221003032414.248326-3-doug@schmorgal.com (mailing list archive)
State Accepted
Commit c96851ee8195c820b765c6a7effcec79c81eb9c6
Headers show
Series ASoC: add devicetree support for WM8961 codec | expand

Commit Message

Doug Brown Oct. 3, 2022, 3:24 a.m. UTC
Add support for devicetree to the WM8961 driver so it can be used with
modern DT-based kernels.

Signed-off-by: Doug Brown <doug@schmorgal.com>
---
 sound/soc/codecs/wm8961.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Charles Keepax Oct. 3, 2022, 10:11 a.m. UTC | #1
On Sun, Oct 02, 2022 at 08:24:13PM -0700, Doug Brown wrote:
> Add support for devicetree to the WM8961 driver so it can be used with
> modern DT-based kernels.
> 
> Signed-off-by: Doug Brown <doug@schmorgal.com>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles
diff mbox series

Patch

diff --git a/sound/soc/codecs/wm8961.c b/sound/soc/codecs/wm8961.c
index 7dc6aaf65576..a4857024711d 100644
--- a/sound/soc/codecs/wm8961.c
+++ b/sound/soc/codecs/wm8961.c
@@ -971,9 +971,16 @@  static const struct i2c_device_id wm8961_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, wm8961_i2c_id);
 
+static const struct of_device_id wm8961_of_match[] __maybe_unused = {
+	{ .compatible = "wlf,wm8961", },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, wm8961_of_match);
+
 static struct i2c_driver wm8961_i2c_driver = {
 	.driver = {
 		.name = "wm8961",
+		.of_match_table = of_match_ptr(wm8961_of_match),
 	},
 	.probe_new = wm8961_i2c_probe,
 	.id_table = wm8961_i2c_id,