* [PATCH] Add rudimentary device tree support for SSM2518
@ 2015-08-13 12:12 Ricard Wanderlof
2015-08-13 12:27 ` Lars-Peter Clausen
0 siblings, 1 reply; 2+ messages in thread
From: Ricard Wanderlof @ 2015-08-13 12:12 UTC (permalink / raw)
To: alsa-devel@alsa-project.org
For some reason the SSM2518 codec driver doesn't have DT support, even
though there are bindings described for it in
Documentation/devicetree/sound/ssm2518.txt . This patch adds rudimentary
DT support for the compatible property which is a step forward.
Signed-off-by: Ricard Wanderlof <ricardw@axis.com>
---
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] 2+ messages in thread
* Re: [PATCH] Add rudimentary device tree support for SSM2518
2015-08-13 12:12 [PATCH] Add rudimentary device tree support for SSM2518 Ricard Wanderlof
@ 2015-08-13 12:27 ` Lars-Peter Clausen
0 siblings, 0 replies; 2+ messages in thread
From: Lars-Peter Clausen @ 2015-08-13 12:27 UTC (permalink / raw)
To: Ricard Wanderlof, alsa-devel@alsa-project.org, Mark Brown,
Liam Girdwood
On 08/13/2015 02:12 PM, Ricard Wanderlof wrote:
>
> For some reason the SSM2518 codec driver doesn't have DT support, even
> though there are bindings described for it in
> Documentation/devicetree/sound/ssm2518.txt . This patch adds rudimentary
> DT support for the compatible property which is a step forward.
>
> Signed-off-by: Ricard Wanderlof <ricardw@axis.com>
Patch looks mostly good, but make sure to use a patch subject that follows
the general style of the subsystem you are sending the patch for. In this
case it should be something like:
ASoC: ssm2518: Add rudimentary device tree support
Also make sure that when you send a patch to add the maintainers of the
subsystem to your receiver list, so they'll see the patch can pick it up. In
this case that is Mark and Liam
One issue inline.
> ---
> 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
[...]
> @@ -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
If you use of_match_ptr() you don't need the #ifdef CONFIG_OF, so just drop
the two lines.
> },
> .probe = ssm2518_i2c_probe,
> .remove = ssm2518_i2c_remove,
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-13 12:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-13 12:12 [PATCH] Add rudimentary device tree support for SSM2518 Ricard Wanderlof
2015-08-13 12:27 ` Lars-Peter Clausen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox