diff options
-rw-r--r-- | Documentation/devicetree/bindings/clock/imx6q-clock.txt | 4 | ||||
-rw-r--r-- | arch/arm/boot/dts/imx6qdl.dtsi | 4 | ||||
-rw-r--r-- | arch/arm/boot/dts/imx6sx-19x19-arm2.dts | 4 | ||||
-rw-r--r-- | arch/arm/boot/dts/imx6sx.dtsi | 8 | ||||
-rw-r--r-- | arch/arm/mach-imx/clk-imx6q.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-imx/clk-imx6sx.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-imx6q.c | 8 | ||||
-rw-r--r-- | include/dt-bindings/clock/imx6sx-clock.h | 6 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_esai.c | 9 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_esai.h | 1 |
10 files changed, 44 insertions, 20 deletions
diff --git a/Documentation/devicetree/bindings/clock/imx6q-clock.txt b/Documentation/devicetree/bindings/clock/imx6q-clock.txt index 4f493bf9e961..622e5ac90d28 100644 --- a/Documentation/devicetree/bindings/clock/imx6q-clock.txt +++ b/Documentation/devicetree/bindings/clock/imx6q-clock.txt @@ -128,7 +128,7 @@ clocks and IDs. ecspi4 115 ecspi5 116 enet 117 - esai 118 + esai_extal 118 gpt_ipg 119 gpt_ipg_per 120 gpu2d_core 121 @@ -238,6 +238,8 @@ clocks and IDs. spdif1 225 asrc_ipg 226 asrc_mem 227 + esai_ipg 228 + esai_mem 229 Examples: diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi index 32c2e67cca63..9cdd0d3710b8 100644 --- a/arch/arm/boot/dts/imx6qdl.dtsi +++ b/arch/arm/boot/dts/imx6qdl.dtsi @@ -249,8 +249,8 @@ compatible = "fsl,imx6q-esai"; reg = <0x02024000 0x4000>; interrupts = <0 51 0x04>; - clocks = <&clks 118>, <&clks 156>; - clock-names = "core", "dma"; + clocks = <&clks 228>, <&clks 229>, <&clks 118>, <&clks 228>, <&clks 156>; + clock-names = "core", "mem", "extal", "fsys", "dma"; fsl,esai-dma-events = <24 23>; fsl,flags = <1>; status = "disabled"; diff --git a/arch/arm/boot/dts/imx6sx-19x19-arm2.dts b/arch/arm/boot/dts/imx6sx-19x19-arm2.dts index e7abb2a78ab7..901b469ee508 100644 --- a/arch/arm/boot/dts/imx6sx-19x19-arm2.dts +++ b/arch/arm/boot/dts/imx6sx-19x19-arm2.dts @@ -300,8 +300,8 @@ cs42888: cs42888@048 { compatible = "cirrus,cs42888"; reg = <0x048>; - clocks = <&clks IMX6SX_CLK_ESAI>; - clock-names = "esai"; + clocks = <&clks IMX6SX_CLK_ESAI_EXTAL>; + clock-names = "esai_extal"; VA-supply = <®_3p3v>; VD-supply = <®_3p3v>; VLS-supply = <®_3p3v>; diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi index 46a65cc9d258..9d04725f07d4 100644 --- a/arch/arm/boot/dts/imx6sx.dtsi +++ b/arch/arm/boot/dts/imx6sx.dtsi @@ -247,8 +247,12 @@ compatible = "fsl,imx6q-esai"; reg = <0x02024000 0x4000>; interrupts = <0 51 0x04>; - clocks = <&clks IMX6SX_CLK_ESAI>, <&clks IMX6SX_CLK_SPBA>; - clock-names = "core", "dma"; + clocks = <&clks IMX6SX_CLK_ESAI_IPG>, + <&clks IMX6SX_CLK_ESAI_MEM>, + <&clks IMX6SX_CLK_ESAI_EXTAL>, + <&clks IMX6SX_CLK_ESAI_IPG>, + <&clks IMX6SX_CLK_SPBA>; + clock-names = "core", "mem", "extal", "fsys", "dma"; fsl,esai-dma-events = <24 23>; fsl,flags = <1>; status = "disabled"; diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c index 77d425c4a3a5..6aaaee22805c 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c @@ -67,7 +67,7 @@ static const char *cko2_sels[] = { "ipu2", "vdo_axi", "osc", "gpu2d_core", "gpu3d_core", "usdhc2", "ssi1", "ssi2", "ssi3", "gpu3d_shader", "vpu_axi", "can_root", - "ldb_di0", "ldb_di1", "esai", "eim_slow", + "ldb_di0", "ldb_di1", "esai_extal", "eim_slow", "uart_serial", "spdif", "spdif1", "hsi_tx", }; static const char *cko_sels[] = { "cko1", "cko2", }; @@ -77,6 +77,7 @@ static const char *pll_av_sels[] = { "osc", "lvds1_in", "lvds2_in", "dummy", }; static void __iomem *anatop_base; static void __iomem *ccm_base; +static u32 share_count_esai; enum mx6q_clks { dummy, ckil, ckih, osc, pll2_pfd0_352m, pll2_pfd1_594m, pll2_pfd2_396m, @@ -100,7 +101,7 @@ enum mx6q_clks { emi_podf, emi_slow_podf, vpu_axi_podf, cko1_podf, axi, mmdc_ch0_axi_podf, mmdc_ch1_axi_podf, arm, ahb, apbh_dma, asrc_gate, can1_ipg, can1_serial, can2_ipg, can2_serial, ecspi1, ecspi2, ecspi3, ecspi4, ecspi5, enet, - esai, gpt_ipg, gpt_ipg_per, gpu2d_core, gpu3d_core, hdmi_iahb, + esai_extal, gpt_ipg, gpt_ipg_per, gpu2d_core, gpu3d_core, hdmi_iahb, hdmi_isfr, i2c1, i2c2, i2c3, iim, enfc, ipu1, ipu1_di0, ipu1_di1, ipu2, ipu2_di0, ldb_di0, ldb_di1, ipu2_di1, hsi_tx, mlb, mmdc_ch0_axi, mmdc_ch1_axi, ocram, openvg_axi, pcie_axi, pwm1, pwm2, pwm3, pwm4, per1_bch, @@ -115,7 +116,7 @@ enum mx6q_clks { ldb_di0_div_7, ldb_di1_div_7, ldb_di0_div_sel, ldb_di1_div_sel, pll4_audio_div, lvds1_sel, lvds1_in, lvds1_out, caam_mem, caam_aclk, caam_ipg, epit1, epit2, tzasc2, pll4_sel, lvds2_sel, lvds2_in, lvds2_out, - anaclk1, anaclk2, spdif1, asrc_ipg, asrc_mem, clk_max + anaclk1, anaclk2, spdif1, asrc_ipg, asrc_mem, esai_ipg, esai_mem, clk_max }; static struct clk *clk[clk_max]; @@ -484,7 +485,9 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) clk[enet] = imx_clk_gate2("enet", "ipg", base + 0x6c, 10); clk[epit1] = imx_clk_gate2("epit1", "ipg", base + 0x6c, 12); clk[epit2] = imx_clk_gate2("epit2", "ipg", base + 0x6c, 14); - clk[esai] = imx_clk_gate2("esai", "esai_podf", base + 0x6c, 16); + clk[esai_extal] = imx_clk_gate2_shared("esai_extal", "esai_podf", base + 0x6c, 16, &share_count_esai); + clk[esai_ipg] = imx_clk_gate2_shared("esai_ipg", "ipg", base + 0x6c, 16, &share_count_esai); + clk[esai_mem] = imx_clk_gate2_shared("esai_mem", "ahb", base + 0x6c, 16, &share_count_esai); clk[gpt_ipg] = imx_clk_gate2("gpt_ipg", "ipg", base + 0x6c, 20); clk[gpt_ipg_per] = imx_clk_gate2("gpt_ipg_per", "ipg_per", base + 0x6c, 22); if (cpu_is_imx6dl()) @@ -623,7 +626,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) clk_register_clkdev(clk[pll4_audio_div], "pll4_audio_div", NULL); clk_register_clkdev(clk[pll4_sel], "pll4_sel", NULL); clk_register_clkdev(clk[lvds2_in], "lvds2_in", NULL); - clk_register_clkdev(clk[esai], "esai", NULL); + clk_register_clkdev(clk[esai_extal], "esai_extal", NULL); /* * The gpmi needs 100MHz frequency in the EDO/Sync mode, diff --git a/arch/arm/mach-imx/clk-imx6sx.c b/arch/arm/mach-imx/clk-imx6sx.c index 6c8a7506abf3..ff43bb706280 100644 --- a/arch/arm/mach-imx/clk-imx6sx.c +++ b/arch/arm/mach-imx/clk-imx6sx.c @@ -72,7 +72,7 @@ static const char *cko2_sels[] = { "ecspi_root", "dummy", "usdhc3", "pcie", "arm", "csi_core", "lcdif_axi", "dummy", "osc", "dummy", "gpu2d_ovg_core", "usdhc2", "ssi1", "ssi2", "ssi3", "gpu2d_core", "dummy", - "dummy", "dummy", "dummy", "esai", "eim_slow", "uart_serial", + "dummy", "dummy", "dummy", "esai_extal", "eim_slow", "uart_serial", "spdif", "asrc", "dummy", }; static const char *cko_sels[] = { "cko1", "cko2", }; @@ -121,6 +121,7 @@ static struct clk_div_table video_div_table[] = { static u32 share_count_asrc; static u32 share_count_audio; +static u32 share_count_esai; static void __init imx6sx_clocks_init(struct device_node *ccm_node) { @@ -347,7 +348,9 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node) clks[IMX6SX_CLK_ECSPI5] = imx_clk_gate2("ecspi5", "ecspi_podf", base + 0x6c, 8); clks[IMX6SX_CLK_EPIT1] = imx_clk_gate2("epit1", "perclk", base + 0x6c, 12); clks[IMX6SX_CLK_EPIT2] = imx_clk_gate2("epit2", "perclk", base + 0x6c, 14); - clks[IMX6SX_CLK_ESAI] = imx_clk_gate2("esai", "esai_podf", base + 0x6c, 16); + clks[IMX6SX_CLK_ESAI_EXTAL] = imx_clk_gate2_shared("esai_extal", "esai_podf", base + 0x6c, 16, &share_count_esai); + clks[IMX6SX_CLK_ESAI_IPG] = imx_clk_gate2_shared("esai_ipg", "ahb", base + 0x6c, 16, &share_count_esai); + clks[IMX6SX_CLK_ESAI_MEM] = imx_clk_gate2_shared("esai_mem", "ahb", base + 0x6c, 16, &share_count_esai); clks[IMX6SX_CLK_WAKEUP] = imx_clk_gate2("wakeup", "ipg", base + 0x6c, 18); clks[IMX6SX_CLK_GPT_BUS] = imx_clk_gate2("gpt_bus", "perclk", base + 0x6c, 20); clks[IMX6SX_CLK_GPT_SERIAL] = imx_clk_gate2("gpt_serial", "perclk", base + 0x6c, 22); diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index aafec45babab..7ff96e7565aa 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -421,14 +421,14 @@ put_node: static void __init imx6q_audio_lvds2_init(void) { - struct clk *pll4_sel, *lvds2_in, *pll4_audio_div, *esai; + struct clk *pll4_sel, *lvds2_in, *pll4_audio_div, *esai_extal; pll4_audio_div = clk_get_sys(NULL, "pll4_audio_div"); pll4_sel = clk_get_sys(NULL, "pll4_sel"); lvds2_in = clk_get_sys(NULL, "lvds2_in"); - esai = clk_get_sys(NULL, "esai"); + esai_extal = clk_get_sys(NULL, "esai_extal"); if (IS_ERR(pll4_audio_div) || IS_ERR(pll4_sel) || - IS_ERR(lvds2_in) || IS_ERR(esai)) + IS_ERR(lvds2_in) || IS_ERR(esai_extal)) return; if (clk_get_rate(lvds2_in) != ESAI_AUDIO_MCLK) @@ -436,7 +436,7 @@ static void __init imx6q_audio_lvds2_init(void) clk_set_parent(pll4_sel, lvds2_in); clk_set_rate(pll4_audio_div, 786432000); - clk_set_rate(esai, ESAI_AUDIO_MCLK); + clk_set_rate(esai_extal, ESAI_AUDIO_MCLK); } static struct platform_device imx6q_cpufreq_pdev = { diff --git a/include/dt-bindings/clock/imx6sx-clock.h b/include/dt-bindings/clock/imx6sx-clock.h index 0cc658b7e436..421d8bb76f2f 100644 --- a/include/dt-bindings/clock/imx6sx-clock.h +++ b/include/dt-bindings/clock/imx6sx-clock.h @@ -162,7 +162,7 @@ #define IMX6SX_CLK_ECSPI5 149 #define IMX6SX_CLK_EPIT1 150 #define IMX6SX_CLK_EPIT2 151 -#define IMX6SX_CLK_ESAI 152 +#define IMX6SX_CLK_ESAI_EXTAL 152 #define IMX6SX_CLK_WAKEUP 153 #define IMX6SX_CLK_GPT_BUS 154 #define IMX6SX_CLK_GPT_SERIAL 155 @@ -249,6 +249,8 @@ #define IMX6SX_CLK_ASRC_MEM 236 #define IMX6SX_CLK_SAI1_IPG 237 #define IMX6SX_CLK_SAI2_IPG 238 -#define IMX6SX_CLK_CLK_END 239 +#define IMX6SX_CLK_ESAI_IPG 239 +#define IMX6SX_CLK_ESAI_MEM 240 +#define IMX6SX_CLK_CLK_END 241 #endif /* __DT_BINDINGS_CLOCK_IMX6SX_H */ diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c index 762ac316fa32..0f9282cc5acf 100644 --- a/sound/soc/fsl/fsl_esai.c +++ b/sound/soc/fsl/fsl_esai.c @@ -314,6 +314,7 @@ static int fsl_esai_startup(struct snd_pcm_substream *substream, clk_enable(esai->clk); clk_prepare_enable(esai->dmaclk); + clk_prepare_enable(esai->extalclk); esai->substream[substream->stream] = substream; @@ -474,6 +475,7 @@ static void fsl_esai_shutdown(struct snd_pcm_substream *substream, esai->substream[substream->stream] = NULL; + clk_disable_unprepare(esai->extalclk); clk_disable_unprepare(esai->dmaclk); clk_disable(esai->clk); } @@ -774,6 +776,13 @@ static int fsl_esai_probe(struct platform_device *pdev) goto failed_get_resource; } + esai->extalclk = devm_clk_get(&pdev->dev, "extal"); + if (IS_ERR(esai->extalclk)) { + ret = PTR_ERR(esai->extalclk); + dev_err(&pdev->dev, "Cannot get extal clock: %d\n", ret); + goto failed_get_resource; + } + ret = of_address_to_resource(np, 0, &res); if (ret) { dev_err(&pdev->dev, "could not determine device resources\n"); diff --git a/sound/soc/fsl/fsl_esai.h b/sound/soc/fsl/fsl_esai.h index daf080641277..b2551c530782 100644 --- a/sound/soc/fsl/fsl_esai.h +++ b/sound/soc/fsl/fsl_esai.h @@ -320,6 +320,7 @@ struct fsl_esai { struct clk *clk; struct clk *dmaclk; + struct clk *extalclk; void __iomem *base; int irq; unsigned int flags; |