devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: sgtl5000: add device tree probe support
@ 2011-07-21 16:28 Shawn Guo
       [not found] ` <1311265731-23318-1-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
  2011-07-29 16:37 ` Mark Brown
  0 siblings, 2 replies; 6+ messages in thread
From: Shawn Guo @ 2011-07-21 16:28 UTC (permalink / raw)
  To: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw
  Cc: patches-QSEj5FYQhm4dnm+yROfE0A,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Mark Brown,
	Zeng Zhaoming, Liam Girdwood

It adds device tree probe support for sgtl5000 driver.

Signed-off-by: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: Zeng Zhaoming <zhaoming.zeng-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: Liam Girdwood <lrg-l0cyMroinI0@public.gmane.org>
Cc: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
---
 .../bindings/sound/soc/codecs/fsl-sgtl5000.txt     |   11 +++++++++++
 sound/soc/codecs/sgtl5000.c                        |    8 ++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/soc/codecs/fsl-sgtl5000.txt

diff --git a/Documentation/devicetree/bindings/sound/soc/codecs/fsl-sgtl5000.txt b/Documentation/devicetree/bindings/sound/soc/codecs/fsl-sgtl5000.txt
new file mode 100644
index 0000000..2c3cd41
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/soc/codecs/fsl-sgtl5000.txt
@@ -0,0 +1,11 @@
+* Freescale SGTL5000 Stereo Codec
+
+Required properties:
+- compatible : "fsl,sgtl5000".
+
+Example:
+
+codec: sgtl5000@0a {
+	compatible = "fsl,sgtl5000";
+	reg = <0x0a>;
+};
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index 76258f2..cf6eea8 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -20,6 +20,7 @@
 #include <linux/regulator/driver.h>
 #include <linux/regulator/machine.h>
 #include <linux/regulator/consumer.h>
+#include <linux/of_device.h>
 #include <sound/core.h>
 #include <sound/tlv.h>
 #include <sound/pcm.h>
@@ -1494,10 +1495,17 @@ static const struct i2c_device_id sgtl5000_id[] = {
 
 MODULE_DEVICE_TABLE(i2c, sgtl5000_id);
 
+static const struct of_device_id sgtl5000_dt_ids[] = {
+	{ .compatible = "fsl,sgtl5000", },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(i2c, sgtl5000_dt_ids);
+
 static struct i2c_driver sgtl5000_i2c_driver = {
 	.driver = {
 		   .name = "sgtl5000",
 		   .owner = THIS_MODULE,
+		   .of_match_table = sgtl5000_dt_ids,
 		   },
 	.probe = sgtl5000_i2c_probe,
 	.remove = __devexit_p(sgtl5000_i2c_remove),
-- 
1.7.4.1

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

* Re: [PATCH] ASoC: sgtl5000: add device tree probe support
       [not found] ` <1311265731-23318-1-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
@ 2011-07-26 19:55   ` Mark Brown
  2011-07-29  2:40     ` Shawn Guo
  2011-07-29 16:00     ` Grant Likely
  0 siblings, 2 replies; 6+ messages in thread
From: Mark Brown @ 2011-07-26 19:55 UTC (permalink / raw)
  To: Shawn Guo
  Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, patches-QSEj5FYQhm4dnm+yROfE0A,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Zeng Zhaoming,
	Liam Girdwood

On Fri, Jul 22, 2011 at 12:28:51AM +0800, Shawn Guo wrote:

> It adds device tree probe support for sgtl5000 driver.

Kind of waiting for the device tree people to comment on this...

>  .../bindings/sound/soc/codecs/fsl-sgtl5000.txt     |   11 +++++++++++

I'd expect this can just be put directly under the sound directory.

> +++ b/Documentation/devicetree/bindings/sound/soc/codecs/fsl-sgtl5000.txt
> @@ -0,0 +1,11 @@
> +* Freescale SGTL5000 Stereo Codec
> +
> +Required properties:
> +- compatible : "fsl,sgtl5000".
> +
> +Example:
> +
> +codec: sgtl5000@0a {
> +	compatible = "fsl,sgtl5000";
> +	reg = <0x0a>;
> +};

This might get a tiny bit verbose...  I wonder if it makes sense to have
some central file for devices with trivial bindings?  But possibly more
trouble than it's worth.

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

* Re: [PATCH] ASoC: sgtl5000: add device tree probe support
  2011-07-26 19:55   ` Mark Brown
@ 2011-07-29  2:40     ` Shawn Guo
  2011-07-29 16:00       ` Grant Likely
  2011-07-29 16:00     ` Grant Likely
  1 sibling, 1 reply; 6+ messages in thread
From: Shawn Guo @ 2011-07-29  2:40 UTC (permalink / raw)
  To: Grant Likely
  Cc: alsa-devel, patches, devicetree-discuss, Mark Brown,
	Zeng Zhaoming, Shawn Guo, Liam Girdwood

On Tue, Jul 26, 2011 at 08:55:11PM +0100, Mark Brown wrote:
> On Fri, Jul 22, 2011 at 12:28:51AM +0800, Shawn Guo wrote:
> 
> > It adds device tree probe support for sgtl5000 driver.
> 
> Kind of waiting for the device tree people to comment on this...
> 

Grant, please?

Regards,
Shawn

> >  .../bindings/sound/soc/codecs/fsl-sgtl5000.txt     |   11 +++++++++++
> 
> I'd expect this can just be put directly under the sound directory.
> 
> > +++ b/Documentation/devicetree/bindings/sound/soc/codecs/fsl-sgtl5000.txt
> > @@ -0,0 +1,11 @@
> > +* Freescale SGTL5000 Stereo Codec
> > +
> > +Required properties:
> > +- compatible : "fsl,sgtl5000".
> > +
> > +Example:
> > +
> > +codec: sgtl5000@0a {
> > +	compatible = "fsl,sgtl5000";
> > +	reg = <0x0a>;
> > +};
> 
> This might get a tiny bit verbose...  I wonder if it makes sense to have
> some central file for devices with trivial bindings?  But possibly more
> trouble than it's worth.
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
> 

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

* Re: [PATCH] ASoC: sgtl5000: add device tree probe support
  2011-07-26 19:55   ` Mark Brown
  2011-07-29  2:40     ` Shawn Guo
@ 2011-07-29 16:00     ` Grant Likely
  1 sibling, 0 replies; 6+ messages in thread
From: Grant Likely @ 2011-07-29 16:00 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, patches, devicetree-discuss, Zeng Zhaoming, Shawn Guo,
	Liam Girdwood

On Tue, Jul 26, 2011 at 08:55:11PM +0100, Mark Brown wrote:
> On Fri, Jul 22, 2011 at 12:28:51AM +0800, Shawn Guo wrote:
> 
> > It adds device tree probe support for sgtl5000 driver.
> 
> Kind of waiting for the device tree people to comment on this...
> 
> >  .../bindings/sound/soc/codecs/fsl-sgtl5000.txt     |   11 +++++++++++
> 
> I'd expect this can just be put directly under the sound directory.
> 
> > +++ b/Documentation/devicetree/bindings/sound/soc/codecs/fsl-sgtl5000.txt
> > @@ -0,0 +1,11 @@
> > +* Freescale SGTL5000 Stereo Codec
> > +
> > +Required properties:
> > +- compatible : "fsl,sgtl5000".
> > +
> > +Example:
> > +
> > +codec: sgtl5000@0a {
> > +	compatible = "fsl,sgtl5000";
> > +	reg = <0x0a>;
> > +};
> 
> This might get a tiny bit verbose...  I wonder if it makes sense to have
> some central file for devices with trivial bindings?  But possibly more
> trouble than it's worth.

Yes, I think it would be valuable.  I've been thinking a lot about how
to make binding documentation less verbose and have much better cross
referencing so that binding documentation doesn't need to include all
kinds of common property definitions. I've had no time to work on
it though... I need an intern student.  :-)

g.

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

* Re: [PATCH] ASoC: sgtl5000: add device tree probe support
  2011-07-29  2:40     ` Shawn Guo
@ 2011-07-29 16:00       ` Grant Likely
  0 siblings, 0 replies; 6+ messages in thread
From: Grant Likely @ 2011-07-29 16:00 UTC (permalink / raw)
  To: Shawn Guo
  Cc: alsa-devel, patches, devicetree-discuss, Mark Brown,
	Zeng Zhaoming, Shawn Guo, Liam Girdwood

On Fri, Jul 29, 2011 at 10:40:51AM +0800, Shawn Guo wrote:
> On Tue, Jul 26, 2011 at 08:55:11PM +0100, Mark Brown wrote:
> > On Fri, Jul 22, 2011 at 12:28:51AM +0800, Shawn Guo wrote:
> > 
> > > It adds device tree probe support for sgtl5000 driver.
> > 
> > Kind of waiting for the device tree people to comment on this...
> > 
> 
> Grant, please?

Acked-by: Grant Likely <grant.likely@secretlab.ca>
> 
> Regards,
> Shawn
> 
> > >  .../bindings/sound/soc/codecs/fsl-sgtl5000.txt     |   11 +++++++++++
> > 
> > I'd expect this can just be put directly under the sound directory.
> > 
> > > +++ b/Documentation/devicetree/bindings/sound/soc/codecs/fsl-sgtl5000.txt
> > > @@ -0,0 +1,11 @@
> > > +* Freescale SGTL5000 Stereo Codec
> > > +
> > > +Required properties:
> > > +- compatible : "fsl,sgtl5000".
> > > +
> > > +Example:
> > > +
> > > +codec: sgtl5000@0a {
> > > +	compatible = "fsl,sgtl5000";
> > > +	reg = <0x0a>;
> > > +};
> > 
> > This might get a tiny bit verbose...  I wonder if it makes sense to have
> > some central file for devices with trivial bindings?  But possibly more
> > trouble than it's worth.
> > _______________________________________________
> > devicetree-discuss mailing list
> > devicetree-discuss@lists.ozlabs.org
> > https://lists.ozlabs.org/listinfo/devicetree-discuss
> > 
> 

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

* Re: [PATCH] ASoC: sgtl5000: add device tree probe support
  2011-07-21 16:28 [PATCH] ASoC: sgtl5000: add device tree probe support Shawn Guo
       [not found] ` <1311265731-23318-1-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
@ 2011-07-29 16:37 ` Mark Brown
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Brown @ 2011-07-29 16:37 UTC (permalink / raw)
  To: Shawn Guo
  Cc: alsa-devel, patches, devicetree-discuss, Grant Likely,
	Zeng Zhaoming, Liam Girdwood

On Fri, Jul 22, 2011 at 12:28:51AM +0800, Shawn Guo wrote:
> It adds device tree probe support for sgtl5000 driver.

Applied, thanks.

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

end of thread, other threads:[~2011-07-29 16:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-21 16:28 [PATCH] ASoC: sgtl5000: add device tree probe support Shawn Guo
     [not found] ` <1311265731-23318-1-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-07-26 19:55   ` Mark Brown
2011-07-29  2:40     ` Shawn Guo
2011-07-29 16:00       ` Grant Likely
2011-07-29 16:00     ` Grant Likely
2011-07-29 16:37 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).