Skip to contentSkip to conversation

ASoC: simple-card: Add multi-CODEC support

PATCH Superseded Jean-Francois Moine 1 participant 3 messages Oct 22, 2014 1 message not in the archive

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover ASoC: simple-card: Add multi-CODEC support

This patch set adds multi-CODEC support to the simple card.

v2: accept list of CODECs in 'sound-dais' (Benoit Cousson)

Jean-Francois Moine (2):
ASoC: core: add multi-codec support in DT
ASoC: simple-card: add multi-CODECs in DT

 .../devicetree/bindings/sound/simple-card.txt      |  28 +++--
 include/sound/soc.h                                |   3 +
 sound/soc/generic/simple-card.c                    | 114 +++++++++++++--------
 sound/soc/soc-core.c                               |  75 +++++++++++---
 4 files changed, 149 insertions(+), 71 deletions(-)
Signature · 6 lines
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

PATCH v2 1/2 ASoC: core: add multi-codec support in DT

SoC audio cards may have many CODECs per audio link. This patch exports a core function to handle such links when they are described in the DT.

---
 include/sound/soc.h  |  3 +++
 sound/soc/soc-core.c | 75 +++++++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 63 insertions(+), 15 deletions(-)
include/sound/soc.h +3 -0
index 7ba7130..a255f8b 100644
@@ -1451,6 +1451,9 @@ unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
 				     struct device_node **framemaster);
 int snd_soc_of_get_dai_name(struct device_node *of_node,
 			    const char **dai_name);
+int snd_soc_of_get_dai_link_codecs(struct device_node *of_node,
+				   const char *list_name,
+				   struct snd_soc_dai_link *dai_link);
 
 #include <sound/soc-dai.h>
 
sound/soc/soc-core.c +60 -15

108 lines not on this page · raw message

Signature · 6 lines
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

PATCH v2 2/2 ASoC: simple-card: add multi-CODECs in DT

In reply to a message not in the archive

This patch allows many CODECs per link to be defined in the device tree.

---
 .../devicetree/bindings/sound/simple-card.txt      |  28 +++--
 sound/soc/generic/simple-card.c                    | 114 +++++++++++++--------
 2 files changed, 86 insertions(+), 56 deletions(-)
Documentation/devicetree/bindings/sound/simple-card.txt +12 -16
index c3cba60..6cb1816 100644
@@ -65,7 +65,11 @@ properties should also be placed in the codec node if needed.
 
 Required CPU/CODEC subnodes properties:
 
-- sound-dai				: phandle and port of CPU/CODEC
+either
+  - sound-dai				: phandle and port of CPU/CODEC
+or
+  - sound-dais				: list of phandle and port of CODECs
+					  
 
 Optional CPU/CODEC subnodes properties:
 
@@ -119,37 +123,29 @@ sh_fsi2: sh_fsi2@ec230000 {
 	interrupts = <0 146 0x4>;
 };
 
-Example 2 - many DAI links:
+Example 2 - many DAI links and multi-CODECs:
 
 sound {
 	compatible = "simple-audio-card";
 	simple-audio-card,name = "Cubox Audio";
 
-	simple-audio-card,dai-link@0 {		/* I2S - HDMI */
+	simple-audio-card,dai-link@0 {		/* S/PDIF - HDMI & S/PDIF */
 		format = "i2s";
 		cpu {
-			sound-dai = <&audio1 0>;
-		};
-		codec {
-			sound-dai = <&tda998x 0>;
-		};
-	};
-
-	simple-audio-card,dai-link@1 {		/* S/PDIF - HDMI */
-		cpu {
 			sound-dai = <&audio1 1>;
 		};
 		codec {
-			sound-dai = <&tda998x 1>;
+			sound-dais = <&hdmi 0>, <&spdif_codec>;
 		};
 	};
 
-	simple-audio-card,dai-link@2 {		/* S/PDIF - S/PDIF */
+	simple-audio-card,dai-link@1 {		/* I2S - HDMI */
+		format = "i2s";
 		cpu {
-			sound-dai = <&audio1 1>;
+			sound-dai = <&audio1 0>;
 		};
 		codec {
-			sound-dai = <&spdif_codec>;
+			sound-dai = <&hdmi 1>;
 		};
 	};
 };
sound/soc/generic/simple-card.c +70 -36

182 lines not on this page · raw message

Signature · 6 lines
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html