[1/2] dt-bindings: sound: fsl-asoc-card: add new compatible for I2S slave
diff mbox series

Message ID 20200702141114.232688-2-arnaud.ferraris@collabora.com
State New
Headers show
Series
  • ASoC: fsl-asoc-card: add support for generic codecs
Related show

Commit Message

Arnaud Ferraris July 2, 2020, 2:11 p.m. UTC
fsl-asoc-card currently doesn't support generic codecs with the SoC
acting as I2S slave.

This commit adds a new `fsl,imx-audio-i2s-slave` for this use-case, as
well as the following mandatory properties:
- `audio-codec-dai-name` for specifying the codec DAI to be used
- `audio-slot-width`

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
---
 .../bindings/sound/fsl-asoc-card.txt          | 23 ++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

Comments

Mark Brown July 2, 2020, 2:31 p.m. UTC | #1
On Thu, Jul 02, 2020 at 04:11:14PM +0200, Arnaud Ferraris wrote:
> fsl-asoc-card currently doesn't support generic codecs with the SoC
> acting as I2S slave.
> 
> This commit adds a new `fsl,imx-audio-i2s-slave` for this use-case, as
> well as the following mandatory properties:

Why require that the CODEC be clock master here - why not make this
configurable, reusing the properties from the generic and audio graph
cards?
Arnaud Ferraris July 2, 2020, 3:28 p.m. UTC | #2
Hi Mark,

Le 02/07/2020 à 16:31, Mark Brown a écrit :
> On Thu, Jul 02, 2020 at 04:11:14PM +0200, Arnaud Ferraris wrote:
>> fsl-asoc-card currently doesn't support generic codecs with the SoC
>> acting as I2S slave.
>>
>> This commit adds a new `fsl,imx-audio-i2s-slave` for this use-case, as
>> well as the following mandatory properties:
> 
> Why require that the CODEC be clock master here - why not make this
> configurable, reusing the properties from the generic and audio graph
> cards?

This is partly because I'm not sure how to do it (yet), but mostly
because I don't have the hardware to test this (the 2 CODECs present on
my only i.MX6 board are both clock master)

Regards,
Arnaud
Mark Brown July 2, 2020, 3:42 p.m. UTC | #3
On Thu, Jul 02, 2020 at 05:28:03PM +0200, Arnaud Ferraris wrote:
> Le 02/07/2020 à 16:31, Mark Brown a écrit :

> > Why require that the CODEC be clock master here - why not make this
> > configurable, reusing the properties from the generic and audio graph
> > cards?

> This is partly because I'm not sure how to do it (yet), but mostly
> because I don't have the hardware to test this (the 2 CODECs present on
> my only i.MX6 board are both clock master)

Take a look at what the generic cards are doing, it's a library function 
asoc_simple_parse_daifmt().  It's not the end of the world if you can't
test it properly - if it turns out it's buggy somehow someone can always
fix the code later but an ABI is an ABI so we can't change it.
Arnaud Ferraris July 3, 2020, 9:23 a.m. UTC | #4
Le 02/07/2020 à 17:42, Mark Brown a écrit :
> On Thu, Jul 02, 2020 at 05:28:03PM +0200, Arnaud Ferraris wrote:
>> Le 02/07/2020 à 16:31, Mark Brown a écrit :
> 
>>> Why require that the CODEC be clock master here - why not make this
>>> configurable, reusing the properties from the generic and audio graph
>>> cards?
> 
>> This is partly because I'm not sure how to do it (yet), but mostly
>> because I don't have the hardware to test this (the 2 CODECs present on
>> my only i.MX6 board are both clock master)
> 
> Take a look at what the generic cards are doing, it's a library function 
> asoc_simple_parse_daifmt().  It's not the end of the world if you can't
> test it properly - if it turns out it's buggy somehow someone can always
> fix the code later but an ABI is an ABI so we can't change it.
> 

Thanks for the hints, I'll look into it.

Regards,
Arnaud

Patch
diff mbox series

diff --git a/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt b/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt
index 133d7e14a4d0..694a138df462 100644
--- a/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt
+++ b/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt
@@ -22,6 +22,8 @@  Note: The card is initially designed for those sound cards who use AC'97, I2S
 The compatible list for this generic sound card currently:
  "fsl,imx-audio-ac97"
 
+ "fsl,imx-audio-i2s-slave"
+
  "fsl,imx-audio-cs42888"
 
  "fsl,imx-audio-cs427x"
@@ -75,7 +77,13 @@  Optional unless SSI is selected as a CPU DAI:
 
   - mux-ext-port	: The external port of the i.MX audio muxer
 
-Example:
+Optional unless compatible is "fsl,imx-audio-i2s-slave":
+
+  - audio-codec-dai-name: The name of the DAI provided by the codec
+
+  - audio-slot-width	: The audio sample format
+
+Examples:
 sound-cs42888 {
 	compatible = "fsl,imx-audio-cs42888";
 	model = "cs42888-audio";
@@ -96,3 +104,16 @@  sound-cs42888 {
 		"AIN2L", "Line In Jack",
 		"AIN2R", "Line In Jack";
 };
+
+sound-bluetooth {
+	compatible = "fsl,imx-audio-i2s-slave";
+	audio-cpu = <&ssi1>;
+	audio-codec = <&codec_bluetooth>;
+	audio-codec-dai-name = "bt-sco-pcm-wb";
+	audio-slot-width = <16>;
+	audio-routing =
+		"RX", "Mic Jack",
+		"Headphone Jack", "TX";
+	mux-int-port = <1>;
+	mux-ext-port = <4>;
+};