Skip to content

Commit 1361d75

Browse files
Ondrej Jirmanmmind
authored andcommitted
clk: rockchip: rk3399: Allow to set rate of clk_i2s0_frac's parent
Otherwise when when clk_i2s0 muxes to clk_i2s0_div which requires setting high divider value on clk_i2s0_div, and then muxes back to clk_i2s0_frac, clk_i2s0_frac would have no way to change the clk_i2s0_div's divider ratio back to 1 so that it can satisfy the condition for m/n > 20 for fractional division to work correctly. Bug is reproducible by playing 44.1k audio, then 48k audio, and then 44.1k audio again. This results in clk_i2s0_div being set to 49 and clk_i2s0_frac not being able to cope with such a low input clock rate and audio playing extremely slowly. The identical issue is on i2s1 and i2s2 clocks, too. Signed-off-by: Ondrej Jirman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiko Stuebner <[email protected]>
1 parent dae3e57 commit 1361d75

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/clk/rockchip/clk-rk3399.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = {
597597
COMPOSITE(0, "clk_i2s0_div", mux_pll_src_cpll_gpll_p, 0,
598598
RK3399_CLKSEL_CON(28), 7, 1, MFLAGS, 0, 7, DFLAGS,
599599
RK3399_CLKGATE_CON(8), 3, GFLAGS),
600-
COMPOSITE_FRACMUX(0, "clk_i2s0_frac", "clk_i2s0_div", 0,
600+
COMPOSITE_FRACMUX(0, "clk_i2s0_frac", "clk_i2s0_div", CLK_SET_RATE_PARENT,
601601
RK3399_CLKSEL_CON(96), 0,
602602
RK3399_CLKGATE_CON(8), 4, GFLAGS,
603603
&rk3399_i2s0_fracmux),
@@ -607,7 +607,7 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = {
607607
COMPOSITE(0, "clk_i2s1_div", mux_pll_src_cpll_gpll_p, 0,
608608
RK3399_CLKSEL_CON(29), 7, 1, MFLAGS, 0, 7, DFLAGS,
609609
RK3399_CLKGATE_CON(8), 6, GFLAGS),
610-
COMPOSITE_FRACMUX(0, "clk_i2s1_frac", "clk_i2s1_div", 0,
610+
COMPOSITE_FRACMUX(0, "clk_i2s1_frac", "clk_i2s1_div", CLK_SET_RATE_PARENT,
611611
RK3399_CLKSEL_CON(97), 0,
612612
RK3399_CLKGATE_CON(8), 7, GFLAGS,
613613
&rk3399_i2s1_fracmux),
@@ -617,7 +617,7 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = {
617617
COMPOSITE(0, "clk_i2s2_div", mux_pll_src_cpll_gpll_p, 0,
618618
RK3399_CLKSEL_CON(30), 7, 1, MFLAGS, 0, 7, DFLAGS,
619619
RK3399_CLKGATE_CON(8), 9, GFLAGS),
620-
COMPOSITE_FRACMUX(0, "clk_i2s2_frac", "clk_i2s2_div", 0,
620+
COMPOSITE_FRACMUX(0, "clk_i2s2_frac", "clk_i2s2_div", CLK_SET_RATE_PARENT,
621621
RK3399_CLKSEL_CON(98), 0,
622622
RK3399_CLKGATE_CON(8), 10, GFLAGS,
623623
&rk3399_i2s2_fracmux),

0 commit comments

Comments
 (0)