2020-07-02 14:12:57

by Arnaud Ferraris

[permalink] [raw]
Subject: [PATCH 1/2] dt-bindings: sound: fsl-asoc-card: add new compatible for I2S slave

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 <[email protected]>
---
.../bindings/sound/fsl-asoc-card.txt | 23 ++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)

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>;
+};
--
2.27.0


2020-07-02 14:32:45

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: sound: fsl-asoc-card: add new compatible for I2S slave

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?


Attachments:
(No filename) (436.00 B)
signature.asc (499.00 B)
Download all attachments

2020-07-02 15:29:26

by Arnaud Ferraris

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: sound: fsl-asoc-card: add new compatible for I2S slave

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

2020-07-02 15:42:48

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: sound: fsl-asoc-card: add new compatible for I2S slave

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.


Attachments:
(No filename) (756.00 B)
signature.asc (499.00 B)
Download all attachments

2020-07-03 09:24:30

by Arnaud Ferraris

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: sound: fsl-asoc-card: add new compatible for I2S slave



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