2024-05-09 05:36:52

by Shengjiu Wang

[permalink] [raw]
Subject: [PATCH 0/2] arm64: dts: imx8mp-evk: support bt-sco sound card

support bt-sco sound card

Shengjiu Wang (2):
arm64: dts: imx8mp: Initialize audio PLLs from audiomix subsystem
arm64: dts: imx8mp-evk: add bt-sco sound card support

arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 44 ++++++++++++++++++++
arch/arm64/boot/dts/freescale/imx8mp.dtsi | 3 ++
2 files changed, 47 insertions(+)

--
2.34.1



2024-05-09 05:37:09

by Shengjiu Wang

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

Add bt-sco sound card, which is used by BT HFP case.
It supports wb profile as default

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

diff --git a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
index 8be5b2a57f27..b2225cb710b6 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
@@ -114,6 +114,11 @@ reg_vext_3v3: regulator-vext-3v3 {
regulator-max-microvolt = <3300000>;
};

+ audio_codec_bt_sco: audio-codec-bt-sco {
+ compatible = "linux,bt-sco";
+ #sound-dai-cells = <1>;
+ };
+
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "wm8960-audio";
@@ -145,6 +150,25 @@ simple-audio-card,codec {

};

+ 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-hdmi {
compatible = "fsl,imx-audio-hdmi";
model = "audio-hdmi";
@@ -608,6 +632,17 @@ &pwm4 {
status = "okay";
};

+&sai2 {
+ #sound-dai-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_sai2>;
+ assigned-clocks = <&clk IMX8MP_CLK_SAI2>;
+ assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
+ assigned-clock-rates = <12288000>;
+ fsl,sai-mclk-direction-output;
+ status = "okay";
+};
+
&sai3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
@@ -880,6 +915,15 @@ MX8MP_IOMUXC_UART3_TXD__UART1_DCE_RTS 0x140
>;
};

+ pinctrl_sai2: sai2grp {
+ fsl,pins = <
+ MX8MP_IOMUXC_SAI2_TXC__AUDIOMIX_SAI2_TX_BCLK 0xd6
+ MX8MP_IOMUXC_SAI2_TXFS__AUDIOMIX_SAI2_TX_SYNC 0xd6
+ MX8MP_IOMUXC_SAI2_TXD0__AUDIOMIX_SAI2_TX_DATA00 0xd6
+ MX8MP_IOMUXC_SAI2_RXD0__AUDIOMIX_SAI2_RX_DATA00 0xd6
+ >;
+ };
+
pinctrl_sai3: sai3grp {
fsl,pins = <
MX8MP_IOMUXC_SAI3_TXFS__AUDIOMIX_SAI3_TX_SYNC 0xd6
--
2.34.1


2024-05-09 05:37:12

by Shengjiu Wang

[permalink] [raw]
Subject: [PATCH 1/2] arm64: dts: imx8mp: Initialize audio PLLs from audiomix subsystem

Initialize audio PLL1 as the parent clock for 8kHz series rates,
audio PLL2 as the parent clock for 11kHz series rates. that PLL1
and PLL2 can together support full range of audio sample rates.

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

diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index b92abb5a5c53..459c4a54d30e 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -1579,6 +1579,9 @@ audio_blk_ctrl: clock-controller@30e20000 {
"sai1", "sai2", "sai3",
"sai5", "sai6", "sai7";
power-domains = <&pgc_audio>;
+ assigned-clocks = <&clk IMX8MP_AUDIO_PLL1>,
+ <&clk IMX8MP_AUDIO_PLL2>;
+ assigned-clock-rates = <393216000>, <361267200>;
};
};

--
2.34.1


2024-05-09 14:16:48

by Daniel Baluta

[permalink] [raw]
Subject: Re: [PATCH 2/2] arm64: dts: imx8mp-evk: add bt-sco sound card support

On Thu, May 9, 2024 at 8:37 AM Shengjiu Wang <[email protected]> wrote:
>
> Add bt-sco sound card, which is used by BT HFP case.
> It supports wb profile as default
>
> Signed-off-by: Shengjiu Wang <[email protected]>

Reviewed-by: Daniel Baluta <[email protected]>


> ---
> arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 44 ++++++++++++++++++++
> 1 file changed, 44 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
> index 8be5b2a57f27..b2225cb710b6 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
> @@ -114,6 +114,11 @@ reg_vext_3v3: regulator-vext-3v3 {
> regulator-max-microvolt = <3300000>;
> };
>
> + audio_codec_bt_sco: audio-codec-bt-sco {
> + compatible = "linux,bt-sco";
> + #sound-dai-cells = <1>;
> + };
> +
> sound {
> compatible = "simple-audio-card";
> simple-audio-card,name = "wm8960-audio";
> @@ -145,6 +150,25 @@ simple-audio-card,codec {
>
> };
>
> + 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-hdmi {
> compatible = "fsl,imx-audio-hdmi";
> model = "audio-hdmi";
> @@ -608,6 +632,17 @@ &pwm4 {
> status = "okay";
> };
>
> +&sai2 {
> + #sound-dai-cells = <0>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&pinctrl_sai2>;
> + assigned-clocks = <&clk IMX8MP_CLK_SAI2>;
> + assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
> + assigned-clock-rates = <12288000>;
> + fsl,sai-mclk-direction-output;
> + status = "okay";
> +};
> +
> &sai3 {
> pinctrl-names = "default";
> pinctrl-0 = <&pinctrl_sai3>;
> @@ -880,6 +915,15 @@ MX8MP_IOMUXC_UART3_TXD__UART1_DCE_RTS 0x140
> >;
> };
>
> + pinctrl_sai2: sai2grp {
> + fsl,pins = <
> + MX8MP_IOMUXC_SAI2_TXC__AUDIOMIX_SAI2_TX_BCLK 0xd6
> + MX8MP_IOMUXC_SAI2_TXFS__AUDIOMIX_SAI2_TX_SYNC 0xd6
> + MX8MP_IOMUXC_SAI2_TXD0__AUDIOMIX_SAI2_TX_DATA00 0xd6
> + MX8MP_IOMUXC_SAI2_RXD0__AUDIOMIX_SAI2_RX_DATA00 0xd6
> + >;
> + };
> +
> pinctrl_sai3: sai3grp {
> fsl,pins = <
> MX8MP_IOMUXC_SAI3_TXFS__AUDIOMIX_SAI3_TX_SYNC 0xd6
> --
> 2.34.1
>
>

2024-05-09 14:17:28

by Daniel Baluta

[permalink] [raw]
Subject: Re: [PATCH 1/2] arm64: dts: imx8mp: Initialize audio PLLs from audiomix subsystem

On Thu, May 9, 2024 at 8:36 AM Shengjiu Wang <[email protected]> wrote:
>
> Initialize audio PLL1 as the parent clock for 8kHz series rates,
> audio PLL2 as the parent clock for 11kHz series rates. that PLL1
> and PLL2 can together support full range of audio sample rates.
>
> Signed-off-by: Shengjiu Wang <[email protected]>

Reviewed-by: Daniel Baluta <[email protected]>

2024-06-15 07:38:58

by Shawn Guo

[permalink] [raw]
Subject: Re: [PATCH 0/2] arm64: dts: imx8mp-evk: support bt-sco sound card

On Thu, May 09, 2024 at 01:14:56PM +0800, Shengjiu Wang wrote:
> support bt-sco sound card
>
> Shengjiu Wang (2):
> arm64: dts: imx8mp: Initialize audio PLLs from audiomix subsystem
> arm64: dts: imx8mp-evk: add bt-sco sound card support

Applied both, thanks!