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

clk: qcom: dispcc-sm8650: fix DisplayPort clocks

On SM8650 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 af54000.displayport-controller: _opp_config_clk_single: failed to set clock rate: -22

Fixes: 9e939f008338 ("clk: qcom: add the SM8650 Display Clock Controller driver")
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-HDK
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-4-b44038f3fa96@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>

authored by

Dmitry Baryshkov and committed by
Bjorn Andersson
615a292e e90b5139

+4 -16
+4 -16
drivers/clk/qcom/dispcc-sm8650.c
··· 343 343 }, 344 344 }; 345 345 346 - static const struct freq_tbl ftbl_disp_cc_mdss_dptx0_link_clk_src[] = { 347 - F(162000, P_DP0_PHY_PLL_LINK_CLK, 1, 0, 0), 348 - F(270000, P_DP0_PHY_PLL_LINK_CLK, 1, 0, 0), 349 - F(540000, P_DP0_PHY_PLL_LINK_CLK, 1, 0, 0), 350 - F(810000, P_DP0_PHY_PLL_LINK_CLK, 1, 0, 0), 351 - { } 352 - }; 353 - 354 346 static struct clk_rcg2 disp_cc_mdss_dptx0_link_clk_src = { 355 347 .cmd_rcgr = 0x8170, 356 348 .mnd_width = 0, 357 349 .hid_width = 5, 358 350 .parent_map = disp_cc_parent_map_7, 359 - .freq_tbl = ftbl_disp_cc_mdss_dptx0_link_clk_src, 360 351 .clkr.hw.init = &(const struct clk_init_data) { 361 352 .name = "disp_cc_mdss_dptx0_link_clk_src", 362 353 .parent_data = disp_cc_parent_data_7, 363 354 .num_parents = ARRAY_SIZE(disp_cc_parent_data_7), 364 355 .flags = CLK_SET_RATE_PARENT, 365 - .ops = &clk_rcg2_ops, 356 + .ops = &clk_byte2_ops, 366 357 }, 367 358 }; 368 359 ··· 407 416 .mnd_width = 0, 408 417 .hid_width = 5, 409 418 .parent_map = disp_cc_parent_map_3, 410 - .freq_tbl = ftbl_disp_cc_mdss_dptx0_link_clk_src, 411 419 .clkr.hw.init = &(const struct clk_init_data) { 412 420 .name = "disp_cc_mdss_dptx1_link_clk_src", 413 421 .parent_data = disp_cc_parent_data_3, 414 422 .num_parents = ARRAY_SIZE(disp_cc_parent_data_3), 415 423 .flags = CLK_SET_RATE_PARENT, 416 - .ops = &clk_rcg2_ops, 424 + .ops = &clk_byte2_ops, 417 425 }, 418 426 }; 419 427 ··· 466 476 .mnd_width = 0, 467 477 .hid_width = 5, 468 478 .parent_map = disp_cc_parent_map_3, 469 - .freq_tbl = ftbl_disp_cc_mdss_dptx0_link_clk_src, 470 479 .clkr.hw.init = &(const struct clk_init_data) { 471 480 .name = "disp_cc_mdss_dptx2_link_clk_src", 472 481 .parent_data = disp_cc_parent_data_3, 473 482 .num_parents = ARRAY_SIZE(disp_cc_parent_data_3), 474 483 .flags = CLK_SET_RATE_PARENT, 475 - .ops = &clk_rcg2_ops, 484 + .ops = &clk_byte2_ops, 476 485 }, 477 486 }; 478 487 ··· 525 536 .mnd_width = 0, 526 537 .hid_width = 5, 527 538 .parent_map = disp_cc_parent_map_3, 528 - .freq_tbl = ftbl_disp_cc_mdss_dptx0_link_clk_src, 529 539 .clkr.hw.init = &(const struct clk_init_data) { 530 540 .name = "disp_cc_mdss_dptx3_link_clk_src", 531 541 .parent_data = disp_cc_parent_data_3, 532 542 .num_parents = ARRAY_SIZE(disp_cc_parent_data_3), 533 543 .flags = CLK_SET_RATE_PARENT, 534 - .ops = &clk_rcg2_ops, 544 + .ops = &clk_byte2_ops, 535 545 }, 536 546 }; 537 547