Skip to content

Commit dbaf381

Browse files
Shengjiu WangShawn Guo
authored andcommitted
ARM: clk-imx6sl: refine clock tree for SSI
Each SSI has "ssi", "ssi_ipg" clocks, and they share same gate bits. Signed-off-by: Shengjiu Wang <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
1 parent dc4805c commit dbaf381

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

arch/arm/mach-imx/clk-imx6sl.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ static struct clk_div_table video_div_table[] = {
9595
{ }
9696
};
9797

98+
static unsigned int share_count_ssi1;
99+
static unsigned int share_count_ssi2;
100+
static unsigned int share_count_ssi3;
101+
98102
static struct clk *clks[IMX6SL_CLK_END];
99103
static struct clk_onecell_data clk_data;
100104
static void __iomem *ccm_base;
@@ -392,9 +396,12 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
392396
clks[IMX6SL_CLK_SDMA] = imx_clk_gate2("sdma", "ipg", base + 0x7c, 6);
393397
clks[IMX6SL_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
394398
clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2("spdif", "spdif0_podf", base + 0x7c, 14);
395-
clks[IMX6SL_CLK_SSI1] = imx_clk_gate2("ssi1", "ssi1_podf", base + 0x7c, 18);
396-
clks[IMX6SL_CLK_SSI2] = imx_clk_gate2("ssi2", "ssi2_podf", base + 0x7c, 20);
397-
clks[IMX6SL_CLK_SSI3] = imx_clk_gate2("ssi3", "ssi3_podf", base + 0x7c, 22);
399+
clks[IMX6SL_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
400+
clks[IMX6SL_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
401+
clks[IMX6SL_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
402+
clks[IMX6SL_CLK_SSI1] = imx_clk_gate2_shared("ssi1", "ssi1_podf", base + 0x7c, 18, &share_count_ssi1);
403+
clks[IMX6SL_CLK_SSI2] = imx_clk_gate2_shared("ssi2", "ssi2_podf", base + 0x7c, 20, &share_count_ssi2);
404+
clks[IMX6SL_CLK_SSI3] = imx_clk_gate2_shared("ssi3", "ssi3_podf", base + 0x7c, 22, &share_count_ssi3);
398405
clks[IMX6SL_CLK_UART] = imx_clk_gate2("uart", "ipg", base + 0x7c, 24);
399406
clks[IMX6SL_CLK_UART_SERIAL] = imx_clk_gate2("uart_serial", "uart_root", base + 0x7c, 26);
400407
clks[IMX6SL_CLK_USBOH3] = imx_clk_gate2("usboh3", "ipg", base + 0x80, 0);

include/dt-bindings/clock/imx6sl-clock.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@
171171
#define IMX6SL_PLL5_BYPASS 158
172172
#define IMX6SL_PLL6_BYPASS 159
173173
#define IMX6SL_PLL7_BYPASS 160
174-
#define IMX6SL_CLK_END 161
174+
#define IMX6SL_CLK_SSI1_IPG 161
175+
#define IMX6SL_CLK_SSI2_IPG 162
176+
#define IMX6SL_CLK_SSI3_IPG 163
177+
#define IMX6SL_CLK_END 164
175178

176179
#endif /* __DT_BINDINGS_CLOCK_IMX6SL_H */

0 commit comments

Comments
 (0)