Skip to content

Commit 328212d

Browse files
committed
Merge tag 'v5.18-rockchip-clk1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into clk-rockchip
Pull Rockchip clk driver updates from Heiko Stuebner: - Improve the clocks for the rk3568 display outputs (parenting, pll-rates) - Use of_device_get_match_data() instead of open-coding on rk3568 - Reintroduce the expected fractional-divider behaviour that disappeared with the addition of CLK_FRAC_DIVIDER_POWER_OF_TWO_PS * tag 'v5.18-rockchip-clk1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: clk: rockchip: re-add rational best approximation algorithm to the fractional divider clk/rockchip: Use of_device_get_match_data() clk: rockchip: Add CLK_SET_RATE_PARENT to the HDMI reference clock on rk3568 clk: rockchip: drop CLK_SET_RATE_PARENT from dclk_vop* on rk3568 clk: rockchip: Add more PLL rates for rk3568
2 parents e783362 + 10b74af commit 328212d

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

drivers/clk/rockchip/clk-rk3568.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,17 @@ static struct rockchip_pll_rate_table rk3568_pll_rates[] = {
7171
RK3036_PLL_RATE(500000000, 1, 125, 6, 1, 1, 0),
7272
RK3036_PLL_RATE(408000000, 1, 68, 2, 2, 1, 0),
7373
RK3036_PLL_RATE(312000000, 1, 78, 6, 1, 1, 0),
74+
RK3036_PLL_RATE(297000000, 2, 99, 4, 1, 1, 0),
75+
RK3036_PLL_RATE(241500000, 2, 161, 4, 2, 1, 0),
7476
RK3036_PLL_RATE(216000000, 1, 72, 4, 2, 1, 0),
7577
RK3036_PLL_RATE(200000000, 1, 100, 3, 4, 1, 0),
7678
RK3036_PLL_RATE(148500000, 1, 99, 4, 4, 1, 0),
79+
RK3036_PLL_RATE(135000000, 2, 45, 4, 1, 1, 0),
80+
RK3036_PLL_RATE(119000000, 3, 119, 4, 2, 1, 0),
81+
RK3036_PLL_RATE(108000000, 2, 45, 5, 1, 1, 0),
7782
RK3036_PLL_RATE(100000000, 1, 150, 6, 6, 1, 0),
7883
RK3036_PLL_RATE(96000000, 1, 96, 6, 4, 1, 0),
84+
RK3036_PLL_RATE(78750000, 1, 96, 6, 4, 1, 0),
7985
RK3036_PLL_RATE(74250000, 2, 99, 4, 4, 1, 0),
8086
{ /* sentinel */ },
8187
};
@@ -1038,13 +1044,13 @@ static struct rockchip_clk_branch rk3568_clk_branches[] __initdata = {
10381044
RK3568_CLKGATE_CON(20), 8, GFLAGS),
10391045
GATE(HCLK_VOP, "hclk_vop", "hclk_vo", 0,
10401046
RK3568_CLKGATE_CON(20), 9, GFLAGS),
1041-
COMPOSITE(DCLK_VOP0, "dclk_vop0", hpll_vpll_gpll_cpll_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
1047+
COMPOSITE(DCLK_VOP0, "dclk_vop0", hpll_vpll_gpll_cpll_p, CLK_SET_RATE_NO_REPARENT,
10421048
RK3568_CLKSEL_CON(39), 10, 2, MFLAGS, 0, 8, DFLAGS,
10431049
RK3568_CLKGATE_CON(20), 10, GFLAGS),
1044-
COMPOSITE(DCLK_VOP1, "dclk_vop1", hpll_vpll_gpll_cpll_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
1050+
COMPOSITE(DCLK_VOP1, "dclk_vop1", hpll_vpll_gpll_cpll_p, CLK_SET_RATE_NO_REPARENT,
10451051
RK3568_CLKSEL_CON(40), 10, 2, MFLAGS, 0, 8, DFLAGS,
10461052
RK3568_CLKGATE_CON(20), 11, GFLAGS),
1047-
COMPOSITE(DCLK_VOP2, "dclk_vop2", hpll_vpll_gpll_cpll_p, 0,
1053+
COMPOSITE(DCLK_VOP2, "dclk_vop2", hpll_vpll_gpll_cpll_p, CLK_SET_RATE_NO_REPARENT,
10481054
RK3568_CLKSEL_CON(41), 10, 2, MFLAGS, 0, 8, DFLAGS,
10491055
RK3568_CLKGATE_CON(20), 12, GFLAGS),
10501056
GATE(CLK_VOP_PWM, "clk_vop_pwm", "xin24m", 0,
@@ -1562,7 +1568,7 @@ static struct rockchip_clk_branch rk3568_clk_pmu_branches[] __initdata = {
15621568
RK3568_PMU_CLKGATE_CON(2), 14, GFLAGS),
15631569
GATE(XIN_OSC0_EDPPHY_G, "xin_osc0_edpphy_g", "xin24m", 0,
15641570
RK3568_PMU_CLKGATE_CON(2), 15, GFLAGS),
1565-
MUX(CLK_HDMI_REF, "clk_hdmi_ref", clk_hdmi_ref_p, 0,
1571+
MUX(CLK_HDMI_REF, "clk_hdmi_ref", clk_hdmi_ref_p, CLK_SET_RATE_PARENT,
15661572
RK3568_PMU_CLKSEL_CON(8), 7, 1, MFLAGS),
15671573
};
15681574

@@ -1697,14 +1703,12 @@ static const struct of_device_id clk_rk3568_match_table[] = {
16971703
static int __init clk_rk3568_probe(struct platform_device *pdev)
16981704
{
16991705
struct device_node *np = pdev->dev.of_node;
1700-
const struct of_device_id *match;
17011706
const struct clk_rk3568_inits *init_data;
17021707

1703-
match = of_match_device(clk_rk3568_match_table, &pdev->dev);
1704-
if (!match || !match->data)
1708+
init_data = (struct clk_rk3568_inits *)of_device_get_match_data(&pdev->dev);
1709+
if (!init_data)
17051710
return -EINVAL;
17061711

1707-
init_data = match->data;
17081712
if (init_data->inits)
17091713
init_data->inits(np);
17101714

drivers/clk/rockchip/clk.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ static void rockchip_fractional_approximation(struct clk_hw *hw,
180180
unsigned long rate, unsigned long *parent_rate,
181181
unsigned long *m, unsigned long *n)
182182
{
183+
struct clk_fractional_divider *fd = to_clk_fd(hw);
183184
unsigned long p_rate, p_parent_rate;
184185
struct clk_hw *p_parent;
185186

@@ -190,6 +191,8 @@ static void rockchip_fractional_approximation(struct clk_hw *hw,
190191
*parent_rate = p_parent_rate;
191192
}
192193

194+
fd->flags |= CLK_FRAC_DIVIDER_POWER_OF_TWO_PS;
195+
193196
clk_fractional_divider_general_approximation(hw, rate, parent_rate, m, n);
194197
}
195198

0 commit comments

Comments
 (0)