clk: Samsung: audss: Add support for Exynos5420
v2 cover clk: Samsung: audss: Add support for Exynos5420
This patch set adds support for audio subsystem clks on Exynos5420. Exynos5420 audio subsystem has a gate bit for ADMA controller and the some of the parent clks for mout_i2s and sclk_pcm are different from Exynos5250. So this patch adds provision for supporting both the platforms by determining the parent clk names based on compatible string.
Changes since V1:
- parent clocks are determined by using the compatible string and not passed via device tree as done in V1 because the probing order of the clock providers can't be guaranteed.
Andrew Bresticker (3):
clk: exynos-audss: add support for Exynos 5420
clk: exynos-audss: set correct parent clocks
ARM: dts: exynos5420: add audio clock controller
Padmavathi Venna (1):
ARM: dts: Correct the /include entry on exynos5420 dtsi file
.../devicetree/bindings/clock/clk-exynos-audss.txt | 7 +++++-- arch/arm/boot/dts/exynos5420.dtsi | 11 ++++++++++- drivers/clk/samsung/clk-exynos-audss.c | 20 +++++++++++++++++++- include/dt-bindings/clk/exynos-audss-clk.h | 3 ++- 4 files changed, 36 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.4.4
PATCH 1/4 clk: exynos-audss: add support for Exynos 5420
From: Andrew Bresticker <[email protected]>
The AudioSS block on Exynos 5420 has an additional clock gate for the ADMA bus clock.
seviewed-on: https://gerrit.chromium.org/gerrit/57711
--- .../devicetree/bindings/clock/clk-exynos-audss.txt | 7 +++++-- drivers/clk/samsung/clk-exynos-audss.c | 8 ++++++++ include/dt-bindings/clk/exynos-audss-clk.h | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/clock/clk-exynos-audss.txt +5 -2
@@ -8,8 +8,10 @@ Required Properties: - compatible: should be one of the following: - "samsung,exynos4210-audss-clock" - controller compatible with all Exynos4 SoCs. - - "samsung,exynos5250-audss-clock" - controller compatible with all Exynos5 SoCs. - + - "samsung,exynos5250-audss-clock" - controller compatible with Exynos5250 + SoCs. + - "samsung,exynos5420-audss-clock" - controller compatible with Exynos5420 + SoCs. - reg: physical base address and length of the controller's register set. - #clock-cells: should be 1.
@@ -34,6 +36,7 @@ i2s_bus 6 sclk_i2s 7 pcm_bus 8 sclk_pcm 9 +adma 10 Exynos5420 Example 1: An example of a clock controller node is listed below.
drivers/clk/samsung/clk-exynos-audss.c +8 -0
@@ -121,6 +121,12 @@ void __init exynos_audss_clk_init(struct device_node *np)"div_pcm0" ,CLK_SET_RATE_PARENT , reg_base + ASS_CLK_GATE, 5, 0, &lock); +if (of_device_is_compatible (np,"samsung,exynos5420-audss-clock" )) { + clk_table[EXYNOS_ADMA ] =clk_register_gate (NULL ,"adma" , +"dout_srp" ,CLK_SET_RATE_PARENT , + reg_base +ASS_CLK_GATE ,9 ,0 , &lock); + } +#ifdef CONFIG_PM_SLEEP register_syscore_ops (&exynos_audss_clk_syscore_ops);#endif
@@ -131,3 +137,5 @@ CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock", exynos_audss_clk_init);CLK_OF_DECLARE (exynos5250_audss_clk,"samsung,exynos5250-audss-clock" , exynos_audss_clk_init); +CLK_OF_DECLARE (exynos5420_audss_clk,"samsung,exynos5420-audss-clock" , + exynos_audss_clk_init);
include/dt-bindings/clk/exynos-audss-clk.h +2 -1
@@ -19,7 +19,8 @@#define EXYNOS_SCLK_I2S 7#define EXYNOS_PCM_BUS 8#define EXYNOS_SCLK_PCM 9 +#define EXYNOS_ADMA 10 -#define EXYNOS_AUDSS_MAX_CLKS 10 +#define EXYNOS_AUDSS_MAX_CLKS 11#endif
Signature · 1 line
1.7.4.4
PATCH v2 2/4 clk: exynos-audss: set correct parent clocks
In reply to Padmavathi VennaFrom: Andrew Bresticker <[email protected]>
Different Exynos SoCs have different names for certain input clocks to the AudioSS block. Since the order in which clock providers are probed is not guaranteed, we can't use the device-tree to pass the correct input clocks. Instead, use the compatibility string to determine what the correct parent clocks should be.
--- drivers/clk/samsung/clk-exynos-audss.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-)
drivers/clk/samsung/clk-exynos-audss.c +11 -1
@@ -35,6 +35,7 @@ static unsigned long reg_save[][2] = {/* list of all parent clock list */ static const char *mout_audss_p[] = {"fin_pll" ,"fout_epll" };static const char *mout_i2s_p[] = {"mout_audss" ,"cdclk0" ,"sclk_audio0" }; +static const char *sclk_pcm_p ="sclk_pcm0" ;#ifdef CONFIG_PM_SLEEP static int exynos_audss_clk_suspend (void )
@@ -77,6 +78,15 @@ void __init exynos_audss_clk_init(struct device_node *np)return ; } +/* fix up clock parent names based on SoC */ +if (of_device_is_compatible (np,"samsung,exynos5420-audss-clock" )) { + mout_i2s_p[2 ] ="sclk_maudio0" ; + sclk_pcm_p ="sclk_maupcm0" ; + }else if (of_device_is_compatible (np, +"samsung,exynos5250-audss-clock" )) { + sclk_pcm_p ="div_pcm0" ; + } + clk_data.clks = clk_table; clk_data.clk_num =EXYNOS_AUDSS_MAX_CLKS ;of_clk_add_provider (np, of_clk_src_onecell_get, &clk_data);
@@ -118,7 +128,7 @@ void __init exynos_audss_clk_init(struct device_node *np) reg_base + ASS_CLK_GATE, 4, 0, &lock); clk_table[EXYNOS_SCLK_PCM ] =clk_register_gate (NULL ,"sclk_pcm" , -"div_pcm0" ,CLK_SET_RATE_PARENT , + sclk_pcm_p,CLK_SET_RATE_PARENT , reg_base +ASS_CLK_GATE ,5 ,0 , &lock);if (of_device_is_compatible (np,"samsung,exynos5420-audss-clock" )) {
Signature · 1 line
1.7.4.4
PATCH v2 2/4 clk: exynos-audss: set correct parent clocks
Quoting Padmavathi Venna (2013-08-16 00:49:36)
Quoted 6 lines
From: Andrew Bresticker <[email protected]>
Different Exynos SoCs have different names for certain input clocks to the AudioSS block. Since the order in which clock providers are probed is not guaranteed, we can't use the device-tree to pass the correct input clocks.
Why not? Could your audss binding include something like a "clocks" property with phandles to the input clocks? Then your audss clock driver could just use clk_get like a regular driver to get the parents.
Regards,
Mike
Quoted 47 lines
Instead, use the compatibility string to determine what the correct parent clocks should be.
Signed-off-by Andrew Bresticker <[email protected]>--- drivers/clk/samsung/clk-exynos-audss.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-)drivers/clk/samsung/clk-exynos-audss.c +11
-1@@ -35,6 +35,7 @@ static unsigned long reg_save[][2] = {/* list of all parent clock list */ static const char *mout_audss_p[] = {"fin_pll" ,"fout_epll" };static const char *mout_i2s_p[] = {"mout_audss" ,"cdclk0" ,"sclk_audio0" }; +static const char *sclk_pcm_p ="sclk_pcm0" ;#ifdef CONFIG_PM_SLEEP static int exynos_audss_clk_suspend (void )@@ -77,6 +78,15 @@ void __init exynos_audss_clk_init(struct device_node *np)return ; } +/* fix up clock parent names based on SoC */ +if (of_device_is_compatible (np,"samsung,exynos5420-audss-clock" )) { + mout_i2s_p[2 ] ="sclk_maudio0" ; + sclk_pcm_p ="sclk_maupcm0" ; + }else if (of_device_is_compatible (np, +"samsung,exynos5250-audss-clock" )) { + sclk_pcm_p ="div_pcm0" ; + } + clk_data.clks = clk_table; clk_data.clk_num =EXYNOS_AUDSS_MAX_CLKS ;of_clk_add_provider (np, of_clk_src_onecell_get, &clk_data);@@ -118,7 +128,7 @@ void __init exynos_audss_clk_init(struct device_node *np) reg_base + ASS_CLK_GATE, 4, 0, &lock); clk_table[EXYNOS_SCLK_PCM ] =clk_register_gate (NULL ,"sclk_pcm" , -"div_pcm0" ,CLK_SET_RATE_PARENT , + sclk_pcm_p,CLK_SET_RATE_PARENT , reg_base +ASS_CLK_GATE ,5 ,0 , &lock);if (of_device_is_compatible (np,"samsung,exynos5420-audss-clock" )) {Signature · 1 line
1.7.4.4
PATCH v2 2/4 clk: exynos-audss: set correct parent clocks
Quoted 4 lines · On Tuesday 27 of August 2013 17:43:41 Mike Turquette wrote:
Quoting Padmavathi Venna (2013-08-16 00:49:36)
Quoted 2 lines
From: Andrew Bresticker <[email protected]>
Quoted 8 lines
Quoted 4 lines
Different Exynos SoCs have different names for certain input clocks to the AudioSS block. Since the order in which clock providers are probed is not guaranteed, we can't use the device-tree to pass the correct input clocks.
Why not? Could your audss binding include something like a "clocks" property with phandles to the input clocks? Then your audss clock driver could just use
clk_getlike a regular driver to get the parents.
AFAIR, the driver is currently probed using of_clk_init(), so the reason was probably being unable to defer probing.
However this is not the core system clock controller, so I believe there is no reason for it not to be a normal platform driver.
Best regards,
Tomasz
PATCH v2 3/4 ARM: dts: Correct the /include entry on exynos5420 dtsi file
In reply to Padmavathi VennaThis patch corrects the /include to #include on exynos5420
--- arch/arm/boot/dts/exynos5420.dtsi | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/boot/dts/exynos5420.dtsi +1 -1
@@ -14,7 +14,7 @@ */ #include "exynos5.dtsi" -/include/ "exynos5420-pinctrl.dtsi" +#include "exynos5420-pinctrl.dtsi" / { compatible = "samsung,exynos5420";
Signature · 1 line
1.7.4.4
PATCH v2 4/4 ARM: dts: exynos5420: add audio clock controller
In reply to Padmavathi VennaFrom: Andrew Bresticker <[email protected]>
This adds device-tree bindings for the audio subsystem clock controller on Exynos 5420.
--- arch/arm/boot/dts/exynos5420.dtsi | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/boot/dts/exynos5420.dtsi +9 -0
@@ -15,6 +15,9 @@ #include "exynos5.dtsi" #include "exynos5420-pinctrl.dtsi" + +#include <dt-bindings/clk/exynos-audss-clk.h> + / { compatible = "samsung,exynos5420";
@@ -65,6 +68,12 @@ #clock-cells = <1>; }; + clock_audss: audss-clock-controller@3810000 { + compatible = "samsung,exynos5420-audss-clock"; + reg = <0x03810000 0x0C>; + #clock-cells = <1>; + }; + mct@101C0000 { compatible = "samsung,exynos4210-mct"; reg = <0x101C0000 0x800>;
Signature · 1 line
1.7.4.4
v2 cover clk: Samsung: audss: Add support for Exynos5420
In reply to Padmavathi VennaHi Mike,
Quoted 6 lines · Padmavathi Venna
This patch set adds support for audio subsystem clks on Exynos5420. Exynos5420 audio subsystem has a gate bit for ADMA controller and the some of the parent clks for
mout_i2sandsclk_pcmare different from Exynos5250. So this patch adds provision for supporting both the platforms by determining the parent clk names based on compatible string.
Quoted 8 lines
Changes since V1:
- parent clocks are determined by using the compatible string and not passed via device tree as done in V1 because the probing order of the clock providers can't be guaranteed.Andrew Bresticker (3):
clk: exynos-audss: add support for Exynos 5420
clk: exynos-audss: set correct parent clocks
Can you apply the above two patches into your tree?
Quoted 5 lines
ARM: dts: exynos5420: add audio clock controller
Padmavathi Venna (1):
ARM: dts: Correct the /include entry on exynos5420 dtsi file
Quoted 9 lines
.../devicetree/bindings/clock/clk-exynos-audss.txt | 7 +++++-- arch/arm/boot/dts/exynos5420.dtsi | 11 ++++++++++- drivers/clk/samsung/clk-exynos-audss.c | 20 +++++++++++++++++++- include/dt-bindings/clk/exynos-audss-clk.h | 3 ++- 4 files changed, 36 insertions(+), 5 deletions(-)--
1.7.4.4
Thanks
Padma
v2 cover clk: Samsung: audss: Add support for Exynos5420
Hi Mike,
Quoted 14 lines · Padma Venkat
Hi Mike,
Quoted 11 lines · Padmavathi Venna
This patch set adds support for audio subsystem clks on Exynos5420. Exynos5420 audio subsystem has a gate bit for ADMA controller and the some of the parent clks for
mout_i2sandsclk_pcmare different from Exynos5250. So this patch adds provision for supporting both the platforms by determining the parent clk names based on compatible string.Changes since V1:
- parent clocks are determined by using the compatible string and not passed via device tree as done in V1 because the probing order of the clock providers can't be guaranteed.
Quoted 6 lines
Quoted 3 lines
Andrew Bresticker (3):
clk: exynos-audss: add support for Exynos 5420
clk: exynos-audss: set correct parent clocksCan you apply the above two patches into your tree?
If there is no review comment on the above two can you please acknowledge them? The below patch is dependent on these two patches and Kukjin is waiting for these patches to be merged.
[V2] ARM: dts: Add DMA controller node info on Exynos5420.
https://patchwork.kernel.org/patch/2844436/
Thanks
Padma