Skip to contentSkip to conversation

ASoC: generic: add simple card with devicetree support

PATCH In review Jean-Francois Moine 5 participants 7 messages Jul 20, 2013 – Jul 22, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: generic: add simple card with devicetree support

This generic simple card driver uses DT values to instanciate an audio system in which the real work is done by the subdrivers (audio controller, audio codec and pcm/dma controller).

---
 Documentation/devicetree/bindings/sound/simple-dt-card.txt |  18 ++++
 sound/soc/generic/Kconfig                                 |   7 ++
 sound/soc/generic/Makefile                                |   2 +
 sound/soc/generic/simple-dt-card.c                        | 137 ++++++++++++++++++++++++
 4 files changed, 163 insertions(+)
Documentation/devicetree/bindings/sound/simple-dt-card.txt new file +18 -0
new file mode 100644
index 0000000..45f41cc
@@ -0,0 +1,18 @@
+Device-Tree bindings for simple DT audio card
+
+Required properties:
+  - compatible: should be "linux,simple-dt-audio".
+  - audio-controller: phandle of the audio controller
+  - audio-codec: phandle of the audio codec
+  - platform-pcm-dma: phandle of the PCM/DMA controller
+  - codec-dai-name: name of the codec dai
+
+Example node:
+
+	sound {
+		compatible = "linux,simple-dt-audio";
+		audio-controller = <&i2s1>;
+		audio-codec = <&spdif>;
+		platform-pcm-dma = <&pcm>;
+		codec-dai-name = "dit-hifi";
+	};
sound/soc/generic/Kconfig +7 -0
index 610f612..e593224 100644
@@ -2,3 +2,10 @@ config SND_SIMPLE_CARD
 	tristate "ASoC Simple sound card support"
 	help
 	  This option enables generic simple sound card support
+
+config SND_SIMPLE_DT_CARD
+	tristate "ASoC Simple sound card support (Flattened Device Tree)"
+	depends on OF
+	help
+	  This option enables generic simple sound card support
+	  using flattened device tree.
sound/soc/generic/Makefile +2 -0
index 9c3b246..65ddd3e 100644
@@ -1,3 +1,5 @@
 snd-soc-simple-card-objs	:= simple-card.o
+snd-soc-simple-dt-card-objs	:= simple-dt-card.o
 
 obj-$(CONFIG_SND_SIMPLE_CARD)	+= snd-soc-simple-card.o
+obj-$(CONFIG_SND_SIMPLE_DT_CARD) += snd-soc-simple-dt-card.o
sound/soc/generic/simple-dt-card.c new file +137 -0

137 lines not on this page · raw message

#1 lore raw

Hi,

sound/soc/generic/simple-dt-card.c

Quoted 9 lines · Jean-Francois Moine

This generic simple card driver uses DT values to instanciate an audio system in which the real work is done by the subdrivers (audio controller, audio codec and pcm/dma controller).

---

sound/soc/generic/simple-dt-card.c new file +0 -0
new file mode 100644

There is a simple-card driver in the tree already, and there were several attempts to add DT bindings for it in the past - have you seen that? Search for "ASoC: add simple-card DT support" in the archives ...

Daniel

#2 lore raw
Quoted 3 lines · On Sat, 20 Jul 2013 22:23:36 +0200 Daniel Mack <[email protected]> wrote:

There is a simple-card driver in the tree already, and there were several attempts to add DT bindings for it in the past - have you seen that? Search for "ASoC: add simple-card DT support" in the archives ...

Hi Daniel,

Thanks, that is what I was searching.

I will wait for Kuninori.

Signature · 2 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
#3 lore raw
Quoted 7 lines · Jean-Francois Moine
Quoted 3 lines · On Sat, 20 Jul 2013 22:23:36 +0200 Daniel Mack <[email protected]> wrote:

There is a simple-card driver in the tree already, and there were several attempts to add DT bindings for it in the past - have you seen that? Search for "ASoC: add simple-card DT support" in the archives ...

Quoted 5 lines

Hi Daniel,

Thanks, that is what I was searching.

I will wait for Kuninori.

Well, Kuninori recently stated he's currently too busy to continue. Given his permission, it might be an option to pick up where he left off and finish the open topics. Depends on how urgent your need is I guess.

Thanks,
Daniel

#4 lore raw

Hi

Quoted 9 lines
Quoted 9 lines
Quoted 3 lines · On Sat, 20 Jul 2013 22:23:36 +0200 Daniel Mack <[email protected]> wrote:

There is a simple-card driver in the tree already, and there were several attempts to add DT bindings for it in the past - have you seen that? Search for "ASoC: add simple-card DT support" in the archives ...

Hi Daniel,

Quoted 7 lines
Quoted 3 lines

Thanks, that is what I was searching.

I will wait for Kuninori.

Well, Kuninori recently stated he's currently too busy to continue. Given his permission, it might be an option to pick up where he left off and finish the open topics. Depends on how urgent your need is I guess.

I'm sorry, but I'm busy now. and I'm happy if someone try to support simple-card DT.

In my understanding, latest plan (agreement with ALSA ML ?) of simple-card DT support are...

1) current snd_soc_register_codec() will replaced to use snd_soc_register_component().
2) snd_soc_register_component() will have name <-> id exchange function for DT suport.
3) simple-card supports DT by using above name <-> id exchange

Most biggest and difficult is 1) I think.
It needs more discussion how to do 1) ?

But someone (I forgot who is) is already trying to implement it ? I'm not sure...

Best regards
---
Kuninori Morimoto

#5 lore raw
In reply to Jean-Francois Moine
Quoted 3 lines · Jean-Francois Moine

This generic simple card driver uses DT values to instanciate an audio system in which the real work is done by the subdrivers (audio controller, audio codec and pcm/dma controller).

New DT bindings should be sent to [email protected] for review. Note that's a branch new list (it moved from a different server), so it might be best to wait a few days for people to subscribe before sending mail to it.

maintainer
#6 lore raw
In reply to Jean-Francois Moine
Quoted 5 lines · Jean-Francois Moine
 Documentation/devicetree/bindings/sound/simple-dt-card.txt |  18 ++++
 sound/soc/generic/Kconfig                                 |   7 ++
 sound/soc/generic/Makefile                                |   2 +
 sound/soc/generic/simple-dt-card.c                        | 137 ++++++++++++++++++++++++
 4 files changed, 163 insertions(+)

The obvious question here is why is this a separate driver to the existing simple card driver rather than DT bindings for that? I don't see that mentioned here.