2022-06-20 02:38:28

by Shengjiu Wang

[permalink] [raw]
Subject: [PATCH v2 0/3] add bt-sco sound card support for i.MX8MQ/MM/MN

add bt-sco sound card support for i.MX8MQ/MM/MN

changes in v2
- update note name of bt-sco codec

Shengjiu Wang (3):
arm64: dts: imx8mm-evk: add bt-sco sound card support
arm64: dts: imx8mq-evk: add bt-sco sound card support
arm64: dts: imx8mn-evk: add bt-sco sound card support

arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi | 43 +++++++++++++++++++
arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi | 43 +++++++++++++++++++
arch/arm64/boot/dts/freescale/imx8mq-evk.dts | 43 +++++++++++++++++++
3 files changed, 129 insertions(+)

--
2.17.1


2022-06-20 02:38:41

by Shengjiu Wang

[permalink] [raw]
Subject: [PATCH v2 1/3] arm64: dts: imx8mm-evk: add bt-sco sound card support

Add bt-sco sound card, which supports wb profile as default

Signed-off-by: Shengjiu Wang <[email protected]>
---
arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi | 43 +++++++++++++++++++
1 file changed, 43 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
index c42b966f7a64..cf734d2a94be 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
@@ -75,6 +75,11 @@
linux,autosuspend-period = <125>;
};

+ audio_codec_bt_sco: audio-codec-bt-sco {
+ #sound-dai-cells = <1>;
+ compatible = "linux,bt-sco";
+ };
+
wm8524: audio-codec {
#sound-dai-cells = <0>;
compatible = "wlf,wm8524";
@@ -107,6 +112,25 @@
clocks = <&clk IMX8MM_CLK_SAI3_ROOT>;
};
};
+
+ sound-bt-sco {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "bt-sco-audio";
+ simple-audio-card,format = "dsp_a";
+ simple-audio-card,bitclock-inversion;
+ simple-audio-card,frame-master = <&btcpu>;
+ simple-audio-card,bitclock-master = <&btcpu>;
+
+ btcpu: simple-audio-card,cpu {
+ sound-dai = <&sai2>;
+ dai-tdm-slot-num = <2>;
+ dai-tdm-slot-width = <16>;
+ };
+
+ simple-audio-card,codec {
+ sound-dai = <&audio_codec_bt_sco 1>;
+ };
+ };
};

&A53_0 {
@@ -346,6 +370,16 @@
status = "okay";
};

+&sai2 {
+ #sound-dai-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_sai2>;
+ assigned-clocks = <&clk IMX8MM_CLK_SAI2>;
+ assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
+ assigned-clock-rates = <24576000>;
+ status = "okay";
+};
+
&sai3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
@@ -494,6 +528,15 @@
>;
};

+ pinctrl_sai2: sai2grp {
+ fsl,pins = <
+ MX8MM_IOMUXC_SAI2_TXC_SAI2_TX_BCLK 0xd6
+ MX8MM_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC 0xd6
+ MX8MM_IOMUXC_SAI2_TXD0_SAI2_TX_DATA0 0xd6
+ MX8MM_IOMUXC_SAI2_RXD0_SAI2_RX_DATA0 0xd6
+ >;
+ };
+
pinctrl_sai3: sai3grp {
fsl,pins = <
MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC 0xd6
--
2.17.1

2022-06-20 02:44:36

by Shengjiu Wang

[permalink] [raw]
Subject: [PATCH v2 3/3] arm64: dts: imx8mn-evk: add bt-sco sound card support

Add bt-sco sound card, which supports wb profile as default

Signed-off-by: Shengjiu Wang <[email protected]>
---
arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi | 43 +++++++++++++++++++
1 file changed, 43 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
index d1f6cccfa00d..23a46dfb99c7 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
@@ -47,6 +47,11 @@
linux,autosuspend-period = <125>;
};

+ audio_codec_bt_sco: audio-codec-bt-sco {
+ #sound-dai-cells = <1>;
+ compatible = "linux,bt-sco";
+ };
+
wm8524: audio-codec {
#sound-dai-cells = <0>;
compatible = "wlf,wm8524";
@@ -57,6 +62,25 @@
clock-names = "mclk";
};

+ sound-bt-sco {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "bt-sco-audio";
+ simple-audio-card,format = "dsp_a";
+ simple-audio-card,bitclock-inversion;
+ simple-audio-card,frame-master = <&btcpu>;
+ simple-audio-card,bitclock-master = <&btcpu>;
+
+ btcpu: simple-audio-card,cpu {
+ sound-dai = <&sai2>;
+ dai-tdm-slot-num = <2>;
+ dai-tdm-slot-width = <16>;
+ };
+
+ simple-audio-card,codec {
+ sound-dai = <&audio_codec_bt_sco 1>;
+ };
+ };
+
sound-wm8524 {
compatible = "fsl,imx-audio-wm8524";
model = "wm8524-audio";
@@ -183,6 +207,16 @@
};
};

+&sai2 {
+ #sound-dai-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_sai2>;
+ assigned-clocks = <&clk IMX8MN_CLK_SAI2>;
+ assigned-clock-parents = <&clk IMX8MN_AUDIO_PLL1_OUT>;
+ assigned-clock-rates = <24576000>;
+ status = "okay";
+};
+
&sai3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
@@ -354,6 +388,15 @@
>;
};

+ pinctrl_sai2: sai2grp {
+ fsl,pins = <
+ MX8MN_IOMUXC_SAI2_TXC_SAI2_TX_BCLK 0xd6
+ MX8MN_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC 0xd6
+ MX8MN_IOMUXC_SAI2_TXD0_SAI2_TX_DATA0 0xd6
+ MX8MN_IOMUXC_SAI2_RXD0_SAI2_RX_DATA0 0xd6
+ >;
+ };
+
pinctrl_sai3: sai3grp {
fsl,pins = <
MX8MN_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC 0xd6
--
2.17.1

2022-06-20 03:21:33

by Shengjiu Wang

[permalink] [raw]
Subject: [PATCH v2 2/3] arm64: dts: imx8mq-evk: add bt-sco sound card support

Add bt-sco sound card, which supports wb profile as default

Signed-off-by: Shengjiu Wang <[email protected]>
---
arch/arm64/boot/dts/freescale/imx8mq-evk.dts | 43 ++++++++++++++++++++
1 file changed, 43 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
index 99fed35168eb..993cd91e1153 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
@@ -71,12 +71,36 @@
linux,autosuspend-period = <125>;
};

+ audio_codec_bt_sco: audio-codec-bt-sco {
+ #sound-dai-cells = <1>;
+ compatible = "linux,bt-sco";
+ };
+
wm8524: audio-codec {
#sound-dai-cells = <0>;
compatible = "wlf,wm8524";
wlf,mute-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
};

+ sound-bt-sco {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "bt-sco-audio";
+ simple-audio-card,format = "dsp_a";
+ simple-audio-card,bitclock-inversion;
+ simple-audio-card,frame-master = <&btcpu>;
+ simple-audio-card,bitclock-master = <&btcpu>;
+
+ btcpu: simple-audio-card,cpu {
+ sound-dai = <&sai3>;
+ dai-tdm-slot-num = <2>;
+ dai-tdm-slot-width = <16>;
+ };
+
+ simple-audio-card,codec {
+ sound-dai = <&audio_codec_bt_sco 1>;
+ };
+ };
+
sound-wm8524 {
compatible = "simple-audio-card";
simple-audio-card,name = "wm8524-audio";
@@ -386,6 +410,16 @@
status = "okay";
};

+&sai3 {
+ #sound-dai-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_sai3>;
+ assigned-clocks = <&clk IMX8MQ_CLK_SAI3>;
+ assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
+ assigned-clock-rates = <24576000>;
+ status = "okay";
+};
+
&snvs_pwrkey {
status = "okay";
};
@@ -548,6 +582,15 @@
>;
};

+ pinctrl_sai3: sai3grp {
+ fsl,pins = <
+ MX8MQ_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC 0xd6
+ MX8MQ_IOMUXC_SAI3_TXC_SAI3_TX_BCLK 0xd6
+ MX8MQ_IOMUXC_SAI3_TXD_SAI3_TX_DATA0 0xd6
+ MX8MQ_IOMUXC_SAI3_RXD_SAI3_RX_DATA0 0xd6
+ >;
+ };
+
pinctrl_spdif1: spdif1grp {
fsl,pins = <
MX8MQ_IOMUXC_SPDIF_TX_SPDIF1_OUT 0xd6
--
2.17.1

2022-06-20 08:49:31

by Marco Felsch

[permalink] [raw]
Subject: Re: [PATCH v2 1/3] arm64: dts: imx8mm-evk: add bt-sco sound card support

Hi Shengjiu,

On 22-06-20, Shengjiu Wang wrote:
> Add bt-sco sound card, which supports wb profile as default
>
> Signed-off-by: Shengjiu Wang <[email protected]>
> ---
> arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi | 43 +++++++++++++++++++
> 1 file changed, 43 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
> index c42b966f7a64..cf734d2a94be 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
> @@ -75,6 +75,11 @@
> linux,autosuspend-period = <125>;
> };
>
> + audio_codec_bt_sco: audio-codec-bt-sco {
> + #sound-dai-cells = <1>;
> + compatible = "linux,bt-sco";

The compatible property should always be the first property. This
apply to your other patches as well.

Regards,
Marco

> + };
> +
> wm8524: audio-codec {
> #sound-dai-cells = <0>;
> compatible = "wlf,wm8524";
> @@ -107,6 +112,25 @@
> clocks = <&clk IMX8MM_CLK_SAI3_ROOT>;
> };
> };
> +
> + sound-bt-sco {
> + compatible = "simple-audio-card";
> + simple-audio-card,name = "bt-sco-audio";
> + simple-audio-card,format = "dsp_a";
> + simple-audio-card,bitclock-inversion;
> + simple-audio-card,frame-master = <&btcpu>;
> + simple-audio-card,bitclock-master = <&btcpu>;
> +
> + btcpu: simple-audio-card,cpu {
> + sound-dai = <&sai2>;
> + dai-tdm-slot-num = <2>;
> + dai-tdm-slot-width = <16>;
> + };
> +
> + simple-audio-card,codec {
> + sound-dai = <&audio_codec_bt_sco 1>;
> + };
> + };
> };
>
> &A53_0 {
> @@ -346,6 +370,16 @@
> status = "okay";
> };
>
> +&sai2 {
> + #sound-dai-cells = <0>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&pinctrl_sai2>;
> + assigned-clocks = <&clk IMX8MM_CLK_SAI2>;
> + assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
> + assigned-clock-rates = <24576000>;
> + status = "okay";
> +};
> +
> &sai3 {
> pinctrl-names = "default";
> pinctrl-0 = <&pinctrl_sai3>;
> @@ -494,6 +528,15 @@
> >;
> };
>
> + pinctrl_sai2: sai2grp {
> + fsl,pins = <
> + MX8MM_IOMUXC_SAI2_TXC_SAI2_TX_BCLK 0xd6
> + MX8MM_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC 0xd6
> + MX8MM_IOMUXC_SAI2_TXD0_SAI2_TX_DATA0 0xd6
> + MX8MM_IOMUXC_SAI2_RXD0_SAI2_RX_DATA0 0xd6
> + >;
> + };
> +
> pinctrl_sai3: sai3grp {
> fsl,pins = <
> MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC 0xd6
> --
> 2.17.1
>
>
>