All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ASoC: Add device tree binding for WM8770
@ 2011-08-29 13:27 Mark Brown
  2011-08-29 13:27 ` [PATCH 2/3] ASoC: Add device tree binding for WM8776 Mark Brown
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Mark Brown @ 2011-08-29 13:27 UTC (permalink / raw)
  To: Liam Girdwood, Grant Likely
  Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	patches-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Mark Brown

Signed-off-by: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
---
 Documentation/devicetree/bindings/sound/wm8770.txt |   16 ++++++++++++++++
 sound/soc/codecs/wm8770.c                          |    8 ++++++++
 2 files changed, 24 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/wm8770.txt

diff --git a/Documentation/devicetree/bindings/sound/wm8770.txt b/Documentation/devicetree/bindings/sound/wm8770.txt
new file mode 100644
index 0000000..866e00c
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/wm8770.txt
@@ -0,0 +1,16 @@
+WM8770 audio CODEC
+
+This device supports SPI.
+
+Required properties:
+
+  - compatible : "wlf,wm8770"
+
+  - reg : the chip select number.
+
+Example:
+
+codec: wm8770@1 {
+	compatible = "wlf,wm8770";
+	reg = <1>;
+};
diff --git a/sound/soc/codecs/wm8770.c b/sound/soc/codecs/wm8770.c
index 19b92ba..aa05e65 100644
--- a/sound/soc/codecs/wm8770.c
+++ b/sound/soc/codecs/wm8770.c
@@ -14,6 +14,7 @@
 #include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/delay.h>
+#include <linux/of_device.h>
 #include <linux/pm.h>
 #include <linux/platform_device.h>
 #include <linux/spi/spi.h>
@@ -684,6 +685,12 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8770 = {
 	.reg_cache_default = wm8770_reg_defs
 };
 
+static const struct of_device_id wm8770_of_match[] = {
+	{ .compatible = "wlf,wm8770", },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, wm8770_of_match);
+
 #if defined(CONFIG_SPI_MASTER)
 static int __devinit wm8770_spi_probe(struct spi_device *spi)
 {
@@ -715,6 +722,7 @@ static struct spi_driver wm8770_spi_driver = {
 	.driver = {
 		.name = "wm8770",
 		.owner = THIS_MODULE,
+		.of_match_table = wm8770_of_match,
 	},
 	.probe = wm8770_spi_probe,
 	.remove = __devexit_p(wm8770_spi_remove)
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] ASoC: Add device tree binding for WM8776
  2011-08-29 13:27 [PATCH 1/3] ASoC: Add device tree binding for WM8770 Mark Brown
@ 2011-08-29 13:27 ` Mark Brown
  2011-08-29 13:27 ` [PATCH 3/3] ASoC: Add device tree binding for WM8804 Mark Brown
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2011-08-29 13:27 UTC (permalink / raw)
  To: Liam Girdwood, Grant Likely
  Cc: alsa-devel, patches, devicetree-discuss, Mark Brown

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 Documentation/devicetree/bindings/sound/wm8776.txt |   18 ++++++++++++++++++
 sound/soc/codecs/wm8776.c                          |    9 +++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/wm8776.txt

diff --git a/Documentation/devicetree/bindings/sound/wm8776.txt b/Documentation/devicetree/bindings/sound/wm8776.txt
new file mode 100644
index 0000000..3b9ca49
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/wm8776.txt
@@ -0,0 +1,18 @@
+WM8776 audio CODEC
+
+This device supports both I2C and SPI (configured with pin strapping
+on the board).
+
+Required properties:
+
+  - compatible : "wlf,wm8776"
+
+  - reg : the I2C address of the device for I2C, the chip select
+          number for SPI.
+
+Example:
+
+codec: wm8776@1a {
+	compatible = "wlf,wm8776";
+	reg = <0x1a>;
+};
diff --git a/sound/soc/codecs/wm8776.c b/sound/soc/codecs/wm8776.c
index 367a990..0cfbfc1 100644
--- a/sound/soc/codecs/wm8776.c
+++ b/sound/soc/codecs/wm8776.c
@@ -18,6 +18,7 @@
 #include <linux/delay.h>
 #include <linux/pm.h>
 #include <linux/i2c.h>
+#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/spi/spi.h>
 #include <linux/slab.h>
@@ -452,6 +453,12 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8776 = {
 	.reg_cache_default = wm8776_reg,
 };
 
+static const struct of_device_id wm8776_of_match[] = {
+	{ .compatible = "wlf,wm8776", },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, wm8776_of_match);
+
 #if defined(CONFIG_SPI_MASTER)
 static int __devinit wm8776_spi_probe(struct spi_device *spi)
 {
@@ -483,6 +490,7 @@ static struct spi_driver wm8776_spi_driver = {
 	.driver = {
 		.name	= "wm8776",
 		.owner	= THIS_MODULE,
+		.of_match_table = wm8776_of_match,
 	},
 	.probe		= wm8776_spi_probe,
 	.remove		= __devexit_p(wm8776_spi_remove),
@@ -527,6 +535,7 @@ static struct i2c_driver wm8776_i2c_driver = {
 	.driver = {
 		.name = "wm8776",
 		.owner = THIS_MODULE,
+		.of_match_table = wm8776_of_match,
 	},
 	.probe =    wm8776_i2c_probe,
 	.remove =   __devexit_p(wm8776_i2c_remove),
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] ASoC: Add device tree binding for WM8804
  2011-08-29 13:27 [PATCH 1/3] ASoC: Add device tree binding for WM8770 Mark Brown
  2011-08-29 13:27 ` [PATCH 2/3] ASoC: Add device tree binding for WM8776 Mark Brown
@ 2011-08-29 13:27 ` Mark Brown
  2011-08-30 15:48 ` [PATCH 1/3] ASoC: Add device tree binding for WM8770 Tabi Timur-B04825
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2011-08-29 13:27 UTC (permalink / raw)
  To: Liam Girdwood, Grant Likely
  Cc: alsa-devel, patches, devicetree-discuss, Mark Brown

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 Documentation/devicetree/bindings/sound/wm8804.txt |   18 ++++++++++++++++++
 sound/soc/codecs/wm8804.c                          |    9 +++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/wm8804.txt

diff --git a/Documentation/devicetree/bindings/sound/wm8804.txt b/Documentation/devicetree/bindings/sound/wm8804.txt
new file mode 100644
index 0000000..4d3a56f
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/wm8804.txt
@@ -0,0 +1,18 @@
+WM8804 audio CODEC
+
+This device supports both I2C and SPI (configured with pin strapping
+on the board).
+
+Required properties:
+
+  - compatible : "wlf,wm8804"
+
+  - reg : the I2C address of the device for I2C, the chip select
+          number for SPI.
+
+Example:
+
+codec: wm8804@1a {
+	compatible = "wlf,wm8804";
+	reg = <0x1a>;
+};
diff --git a/sound/soc/codecs/wm8804.c b/sound/soc/codecs/wm8804.c
index 9a5e67c..9ee072b 100644
--- a/sound/soc/codecs/wm8804.c
+++ b/sound/soc/codecs/wm8804.c
@@ -16,6 +16,7 @@
 #include <linux/delay.h>
 #include <linux/pm.h>
 #include <linux/i2c.h>
+#include <linux/of_device.h>
 #include <linux/spi/spi.h>
 #include <linux/regulator/consumer.h>
 #include <linux/slab.h>
@@ -717,6 +718,12 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8804 = {
 	.volatile_register = wm8804_volatile
 };
 
+static const struct of_device_id wm8804_of_match[] = {
+	{ .compatible = "wlf,wm8804", },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, wm8804_of_match);
+
 #if defined(CONFIG_SPI_MASTER)
 static int __devinit wm8804_spi_probe(struct spi_device *spi)
 {
@@ -748,6 +755,7 @@ static struct spi_driver wm8804_spi_driver = {
 	.driver = {
 		.name = "wm8804",
 		.owner = THIS_MODULE,
+		.of_match_table = wm8804_of_match,
 	},
 	.probe = wm8804_spi_probe,
 	.remove = __devexit_p(wm8804_spi_remove)
@@ -792,6 +800,7 @@ static struct i2c_driver wm8804_i2c_driver = {
 	.driver = {
 		.name = "wm8804",
 		.owner = THIS_MODULE,
+		.of_match_table = wm8804_of_match,
 	},
 	.probe = wm8804_i2c_probe,
 	.remove = __devexit_p(wm8804_i2c_remove),
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] ASoC: Add device tree binding for WM8770
  2011-08-29 13:27 [PATCH 1/3] ASoC: Add device tree binding for WM8770 Mark Brown
  2011-08-29 13:27 ` [PATCH 2/3] ASoC: Add device tree binding for WM8776 Mark Brown
  2011-08-29 13:27 ` [PATCH 3/3] ASoC: Add device tree binding for WM8804 Mark Brown
@ 2011-08-30 15:48 ` Tabi Timur-B04825
       [not found]   ` <CAOZdJXUQpyvxOVgS9mPnMwJM1TNF-X+zOVkOsDqJM_oBNQih0Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
       [not found] ` <1314624471-15381-1-git-send-email-broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
  2011-08-31 10:30 ` Liam Girdwood
  4 siblings, 1 reply; 9+ messages in thread
From: Tabi Timur-B04825 @ 2011-08-30 15:48 UTC (permalink / raw)
  To: Mark Brown
  Cc: Grant Likely, alsa-devel, patches, Liam Girdwood, devicetree-discuss

On Mon, Aug 29, 2011 at 8:27 AM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>  Documentation/devicetree/bindings/sound/wm8770.txt |   16 ++++++++++++++++

I don't think we should have a separate text file for each codec.
We'll soon have dozens of files that are almost identical.  Can't we
have one text file that describes most of the codec nodes, and only
add new text files for exceptions?

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] ASoC: Add device tree binding for WM8770
       [not found] ` <1314624471-15381-1-git-send-email-broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
@ 2011-08-30 16:13   ` Grant Likely
  0 siblings, 0 replies; 9+ messages in thread
From: Grant Likely @ 2011-08-30 16:13 UTC (permalink / raw)
  To: Mark Brown
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	patches-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
	Liam Girdwood

On Mon, Aug 29, 2011 at 02:27:49PM +0100, Mark Brown wrote:
> Signed-off-by: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>

All three look fine.

I do agree with Timur that if the bindings don't have anything device
specific in them, then it would be fine to have one text file for all
of them.

g.

> ---
>  Documentation/devicetree/bindings/sound/wm8770.txt |   16 ++++++++++++++++
>  sound/soc/codecs/wm8770.c                          |    8 ++++++++
>  2 files changed, 24 insertions(+), 0 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/sound/wm8770.txt
> 
> diff --git a/Documentation/devicetree/bindings/sound/wm8770.txt b/Documentation/devicetree/bindings/sound/wm8770.txt
> new file mode 100644
> index 0000000..866e00c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/wm8770.txt
> @@ -0,0 +1,16 @@
> +WM8770 audio CODEC
> +
> +This device supports SPI.
> +
> +Required properties:
> +
> +  - compatible : "wlf,wm8770"
> +
> +  - reg : the chip select number.
> +
> +Example:
> +
> +codec: wm8770@1 {
> +	compatible = "wlf,wm8770";
> +	reg = <1>;
> +};
> diff --git a/sound/soc/codecs/wm8770.c b/sound/soc/codecs/wm8770.c
> index 19b92ba..aa05e65 100644
> --- a/sound/soc/codecs/wm8770.c
> +++ b/sound/soc/codecs/wm8770.c
> @@ -14,6 +14,7 @@
>  #include <linux/moduleparam.h>
>  #include <linux/init.h>
>  #include <linux/delay.h>
> +#include <linux/of_device.h>
>  #include <linux/pm.h>
>  #include <linux/platform_device.h>
>  #include <linux/spi/spi.h>
> @@ -684,6 +685,12 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8770 = {
>  	.reg_cache_default = wm8770_reg_defs
>  };
>  
> +static const struct of_device_id wm8770_of_match[] = {
> +	{ .compatible = "wlf,wm8770", },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(of, wm8770_of_match);
> +
>  #if defined(CONFIG_SPI_MASTER)
>  static int __devinit wm8770_spi_probe(struct spi_device *spi)
>  {
> @@ -715,6 +722,7 @@ static struct spi_driver wm8770_spi_driver = {
>  	.driver = {
>  		.name = "wm8770",
>  		.owner = THIS_MODULE,
> +		.of_match_table = wm8770_of_match,
>  	},
>  	.probe = wm8770_spi_probe,
>  	.remove = __devexit_p(wm8770_spi_remove)
> -- 
> 1.7.5.4
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] ASoC: Add device tree binding for WM8770
       [not found]   ` <CAOZdJXUQpyvxOVgS9mPnMwJM1TNF-X+zOVkOsDqJM_oBNQih0Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-08-30 18:12     ` Mark Brown
  2011-08-30 18:15       ` Timur Tabi
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2011-08-30 18:12 UTC (permalink / raw)
  To: Tabi Timur-B04825
  Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	patches-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
	Liam Girdwood, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Tue, Aug 30, 2011 at 03:48:44PM +0000, Tabi Timur-B04825 wrote:
> On Mon, Aug 29, 2011 at 8:27 AM, Mark Brown

> > Signed-off-by: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>

> >  Documentation/devicetree/bindings/sound/wm8770.txt |   16 ++++++++++++++++

> I don't think we should have a separate text file for each codec.
> We'll soon have dozens of files that are almost identical.  Can't we
> have one text file that describes most of the codec nodes, and only
> add new text files for exceptions?

I did say this before; personally I find having binding documentation at
all for the basic I2C/SPI bus binding of a device to be a complete waste
of time and would rather just not bother unless we have properties.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] ASoC: Add device tree binding for WM8770
  2011-08-30 18:12     ` Mark Brown
@ 2011-08-30 18:15       ` Timur Tabi
       [not found]         ` <4E5D28AB.7040206-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Timur Tabi @ 2011-08-30 18:15 UTC (permalink / raw)
  To: Mark Brown
  Cc: Grant Likely, alsa-devel, patches, Liam Girdwood, devicetree-discuss

Mark Brown wrote:
> I did say this before; personally I find having binding documentation at
> all for the basic I2C/SPI bus binding of a device to be a complete waste
> of time and would rather just not bother unless we have properties.

I'm okay with that, but it's not my decision. :-)

The codec node bindings that my audio driver expects are documented in ssi.txt.
 Note that I require a clock-frequency property to indicate the input clock
frequency on the codec itself.

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] ASoC: Add device tree binding for WM8770
       [not found]         ` <4E5D28AB.7040206-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
@ 2011-08-30 18:18           ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2011-08-30 18:18 UTC (permalink / raw)
  To: Timur Tabi
  Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	patches-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
	Liam Girdwood, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Tue, Aug 30, 2011 at 01:15:07PM -0500, Timur Tabi wrote:

>  Note that I require a clock-frequency property to indicate the input clock
> frequency on the codec itself.

It's listed as optional in the binding (and would in general need to
be).

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] ASoC: Add device tree binding for WM8770
  2011-08-29 13:27 [PATCH 1/3] ASoC: Add device tree binding for WM8770 Mark Brown
                   ` (3 preceding siblings ...)
       [not found] ` <1314624471-15381-1-git-send-email-broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
@ 2011-08-31 10:30 ` Liam Girdwood
  4 siblings, 0 replies; 9+ messages in thread
From: Liam Girdwood @ 2011-08-31 10:30 UTC (permalink / raw)
  To: Mark Brown; +Cc: Grant Likely, alsa-devel, patches, devicetree-discuss

On 29/08/11 14:27, Mark Brown wrote:
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>  Documentation/devicetree/bindings/sound/wm8770.txt |   16 ++++++++++++++++
>  sound/soc/codecs/wm8770.c                          |    8 ++++++++
>  2 files changed, 24 insertions(+), 0 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/sound/wm8770.txt
> 

These all look fine to me wrt ASoC. All

Acked-by: Liam Girdwood <lrg@ti.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-08-31 10:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-29 13:27 [PATCH 1/3] ASoC: Add device tree binding for WM8770 Mark Brown
2011-08-29 13:27 ` [PATCH 2/3] ASoC: Add device tree binding for WM8776 Mark Brown
2011-08-29 13:27 ` [PATCH 3/3] ASoC: Add device tree binding for WM8804 Mark Brown
2011-08-30 15:48 ` [PATCH 1/3] ASoC: Add device tree binding for WM8770 Tabi Timur-B04825
     [not found]   ` <CAOZdJXUQpyvxOVgS9mPnMwJM1TNF-X+zOVkOsDqJM_oBNQih0Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-08-30 18:12     ` Mark Brown
2011-08-30 18:15       ` Timur Tabi
     [not found]         ` <4E5D28AB.7040206-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2011-08-30 18:18           ` Mark Brown
     [not found] ` <1314624471-15381-1-git-send-email-broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-08-30 16:13   ` Grant Likely
2011-08-31 10:30 ` Liam Girdwood

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.