From de56f133e26987a830ab182cd18ab7acd027f844 Mon Sep 17 00:00:00 2001 From: Xing Wang Date: Fri, 1 Mar 2019 16:29:31 +0800 Subject: [PATCH] audio: auge: fix spdifout clk for share buffer [1/1] PD#SWPL-4278 Problem: spdif out clk is related to tdm clk for share buffer. For play raw data 32k/44.1k, it's not correct for spdif out clk. Solution: separate spdif out clk and tdm clk Verify: x301 Change-Id: Ie6e3d7413d9577c9c80ea90e8b1f9ff4bf3eefcf Signed-off-by: Xing Wang --- arch/arm/boot/dts/amlogic/g12a_s905d2_skt.dts | 6 ++-- arch/arm/boot/dts/amlogic/g12a_s905d2_u200.dts | 6 ++-- arch/arm/boot/dts/amlogic/g12a_s905d2_u200_1g.dts | 6 ++-- .../dts/amlogic/g12a_s905d2_u200_buildroot.dts | 6 ++-- .../g12a_s905d2_u200_buildroot_vccktest.dts | 6 ++-- .../dts/amlogic/g12a_s905d2_u200_drm_buildroot.dts | 6 ++-- arch/arm/boot/dts/amlogic/g12a_s905x2_u211.dts | 6 ++-- arch/arm/boot/dts/amlogic/g12a_s905x2_u211_1g.dts | 6 ++-- .../arm/boot/dts/amlogic/g12a_s905x2_u211_512m.dts | 6 ++-- .../dts/amlogic/g12a_s905x2_u211_buildroot.dts | 6 ++-- arch/arm/boot/dts/amlogic/g12a_s905x2_u212.dts | 6 ++-- arch/arm/boot/dts/amlogic/g12a_s905x2_u212_1g.dts | 6 ++-- .../dts/amlogic/g12a_s905x2_u212_buildroot.dts | 6 ++-- arch/arm/boot/dts/amlogic/g12a_s905y2_u220.dts | 6 ++-- arch/arm/boot/dts/amlogic/g12a_s905y2_u221.dts | 6 ++-- arch/arm/boot/dts/amlogic/g12b_a311d_skt.dts | 6 ++-- arch/arm/boot/dts/amlogic/g12b_a311d_skt_a.dts | 6 ++-- arch/arm/boot/dts/amlogic/g12b_a311d_w400.dts | 6 ++-- arch/arm/boot/dts/amlogic/g12b_a311d_w400_a.dts | 6 ++-- .../boot/dts/amlogic/g12b_a311d_w400_buildroot.dts | 6 ++-- .../dts/amlogic/g12b_a311d_w400_buildroot_a.dts | 6 ++-- .../amlogic/g12b_a311d_w400_buildroot_vccktest.dts | 6 ++-- .../g12b_a311d_w400_buildroot_vccktest_a.dts | 6 ++-- arch/arm/boot/dts/amlogic/tl1_t962x2_skt.dts | 6 ++-- arch/arm/boot/dts/amlogic/tl1_t962x2_t309.dts | 8 +++-- arch/arm/boot/dts/amlogic/tl1_t962x2_x301.dts | 9 ++++-- arch/arm64/boot/dts/amlogic/g12a_s905d2_skt.dts | 6 ++-- arch/arm64/boot/dts/amlogic/g12a_s905d2_u200.dts | 6 ++-- .../arm64/boot/dts/amlogic/g12a_s905d2_u200_1g.dts | 6 ++-- .../dts/amlogic/g12a_s905d2_u200_buildroot.dts | 6 ++-- .../g12a_s905d2_u200_buildroot_vccktest.dts | 6 ++-- .../dts/amlogic/g12a_s905d2_u200_drm_buildroot.dts | 6 ++-- arch/arm64/boot/dts/amlogic/g12a_s905x2_u211.dts | 6 ++-- .../arm64/boot/dts/amlogic/g12a_s905x2_u211_1g.dts | 6 ++-- .../boot/dts/amlogic/g12a_s905x2_u211_512m.dts | 6 ++-- .../dts/amlogic/g12a_s905x2_u211_buildroot.dts | 6 ++-- arch/arm64/boot/dts/amlogic/g12a_s905x2_u212.dts | 6 ++-- .../arm64/boot/dts/amlogic/g12a_s905x2_u212_1g.dts | 6 ++-- .../dts/amlogic/g12a_s905x2_u212_buildroot.dts | 6 ++-- arch/arm64/boot/dts/amlogic/g12a_s905y2_u220.dts | 6 ++-- arch/arm64/boot/dts/amlogic/g12a_s905y2_u221.dts | 6 ++-- arch/arm64/boot/dts/amlogic/g12b_a311d_skt.dts | 6 ++-- arch/arm64/boot/dts/amlogic/g12b_a311d_skt_a.dts | 6 ++-- arch/arm64/boot/dts/amlogic/g12b_a311d_w400.dts | 6 ++-- arch/arm64/boot/dts/amlogic/g12b_a311d_w400_a.dts | 6 ++-- .../boot/dts/amlogic/g12b_a311d_w400_buildroot.dts | 6 ++-- .../dts/amlogic/g12b_a311d_w400_buildroot_a.dts | 6 ++-- .../amlogic/g12b_a311d_w400_buildroot_vccktest.dts | 6 ++-- .../g12b_a311d_w400_buildroot_vccktest_a.dts | 6 ++-- .../boot/dts/amlogic/g12b_a311x_w411_buildroot.dts | 6 ++-- .../dts/amlogic/g12b_a311x_w411_buildroot_a.dts | 6 ++-- arch/arm64/boot/dts/amlogic/tl1_t962x2_t309.dts | 8 +++-- arch/arm64/boot/dts/amlogic/tl1_t962x2_x301.dts | 8 +++-- sound/soc/amlogic/auge/ddr_mngr.c | 4 +-- sound/soc/amlogic/auge/spdif_hw.c | 12 +++---- sound/soc/amlogic/auge/tdm.c | 37 +++++++++++++++++----- 56 files changed, 252 insertions(+), 128 deletions(-) diff --git a/arch/arm/boot/dts/amlogic/g12a_s905d2_skt.dts b/arch/arm/boot/dts/amlogic/g12a_s905d2_skt.dts index 352ea71..70f1447 100644 --- a/arch/arm/boot/dts/amlogic/g12a_s905d2_skt.dts +++ b/arch/arm/boot/dts/amlogic/g12a_s905d2_skt.dts @@ -792,8 +792,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12a_s905d2_u200.dts b/arch/arm/boot/dts/amlogic/g12a_s905d2_u200.dts index e0c0eb2..cc511d8 100644 --- a/arch/arm/boot/dts/amlogic/g12a_s905d2_u200.dts +++ b/arch/arm/boot/dts/amlogic/g12a_s905d2_u200.dts @@ -1069,8 +1069,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12a_s905d2_u200_1g.dts b/arch/arm/boot/dts/amlogic/g12a_s905d2_u200_1g.dts index 0517486..568e8a3 100644 --- a/arch/arm/boot/dts/amlogic/g12a_s905d2_u200_1g.dts +++ b/arch/arm/boot/dts/amlogic/g12a_s905d2_u200_1g.dts @@ -913,8 +913,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12a_s905d2_u200_buildroot.dts b/arch/arm/boot/dts/amlogic/g12a_s905d2_u200_buildroot.dts index c5ee01e..2e64f70 100644 --- a/arch/arm/boot/dts/amlogic/g12a_s905d2_u200_buildroot.dts +++ b/arch/arm/boot/dts/amlogic/g12a_s905d2_u200_buildroot.dts @@ -880,8 +880,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12a_s905d2_u200_buildroot_vccktest.dts b/arch/arm/boot/dts/amlogic/g12a_s905d2_u200_buildroot_vccktest.dts index bc7730e..f91cb17 100644 --- a/arch/arm/boot/dts/amlogic/g12a_s905d2_u200_buildroot_vccktest.dts +++ b/arch/arm/boot/dts/amlogic/g12a_s905d2_u200_buildroot_vccktest.dts @@ -899,8 +899,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12a_s905d2_u200_drm_buildroot.dts b/arch/arm/boot/dts/amlogic/g12a_s905d2_u200_drm_buildroot.dts index 84f951f..2479669 100644 --- a/arch/arm/boot/dts/amlogic/g12a_s905d2_u200_drm_buildroot.dts +++ b/arch/arm/boot/dts/amlogic/g12a_s905d2_u200_drm_buildroot.dts @@ -895,8 +895,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12a_s905x2_u211.dts b/arch/arm/boot/dts/amlogic/g12a_s905x2_u211.dts index 3624452..6ac5b11 100644 --- a/arch/arm/boot/dts/amlogic/g12a_s905x2_u211.dts +++ b/arch/arm/boot/dts/amlogic/g12a_s905x2_u211.dts @@ -840,8 +840,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12a_s905x2_u211_1g.dts b/arch/arm/boot/dts/amlogic/g12a_s905x2_u211_1g.dts index fcd2ebb..f9f0c48 100644 --- a/arch/arm/boot/dts/amlogic/g12a_s905x2_u211_1g.dts +++ b/arch/arm/boot/dts/amlogic/g12a_s905x2_u211_1g.dts @@ -831,8 +831,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12a_s905x2_u211_512m.dts b/arch/arm/boot/dts/amlogic/g12a_s905x2_u211_512m.dts index f3480dc..119fcf5 100644 --- a/arch/arm/boot/dts/amlogic/g12a_s905x2_u211_512m.dts +++ b/arch/arm/boot/dts/amlogic/g12a_s905x2_u211_512m.dts @@ -827,8 +827,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12a_s905x2_u211_buildroot.dts b/arch/arm/boot/dts/amlogic/g12a_s905x2_u211_buildroot.dts index e999e2c..666b218 100644 --- a/arch/arm/boot/dts/amlogic/g12a_s905x2_u211_buildroot.dts +++ b/arch/arm/boot/dts/amlogic/g12a_s905x2_u211_buildroot.dts @@ -881,8 +881,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12a_s905x2_u212.dts b/arch/arm/boot/dts/amlogic/g12a_s905x2_u212.dts index 56d98e6..cecdd6a 100644 --- a/arch/arm/boot/dts/amlogic/g12a_s905x2_u212.dts +++ b/arch/arm/boot/dts/amlogic/g12a_s905x2_u212.dts @@ -880,8 +880,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12a_s905x2_u212_1g.dts b/arch/arm/boot/dts/amlogic/g12a_s905x2_u212_1g.dts index 5c7824c..de25c7b 100644 --- a/arch/arm/boot/dts/amlogic/g12a_s905x2_u212_1g.dts +++ b/arch/arm/boot/dts/amlogic/g12a_s905x2_u212_1g.dts @@ -876,8 +876,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12a_s905x2_u212_buildroot.dts b/arch/arm/boot/dts/amlogic/g12a_s905x2_u212_buildroot.dts index a3281e8..8e4bc50 100644 --- a/arch/arm/boot/dts/amlogic/g12a_s905x2_u212_buildroot.dts +++ b/arch/arm/boot/dts/amlogic/g12a_s905x2_u212_buildroot.dts @@ -881,8 +881,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12a_s905y2_u220.dts b/arch/arm/boot/dts/amlogic/g12a_s905y2_u220.dts index 48895fc..175375c 100644 --- a/arch/arm/boot/dts/amlogic/g12a_s905y2_u220.dts +++ b/arch/arm/boot/dts/amlogic/g12a_s905y2_u220.dts @@ -823,8 +823,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12a_s905y2_u221.dts b/arch/arm/boot/dts/amlogic/g12a_s905y2_u221.dts index caadd28..1c1a867 100644 --- a/arch/arm/boot/dts/amlogic/g12a_s905y2_u221.dts +++ b/arch/arm/boot/dts/amlogic/g12a_s905y2_u221.dts @@ -784,8 +784,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12b_a311d_skt.dts b/arch/arm/boot/dts/amlogic/g12b_a311d_skt.dts index 155a1ed..ed6d2be 100644 --- a/arch/arm/boot/dts/amlogic/g12b_a311d_skt.dts +++ b/arch/arm/boot/dts/amlogic/g12b_a311d_skt.dts @@ -918,8 +918,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12b_a311d_skt_a.dts b/arch/arm/boot/dts/amlogic/g12b_a311d_skt_a.dts index c1e0449..6706641 100644 --- a/arch/arm/boot/dts/amlogic/g12b_a311d_skt_a.dts +++ b/arch/arm/boot/dts/amlogic/g12b_a311d_skt_a.dts @@ -894,8 +894,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12b_a311d_w400.dts b/arch/arm/boot/dts/amlogic/g12b_a311d_w400.dts index d2f9141..c30da64 100644 --- a/arch/arm/boot/dts/amlogic/g12b_a311d_w400.dts +++ b/arch/arm/boot/dts/amlogic/g12b_a311d_w400.dts @@ -858,8 +858,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12b_a311d_w400_a.dts b/arch/arm/boot/dts/amlogic/g12b_a311d_w400_a.dts index de5c382..f73033c 100644 --- a/arch/arm/boot/dts/amlogic/g12b_a311d_w400_a.dts +++ b/arch/arm/boot/dts/amlogic/g12b_a311d_w400_a.dts @@ -834,8 +834,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12b_a311d_w400_buildroot.dts b/arch/arm/boot/dts/amlogic/g12b_a311d_w400_buildroot.dts index 5fe7f1a..6d1a8a6 100644 --- a/arch/arm/boot/dts/amlogic/g12b_a311d_w400_buildroot.dts +++ b/arch/arm/boot/dts/amlogic/g12b_a311d_w400_buildroot.dts @@ -975,8 +975,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12b_a311d_w400_buildroot_a.dts b/arch/arm/boot/dts/amlogic/g12b_a311d_w400_buildroot_a.dts index c84d220..25f73af 100644 --- a/arch/arm/boot/dts/amlogic/g12b_a311d_w400_buildroot_a.dts +++ b/arch/arm/boot/dts/amlogic/g12b_a311d_w400_buildroot_a.dts @@ -953,8 +953,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12b_a311d_w400_buildroot_vccktest.dts b/arch/arm/boot/dts/amlogic/g12b_a311d_w400_buildroot_vccktest.dts index fcdffd3..71cff0c 100644 --- a/arch/arm/boot/dts/amlogic/g12b_a311d_w400_buildroot_vccktest.dts +++ b/arch/arm/boot/dts/amlogic/g12b_a311d_w400_buildroot_vccktest.dts @@ -871,8 +871,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/g12b_a311d_w400_buildroot_vccktest_a.dts b/arch/arm/boot/dts/amlogic/g12b_a311d_w400_buildroot_vccktest_a.dts index c999018..fd62cd9 100644 --- a/arch/arm/boot/dts/amlogic/g12b_a311d_w400_buildroot_vccktest_a.dts +++ b/arch/arm/boot/dts/amlogic/g12b_a311d_w400_buildroot_vccktest_a.dts @@ -865,8 +865,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm/boot/dts/amlogic/tl1_t962x2_skt.dts b/arch/arm/boot/dts/amlogic/tl1_t962x2_skt.dts index 9ff2d02..94c29c2 100644 --- a/arch/arm/boot/dts/amlogic/tl1_t962x2_skt.dts +++ b/arch/arm/boot/dts/amlogic/tl1_t962x2_skt.dts @@ -1224,8 +1224,10 @@ clocks = <&clkaudio CLKID_AUDIO_MCLK_A &clkc CLKID_MPLL0 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL1 + &clkaudio CLKID_AUDIO_SPDIFOUT_A>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdma_mclk &tdmout_a>; diff --git a/arch/arm/boot/dts/amlogic/tl1_t962x2_t309.dts b/arch/arm/boot/dts/amlogic/tl1_t962x2_t309.dts index 8cb3a73..c5f219e 100644 --- a/arch/arm/boot/dts/amlogic/tl1_t962x2_t309.dts +++ b/arch/arm/boot/dts/amlogic/tl1_t962x2_t309.dts @@ -1265,8 +1265,10 @@ clocks = <&clkaudio CLKID_AUDIO_MCLK_A &clkc CLKID_MPLL0 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL1 + &clkaudio CLKID_AUDIO_SPDIFOUT_A>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdma_mclk &tdmout_a>; @@ -1323,7 +1325,7 @@ compatible = "amlogic, tl1-snd-spdif-a"; #sound-dai-cells = <0>; - clocks = <&clkc CLKID_MPLL0 + clocks = <&clkc CLKID_MPLL1 &clkc CLKID_FCLK_DIV4 &clkaudio CLKID_AUDIO_GATE_SPDIFIN &clkaudio CLKID_AUDIO_GATE_SPDIFOUT_A diff --git a/arch/arm/boot/dts/amlogic/tl1_t962x2_x301.dts b/arch/arm/boot/dts/amlogic/tl1_t962x2_x301.dts index eeddf10..b6dbcb2 100644 --- a/arch/arm/boot/dts/amlogic/tl1_t962x2_x301.dts +++ b/arch/arm/boot/dts/amlogic/tl1_t962x2_x301.dts @@ -403,6 +403,7 @@ aml-audio-card,dai-link@4 { mclk-fs = <128>; + continuous-clock; /* suffix-name, sync with android audio hal used for */ suffix-name = "alsaPORT-spdif"; cpu { @@ -1281,8 +1282,10 @@ clocks = <&clkaudio CLKID_AUDIO_MCLK_A &clkc CLKID_MPLL0 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL1 + &clkaudio CLKID_AUDIO_SPDIFOUT_A>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdma_mclk &tdmout_a>; @@ -1339,7 +1342,7 @@ compatible = "amlogic, tl1-snd-spdif-a"; #sound-dai-cells = <0>; - clocks = <&clkc CLKID_MPLL0 + clocks = <&clkc CLKID_MPLL1 &clkc CLKID_FCLK_DIV4 &clkaudio CLKID_AUDIO_GATE_SPDIFIN &clkaudio CLKID_AUDIO_GATE_SPDIFOUT_A diff --git a/arch/arm64/boot/dts/amlogic/g12a_s905d2_skt.dts b/arch/arm64/boot/dts/amlogic/g12a_s905d2_skt.dts index ae4f090..72c19c9 100644 --- a/arch/arm64/boot/dts/amlogic/g12a_s905d2_skt.dts +++ b/arch/arm64/boot/dts/amlogic/g12a_s905d2_skt.dts @@ -792,8 +792,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200.dts b/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200.dts index 7443f3a..1e326a7 100644 --- a/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200.dts +++ b/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200.dts @@ -1067,8 +1067,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200_1g.dts b/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200_1g.dts index eff237c..2658a87 100644 --- a/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200_1g.dts +++ b/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200_1g.dts @@ -907,8 +907,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200_buildroot.dts b/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200_buildroot.dts index 190540c..104e12f 100644 --- a/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200_buildroot.dts +++ b/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200_buildroot.dts @@ -880,8 +880,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200_buildroot_vccktest.dts b/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200_buildroot_vccktest.dts index 5b288e8..36f4f5ab 100644 --- a/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200_buildroot_vccktest.dts +++ b/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200_buildroot_vccktest.dts @@ -899,8 +899,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200_drm_buildroot.dts b/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200_drm_buildroot.dts index 7caa5ec..13be6d5 100644 --- a/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200_drm_buildroot.dts +++ b/arch/arm64/boot/dts/amlogic/g12a_s905d2_u200_drm_buildroot.dts @@ -895,8 +895,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12a_s905x2_u211.dts b/arch/arm64/boot/dts/amlogic/g12a_s905x2_u211.dts index c9342b1..46db6c7 100644 --- a/arch/arm64/boot/dts/amlogic/g12a_s905x2_u211.dts +++ b/arch/arm64/boot/dts/amlogic/g12a_s905x2_u211.dts @@ -840,8 +840,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12a_s905x2_u211_1g.dts b/arch/arm64/boot/dts/amlogic/g12a_s905x2_u211_1g.dts index 24074be..5c78cdc 100644 --- a/arch/arm64/boot/dts/amlogic/g12a_s905x2_u211_1g.dts +++ b/arch/arm64/boot/dts/amlogic/g12a_s905x2_u211_1g.dts @@ -831,8 +831,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12a_s905x2_u211_512m.dts b/arch/arm64/boot/dts/amlogic/g12a_s905x2_u211_512m.dts index 723cc70..7b5cdfd 100644 --- a/arch/arm64/boot/dts/amlogic/g12a_s905x2_u211_512m.dts +++ b/arch/arm64/boot/dts/amlogic/g12a_s905x2_u211_512m.dts @@ -827,8 +827,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12a_s905x2_u211_buildroot.dts b/arch/arm64/boot/dts/amlogic/g12a_s905x2_u211_buildroot.dts index 36241d6..784446e9 100644 --- a/arch/arm64/boot/dts/amlogic/g12a_s905x2_u211_buildroot.dts +++ b/arch/arm64/boot/dts/amlogic/g12a_s905x2_u211_buildroot.dts @@ -881,8 +881,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12a_s905x2_u212.dts b/arch/arm64/boot/dts/amlogic/g12a_s905x2_u212.dts index c36e1df..deb592b 100644 --- a/arch/arm64/boot/dts/amlogic/g12a_s905x2_u212.dts +++ b/arch/arm64/boot/dts/amlogic/g12a_s905x2_u212.dts @@ -880,8 +880,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12a_s905x2_u212_1g.dts b/arch/arm64/boot/dts/amlogic/g12a_s905x2_u212_1g.dts index 02662aa..bf9519e 100644 --- a/arch/arm64/boot/dts/amlogic/g12a_s905x2_u212_1g.dts +++ b/arch/arm64/boot/dts/amlogic/g12a_s905x2_u212_1g.dts @@ -872,8 +872,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12a_s905x2_u212_buildroot.dts b/arch/arm64/boot/dts/amlogic/g12a_s905x2_u212_buildroot.dts index dd8d37e..6d80428 100644 --- a/arch/arm64/boot/dts/amlogic/g12a_s905x2_u212_buildroot.dts +++ b/arch/arm64/boot/dts/amlogic/g12a_s905x2_u212_buildroot.dts @@ -881,8 +881,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12a_s905y2_u220.dts b/arch/arm64/boot/dts/amlogic/g12a_s905y2_u220.dts index d2a56ed..b274718 100644 --- a/arch/arm64/boot/dts/amlogic/g12a_s905y2_u220.dts +++ b/arch/arm64/boot/dts/amlogic/g12a_s905y2_u220.dts @@ -823,8 +823,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12a_s905y2_u221.dts b/arch/arm64/boot/dts/amlogic/g12a_s905y2_u221.dts index cec20dd..c914dff 100644 --- a/arch/arm64/boot/dts/amlogic/g12a_s905y2_u221.dts +++ b/arch/arm64/boot/dts/amlogic/g12a_s905y2_u221.dts @@ -782,8 +782,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12b_a311d_skt.dts b/arch/arm64/boot/dts/amlogic/g12b_a311d_skt.dts index 15e950f..798eb296 100644 --- a/arch/arm64/boot/dts/amlogic/g12b_a311d_skt.dts +++ b/arch/arm64/boot/dts/amlogic/g12b_a311d_skt.dts @@ -918,8 +918,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12b_a311d_skt_a.dts b/arch/arm64/boot/dts/amlogic/g12b_a311d_skt_a.dts index 1ce3d62..666ba72 100644 --- a/arch/arm64/boot/dts/amlogic/g12b_a311d_skt_a.dts +++ b/arch/arm64/boot/dts/amlogic/g12b_a311d_skt_a.dts @@ -894,8 +894,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12b_a311d_w400.dts b/arch/arm64/boot/dts/amlogic/g12b_a311d_w400.dts index 63021958..7e64162 100644 --- a/arch/arm64/boot/dts/amlogic/g12b_a311d_w400.dts +++ b/arch/arm64/boot/dts/amlogic/g12b_a311d_w400.dts @@ -858,8 +858,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_a.dts b/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_a.dts index 266185f..035bbe2 100644 --- a/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_a.dts +++ b/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_a.dts @@ -834,8 +834,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_buildroot.dts b/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_buildroot.dts index 478badf..cd054c4 100644 --- a/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_buildroot.dts +++ b/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_buildroot.dts @@ -974,8 +974,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_buildroot_a.dts b/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_buildroot_a.dts index f662823..f503e9e 100644 --- a/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_buildroot_a.dts +++ b/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_buildroot_a.dts @@ -952,8 +952,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_buildroot_vccktest.dts b/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_buildroot_vccktest.dts index 8f00163..970f94a 100644 --- a/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_buildroot_vccktest.dts +++ b/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_buildroot_vccktest.dts @@ -871,8 +871,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_buildroot_vccktest_a.dts b/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_buildroot_vccktest_a.dts index ce65118..8a6d0f7 100644 --- a/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_buildroot_vccktest_a.dts +++ b/arch/arm64/boot/dts/amlogic/g12b_a311d_w400_buildroot_vccktest_a.dts @@ -865,8 +865,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12b_a311x_w411_buildroot.dts b/arch/arm64/boot/dts/amlogic/g12b_a311x_w411_buildroot.dts index cb70d1a..ddcc3a3 100644 --- a/arch/arm64/boot/dts/amlogic/g12b_a311x_w411_buildroot.dts +++ b/arch/arm64/boot/dts/amlogic/g12b_a311x_w411_buildroot.dts @@ -962,8 +962,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/g12b_a311x_w411_buildroot_a.dts b/arch/arm64/boot/dts/amlogic/g12b_a311x_w411_buildroot_a.dts index b72068d..186094c 100644 --- a/arch/arm64/boot/dts/amlogic/g12b_a311x_w411_buildroot_a.dts +++ b/arch/arm64/boot/dts/amlogic/g12b_a311x_w411_buildroot_a.dts @@ -927,8 +927,10 @@ dai-tdm-clk-sel = <1>; clocks = <&clkaudio CLKID_AUDIO_MCLK_B &clkc CLKID_MPLL1 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL0 + &clkaudio CLKID_AUDIO_SPDIFOUT_CTRL>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdmb_mclk &tdmout_b &tdmin_b>; /* diff --git a/arch/arm64/boot/dts/amlogic/tl1_t962x2_t309.dts b/arch/arm64/boot/dts/amlogic/tl1_t962x2_t309.dts index a9195e1..b3cdd53 100644 --- a/arch/arm64/boot/dts/amlogic/tl1_t962x2_t309.dts +++ b/arch/arm64/boot/dts/amlogic/tl1_t962x2_t309.dts @@ -1263,8 +1263,10 @@ clocks = <&clkaudio CLKID_AUDIO_MCLK_A &clkc CLKID_MPLL0 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL1 + &clkaudio CLKID_AUDIO_SPDIFOUT_A>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdma_mclk &tdmout_a>; @@ -1321,7 +1323,7 @@ compatible = "amlogic, tl1-snd-spdif-a"; #sound-dai-cells = <0>; - clocks = <&clkc CLKID_MPLL0 + clocks = <&clkc CLKID_MPLL1 &clkc CLKID_FCLK_DIV4 &clkaudio CLKID_AUDIO_GATE_SPDIFIN &clkaudio CLKID_AUDIO_GATE_SPDIFOUT_A diff --git a/arch/arm64/boot/dts/amlogic/tl1_t962x2_x301.dts b/arch/arm64/boot/dts/amlogic/tl1_t962x2_x301.dts index 2a8298e..e5d9a1f 100644 --- a/arch/arm64/boot/dts/amlogic/tl1_t962x2_x301.dts +++ b/arch/arm64/boot/dts/amlogic/tl1_t962x2_x301.dts @@ -1277,8 +1277,10 @@ clocks = <&clkaudio CLKID_AUDIO_MCLK_A &clkc CLKID_MPLL0 - &clkc CLKID_MPLL0>; - clock-names = "mclk", "clk_srcpll", "samesource_sysclk"; + &clkc CLKID_MPLL1 + &clkaudio CLKID_AUDIO_SPDIFOUT_A>; + clock-names = "mclk", "clk_srcpll", + "samesource_srcpll", "samesource_clk"; pinctrl-names = "tdm_pins"; pinctrl-0 = <&tdma_mclk &tdmout_a>; @@ -1335,7 +1337,7 @@ compatible = "amlogic, tl1-snd-spdif-a"; #sound-dai-cells = <0>; - clocks = <&clkc CLKID_MPLL0 + clocks = <&clkc CLKID_MPLL1 &clkc CLKID_FCLK_DIV4 &clkaudio CLKID_AUDIO_GATE_SPDIFIN &clkaudio CLKID_AUDIO_GATE_SPDIFOUT_A diff --git a/sound/soc/amlogic/auge/ddr_mngr.c b/sound/soc/amlogic/auge/ddr_mngr.c index ee76da9..e01ec37 100644 --- a/sound/soc/amlogic/auge/ddr_mngr.c +++ b/sound/soc/amlogic/auge/ddr_mngr.c @@ -931,8 +931,8 @@ int aml_check_sharebuffer_valid(struct frddr *fr, int ss_sel) && (frddrs[i].fifo_id != current_fifo_id) && (frddrs[i].dest == ss_sel)) { - pr_info(" frddr:%d, ss_sel:%d used, invalid for share buffer\n", - i, + pr_info("%s, ss_sel:%d used, not for share buffer at same time\n", + __func__, ss_sel); ret = 0; break; diff --git a/sound/soc/amlogic/auge/spdif_hw.c b/sound/soc/amlogic/auge/spdif_hw.c index 65b4d47..0b498f0 100644 --- a/sound/soc/amlogic/auge/spdif_hw.c +++ b/sound/soc/amlogic/auge/spdif_hw.c @@ -391,8 +391,8 @@ void spdifout_to_hdmitx_ctrl(int spdif_index) | spdif_index << 0 /* spdif_clk */ ); } - -void spdifout_clk_ctrl(int spdif_id, bool is_enable) +#if 0 +static void spdifout_clk_ctrl(int spdif_id, bool is_enable) { unsigned int offset, reg; @@ -402,7 +402,7 @@ void spdifout_clk_ctrl(int spdif_id, bool is_enable) /* select : mpll 0, 24m, so spdif clk:6m */ audiobus_write(reg, is_enable << 31 | 0x0 << 24 | 0x3 << 0); } - +#endif static void spdifout_fifo_ctrl(int spdif_id, int fifo_id, int bitwidth, int channels) { @@ -484,10 +484,6 @@ void spdifout_samesource_set(int spdif_index, int fifo_id, else spdif_id = 0; - /* clk for spdif_b is always on */ - /*if (!spdif_id)*/ - spdifout_clk_ctrl(spdif_id, /*is_enable*/true); - if (is_enable) spdifout_fifo_ctrl(spdif_id, fifo_id, bitwidth, channels); } @@ -623,7 +619,7 @@ void spdifout_play_with_zerodata(unsigned int spdif_id) src0_sel = 3; /* spdif clk */ - spdifout_clk_ctrl(spdif_id, true); + //spdifout_clk_ctrl(spdif_id, true); /* spdif to hdmitx */ spdifout_to_hdmitx_ctrl(spdif_id); diff --git a/sound/soc/amlogic/auge/tdm.c b/sound/soc/amlogic/auge/tdm.c index 9cefe92..bad23b9 100644 --- a/sound/soc/amlogic/auge/tdm.c +++ b/sound/soc/amlogic/auge/tdm.c @@ -102,7 +102,8 @@ struct aml_tdm { struct clk *clk; struct clk *clk_gate; struct clk *mclk; - struct clk *samesrc_sysclk; + struct clk *samesrc_srcpll; + struct clk *samesrc_clk; bool contns_clk; unsigned int id; /* bclk src selection */ @@ -741,9 +742,16 @@ static int aml_dai_tdm_hw_params(struct snd_pcm_substream *substream, sharebuffer_get_mclk_fs_ratio(p_tdm->samesource_sel, &mux, &ratio); pr_info("samesource sysclk:%d\n", rate * ratio * mux); - if (p_tdm->samesrc_sysclk) - clk_set_rate(p_tdm->samesrc_sysclk, + if (!IS_ERR(p_tdm->samesrc_srcpll)) { + clk_set_rate(p_tdm->samesrc_srcpll, rate * ratio * mux); + clk_prepare_enable(p_tdm->samesrc_srcpll); + } + if (!IS_ERR(p_tdm->samesrc_clk)) { + clk_set_rate(p_tdm->samesrc_clk, + rate * ratio); + clk_prepare_enable(p_tdm->samesrc_clk); + } } if (!p_tdm->contns_clk && !IS_ERR(p_tdm->mclk)) { @@ -1318,12 +1326,25 @@ static int aml_tdm_platform_probe(struct platform_device *pdev) if (ret < 0) p_tdm->samesource_sel = -1; else { - p_tdm->samesrc_sysclk = devm_clk_get(&pdev->dev, - "samesource_sysclk"); - if (IS_ERR(p_tdm->samesrc_sysclk)) { + p_tdm->samesrc_srcpll = devm_clk_get(&pdev->dev, + "samesource_srcpll"); + if (IS_ERR(p_tdm->samesrc_srcpll)) { dev_err(&pdev->dev, - "Can't retrieve samesrc_sysclk clock\n"); - return PTR_ERR(p_tdm->samesrc_sysclk); + "Can't retrieve samesrc_srcpll clock\n"); + return PTR_ERR(p_tdm->samesrc_srcpll); + } + p_tdm->samesrc_clk = devm_clk_get(&pdev->dev, + "samesource_clk"); + if (IS_ERR(p_tdm->samesrc_clk)) { + dev_err(&pdev->dev, + "Can't retrieve samesrc_clk clock\n"); + return PTR_ERR(p_tdm->samesrc_clk); + } + ret = clk_set_parent(p_tdm->samesrc_clk, + p_tdm->samesrc_srcpll); + if (ret) { + dev_err(dev, "can't set samesource clock\n"); + return ret; } pr_info("TDM id %d samesource_sel:%d\n", p_tdm->id, -- 2.7.4