Improve the clocks for the rk3568 display outputs (parenting, pll-rates),
use of_device_get_match_data() instead of open-coding on rk3568 and reintroduce the expected fractional-divider behaviour that disappeared with the addition of CLK_FRAC_DIVIDER_POWER_OF_TWO_PS. -----BEGIN PGP SIGNATURE----- iQFEBAABCAAuFiEE7v+35S2Q1vLNA3Lx86Z5yZzRHYEFAmIX/6wQHGhlaWtvQHNu dGVjaC5kZQAKCRDzpnnJnNEdgQhMB/43sXKOWdXJF5SRjBlbvqH+OHw0oDL+20ob HLofUvvlMlEvPcndUYtaVMweEDCJllHiqhSQ8uPgYScR/8+xVLArY9OVTqTI88Qx lW9cDzcRrTSO8N/buAvEygqkyXQA5tG2fASKNGKAZ95YIOMU3gO/PTBcflbE0Iy0 8b1CvKrWuJp6PRla2YY1pePnV0eJFh/iP7Z9wZVBwf0YmzJ8dSmUVTyK7Q7SqnGQ /GxXisqRSMMgP1BH3HyDjXJyjSpfYNe3jPRtr+pIkWia+uLU8Zc7DRWFeObx6iTr 23Mg+ycrc5jzbeJYi5EwPuO3OLRXb7qR+v3nHRLNzXdjWEtw4NfK =gHrL -----END PGP SIGNATURE----- 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
This commit is contained in:
Коммит
328212de9f
|
@ -71,11 +71,17 @@ static struct rockchip_pll_rate_table rk3568_pll_rates[] = {
|
|||
RK3036_PLL_RATE(500000000, 1, 125, 6, 1, 1, 0),
|
||||
RK3036_PLL_RATE(408000000, 1, 68, 2, 2, 1, 0),
|
||||
RK3036_PLL_RATE(312000000, 1, 78, 6, 1, 1, 0),
|
||||
RK3036_PLL_RATE(297000000, 2, 99, 4, 1, 1, 0),
|
||||
RK3036_PLL_RATE(241500000, 2, 161, 4, 2, 1, 0),
|
||||
RK3036_PLL_RATE(216000000, 1, 72, 4, 2, 1, 0),
|
||||
RK3036_PLL_RATE(200000000, 1, 100, 3, 4, 1, 0),
|
||||
RK3036_PLL_RATE(148500000, 1, 99, 4, 4, 1, 0),
|
||||
RK3036_PLL_RATE(135000000, 2, 45, 4, 1, 1, 0),
|
||||
RK3036_PLL_RATE(119000000, 3, 119, 4, 2, 1, 0),
|
||||
RK3036_PLL_RATE(108000000, 2, 45, 5, 1, 1, 0),
|
||||
RK3036_PLL_RATE(100000000, 1, 150, 6, 6, 1, 0),
|
||||
RK3036_PLL_RATE(96000000, 1, 96, 6, 4, 1, 0),
|
||||
RK3036_PLL_RATE(78750000, 1, 96, 6, 4, 1, 0),
|
||||
RK3036_PLL_RATE(74250000, 2, 99, 4, 4, 1, 0),
|
||||
{ /* sentinel */ },
|
||||
};
|
||||
|
@ -1038,13 +1044,13 @@ static struct rockchip_clk_branch rk3568_clk_branches[] __initdata = {
|
|||
RK3568_CLKGATE_CON(20), 8, GFLAGS),
|
||||
GATE(HCLK_VOP, "hclk_vop", "hclk_vo", 0,
|
||||
RK3568_CLKGATE_CON(20), 9, GFLAGS),
|
||||
COMPOSITE(DCLK_VOP0, "dclk_vop0", hpll_vpll_gpll_cpll_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
|
||||
COMPOSITE(DCLK_VOP0, "dclk_vop0", hpll_vpll_gpll_cpll_p, CLK_SET_RATE_NO_REPARENT,
|
||||
RK3568_CLKSEL_CON(39), 10, 2, MFLAGS, 0, 8, DFLAGS,
|
||||
RK3568_CLKGATE_CON(20), 10, GFLAGS),
|
||||
COMPOSITE(DCLK_VOP1, "dclk_vop1", hpll_vpll_gpll_cpll_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
|
||||
COMPOSITE(DCLK_VOP1, "dclk_vop1", hpll_vpll_gpll_cpll_p, CLK_SET_RATE_NO_REPARENT,
|
||||
RK3568_CLKSEL_CON(40), 10, 2, MFLAGS, 0, 8, DFLAGS,
|
||||
RK3568_CLKGATE_CON(20), 11, GFLAGS),
|
||||
COMPOSITE(DCLK_VOP2, "dclk_vop2", hpll_vpll_gpll_cpll_p, 0,
|
||||
COMPOSITE(DCLK_VOP2, "dclk_vop2", hpll_vpll_gpll_cpll_p, CLK_SET_RATE_NO_REPARENT,
|
||||
RK3568_CLKSEL_CON(41), 10, 2, MFLAGS, 0, 8, DFLAGS,
|
||||
RK3568_CLKGATE_CON(20), 12, GFLAGS),
|
||||
GATE(CLK_VOP_PWM, "clk_vop_pwm", "xin24m", 0,
|
||||
|
@ -1562,7 +1568,7 @@ static struct rockchip_clk_branch rk3568_clk_pmu_branches[] __initdata = {
|
|||
RK3568_PMU_CLKGATE_CON(2), 14, GFLAGS),
|
||||
GATE(XIN_OSC0_EDPPHY_G, "xin_osc0_edpphy_g", "xin24m", 0,
|
||||
RK3568_PMU_CLKGATE_CON(2), 15, GFLAGS),
|
||||
MUX(CLK_HDMI_REF, "clk_hdmi_ref", clk_hdmi_ref_p, 0,
|
||||
MUX(CLK_HDMI_REF, "clk_hdmi_ref", clk_hdmi_ref_p, CLK_SET_RATE_PARENT,
|
||||
RK3568_PMU_CLKSEL_CON(8), 7, 1, MFLAGS),
|
||||
};
|
||||
|
||||
|
@ -1697,14 +1703,12 @@ static const struct of_device_id clk_rk3568_match_table[] = {
|
|||
static int __init clk_rk3568_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
const struct of_device_id *match;
|
||||
const struct clk_rk3568_inits *init_data;
|
||||
|
||||
match = of_match_device(clk_rk3568_match_table, &pdev->dev);
|
||||
if (!match || !match->data)
|
||||
init_data = (struct clk_rk3568_inits *)of_device_get_match_data(&pdev->dev);
|
||||
if (!init_data)
|
||||
return -EINVAL;
|
||||
|
||||
init_data = match->data;
|
||||
if (init_data->inits)
|
||||
init_data->inits(np);
|
||||
|
||||
|
|
|
@ -180,6 +180,7 @@ static void rockchip_fractional_approximation(struct clk_hw *hw,
|
|||
unsigned long rate, unsigned long *parent_rate,
|
||||
unsigned long *m, unsigned long *n)
|
||||
{
|
||||
struct clk_fractional_divider *fd = to_clk_fd(hw);
|
||||
unsigned long p_rate, p_parent_rate;
|
||||
struct clk_hw *p_parent;
|
||||
|
||||
|
@ -190,6 +191,8 @@ static void rockchip_fractional_approximation(struct clk_hw *hw,
|
|||
*parent_rate = p_parent_rate;
|
||||
}
|
||||
|
||||
fd->flags |= CLK_FRAC_DIVIDER_POWER_OF_TWO_PS;
|
||||
|
||||
clk_fractional_divider_general_approximation(hw, rate, parent_rate, m, n);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче