diff mbox

[v10,2/7] ASoC: codec: wm9712 simple DT bindings

Message ID 1374924716-23475-3-git-send-email-mpa@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Markus Pargmann July 27, 2013, 11:31 a.m. UTC
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
 Documentation/devicetree/bindings/sound/wm9712.txt | 10 ++++++++++
 sound/soc/codecs/wm9712.c                          |  9 +++++++++
 2 files changed, 19 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/wm9712.txt

Comments

Mark Brown July 27, 2013, 11:59 a.m. UTC | #1
On Sat, Jul 27, 2013 at 01:31:51PM +0200, Markus Pargmann wrote:

> +static const struct of_device_id wm9712_codec_of_dev_id[] = {
> +	{
> +		.compatible = "wlf,wm9712",
> +	}, {
> +		/* sentinel */
> +	}
> +};
> +
>  static struct platform_driver wm9712_codec_driver = {
>  	.driver = {
>  		.name = "wm9712-codec",
>  		.owner = THIS_MODULE,
> +		.of_match_table = wm9712_codec_of_dev_id,
>  	},
>  
>  	.probe = wm9712_probe,

AC'97 is an enumerable bus, we shouldn't need this...
Markus Pargmann July 27, 2013, 1:44 p.m. UTC | #2
On Sat, Jul 27, 2013 at 12:59:50PM +0100, Mark Brown wrote:
> On Sat, Jul 27, 2013 at 01:31:51PM +0200, Markus Pargmann wrote:
> 
> > +static const struct of_device_id wm9712_codec_of_dev_id[] = {
> > +	{
> > +		.compatible = "wlf,wm9712",
> > +	}, {
> > +		/* sentinel */
> > +	}
> > +};
> > +
> >  static struct platform_driver wm9712_codec_driver = {
> >  	.driver = {
> >  		.name = "wm9712-codec",
> >  		.owner = THIS_MODULE,
> > +		.of_match_table = wm9712_codec_of_dev_id,
> >  	},
> >  
> >  	.probe = wm9712_probe,
> 
> AC'97 is an enumerable bus, we shouldn't need this...

What do you mean exactly? Is there a way to automaticaly discover
connected codecs and register them?

Regards,

Markus
Mark Brown July 27, 2013, 2:21 p.m. UTC | #3
On Sat, Jul 27, 2013 at 03:44:52PM +0200, Markus Pargmann wrote:
> On Sat, Jul 27, 2013 at 12:59:50PM +0100, Mark Brown wrote:

> > AC'97 is an enumerable bus, we shouldn't need this...

> What do you mean exactly? Is there a way to automaticaly discover
> connected codecs and register them?

Yes, of coure - just read the ID registers.  Look at how the non-ASoC
AC'97 code works.
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/sound/wm9712.txt b/Documentation/devicetree/bindings/sound/wm9712.txt
new file mode 100644
index 0000000..d29f673
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/wm9712.txt
@@ -0,0 +1,10 @@ 
+WM9712 audio CODEC
+
+Required properties:
+  - compatible : "wlf,wm9712"
+
+Example:
+
+wm9712: codec {
+	compatible = "wlf,wm9712";
+};
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index c5eb746..d619cdc 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -697,10 +697,19 @@  static int wm9712_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id wm9712_codec_of_dev_id[] = {
+	{
+		.compatible = "wlf,wm9712",
+	}, {
+		/* sentinel */
+	}
+};
+
 static struct platform_driver wm9712_codec_driver = {
 	.driver = {
 		.name = "wm9712-codec",
 		.owner = THIS_MODULE,
+		.of_match_table = wm9712_codec_of_dev_id,
 	},
 
 	.probe = wm9712_probe,