Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: qcom: dispcc-sm8450: fix DisplayPort clocks

On SM8450 DisplayPort link clocks use frequency tables inherited from
the vendor kernel, it is not applicable in the upstream kernel. Drop
frequency tables and use clk_byte2_ops for those clocks.

This fixes frequency selection in the OPP core (which otherwise attempts
to use invalid 810 KHz as DP link rate), also fixing the following
message:
msm-dp-display ae90000.displayport-controller: _opp_config_clk_single: failed to set clock rate: -22

Fixes: 16fb89f92ec4 ("clk: qcom: Add support for Display Clock Controller on SM8450")
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20240424-dispcc-dp-clocks-v2-1-b44038f3fa96@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>

authored by

Dmitry Baryshkov and committed by
Bjorn Andersson
e801038a f3574392

+4 -16
+4 -16
drivers/clk/qcom/dispcc-sm8450.c
··· 309 309 }, 310 310 }; 311 311 312 - static const struct freq_tbl ftbl_disp_cc_mdss_dptx0_link_clk_src[] = { 313 - F(162000, P_DP0_PHY_PLL_LINK_CLK, 1, 0, 0), 314 - F(270000, P_DP0_PHY_PLL_LINK_CLK, 1, 0, 0), 315 - F(540000, P_DP0_PHY_PLL_LINK_CLK, 1, 0, 0), 316 - F(810000, P_DP0_PHY_PLL_LINK_CLK, 1, 0, 0), 317 - { } 318 - }; 319 - 320 312 static struct clk_rcg2 disp_cc_mdss_dptx0_link_clk_src = { 321 313 .cmd_rcgr = 0x819c, 322 314 .mnd_width = 0, 323 315 .hid_width = 5, 324 316 .parent_map = disp_cc_parent_map_3, 325 - .freq_tbl = ftbl_disp_cc_mdss_dptx0_link_clk_src, 326 317 .clkr.hw.init = &(struct clk_init_data) { 327 318 .name = "disp_cc_mdss_dptx0_link_clk_src", 328 319 .parent_data = disp_cc_parent_data_3, 329 320 .num_parents = ARRAY_SIZE(disp_cc_parent_data_3), 330 321 .flags = CLK_SET_RATE_PARENT, 331 - .ops = &clk_rcg2_ops, 322 + .ops = &clk_byte2_ops, 332 323 }, 333 324 }; 334 325 ··· 373 382 .mnd_width = 0, 374 383 .hid_width = 5, 375 384 .parent_map = disp_cc_parent_map_3, 376 - .freq_tbl = ftbl_disp_cc_mdss_dptx0_link_clk_src, 377 385 .clkr.hw.init = &(struct clk_init_data) { 378 386 .name = "disp_cc_mdss_dptx1_link_clk_src", 379 387 .parent_data = disp_cc_parent_data_3, 380 388 .num_parents = ARRAY_SIZE(disp_cc_parent_data_3), 381 389 .flags = CLK_SET_RATE_PARENT, 382 - .ops = &clk_rcg2_ops, 390 + .ops = &clk_byte2_ops, 383 391 }, 384 392 }; 385 393 ··· 432 442 .mnd_width = 0, 433 443 .hid_width = 5, 434 444 .parent_map = disp_cc_parent_map_3, 435 - .freq_tbl = ftbl_disp_cc_mdss_dptx0_link_clk_src, 436 445 .clkr.hw.init = &(struct clk_init_data) { 437 446 .name = "disp_cc_mdss_dptx2_link_clk_src", 438 447 .parent_data = disp_cc_parent_data_3, 439 448 .num_parents = ARRAY_SIZE(disp_cc_parent_data_3), 440 449 .flags = CLK_SET_RATE_PARENT, 441 - .ops = &clk_rcg2_ops, 450 + .ops = &clk_byte2_ops, 442 451 }, 443 452 }; 444 453 ··· 491 502 .mnd_width = 0, 492 503 .hid_width = 5, 493 504 .parent_map = disp_cc_parent_map_3, 494 - .freq_tbl = ftbl_disp_cc_mdss_dptx0_link_clk_src, 495 505 .clkr.hw.init = &(struct clk_init_data) { 496 506 .name = "disp_cc_mdss_dptx3_link_clk_src", 497 507 .parent_data = disp_cc_parent_data_3, 498 508 .num_parents = ARRAY_SIZE(disp_cc_parent_data_3), 499 509 .flags = CLK_SET_RATE_PARENT, 500 - .ops = &clk_rcg2_ops, 510 + .ops = &clk_byte2_ops, 501 511 }, 502 512 }; 503 513