All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add rudimentary DT support to SSM2518 codec driver
@ 2015-08-13 12:23 Ricard Wanderlof
  0 siblings, 0 replies; only message in thread
From: Ricard Wanderlof @ 2015-08-13 12:23 UTC (permalink / raw)
  To: alsa-devel


For some reason, the SSM2518 codec driver has device tree bindings 
specified (Documentation/devicetree/bindings/sound/ssm2518.txt) but the 
actual driver doesn't seem to support DT. This patch adds rudimentary 
support for the compatible property so that the driver can be used in a DT 
based setup.

---
 sound/soc/codecs/ssm2518.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/ssm2518.c b/sound/soc/codecs/ssm2518.c
index 67ea55a..ecf9996 100644
--- a/sound/soc/codecs/ssm2518.c
+++ b/sound/soc/codecs/ssm2518.c
@@ -811,6 +810,14 @@ static int ssm2518_i2c_remove(struct i2c_client *client)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id ssm2518_dt_ids[] = {
+	{ .compatible = "adi,ssm2518", },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, ssm2518_dt_ids);
+#endif
+
 static const struct i2c_device_id ssm2518_i2c_ids[] = {
 	{ "ssm2518", 0 },
 	{ }
@@ -821,6 +828,9 @@ static struct i2c_driver ssm2518_driver = {
 	.driver = {
 		.name = "ssm2518",
 		.owner = THIS_MODULE,
+#ifdef CONFIG_OF
+		.of_match_table = of_match_ptr(ssm2518_dt_ids),
+#endif
 	},
 	.probe = ssm2518_i2c_probe,
 	.remove = ssm2518_i2c_remove,
-- 
1.7.10.4


-- 
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-13 12:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-13 12:23 [PATCH] Add rudimentary DT support to SSM2518 codec driver Ricard Wanderlof

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.