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

clk: qcom: clk-alpha-pll: Add a way to update some bits of test_ctl(_hi)

The "vanilla" Alpha PLL configs are sometimes provided with an intention
to only update certain bits of th register.

Do so if a mask is found.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Iskren Chernev <me@iskren.info>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230601-topic-alpha_ctl-v1-1-b6a932dfcf68@linaro.org

authored by

Konrad Dybcio and committed by
Bjorn Andersson
50162433 5ae78997

+17 -4
+15 -4
drivers/clk/qcom/clk-alpha-pll.c
··· 384 384 385 385 regmap_update_bits(regmap, PLL_USER_CTL(pll), mask, val); 386 386 387 - clk_alpha_pll_write_config(regmap, PLL_TEST_CTL(pll), 388 - config->test_ctl_val); 389 - clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U(pll), 390 - config->test_ctl_hi_val); 387 + if (config->test_ctl_mask) 388 + regmap_update_bits(regmap, PLL_TEST_CTL(pll), 389 + config->test_ctl_mask, 390 + config->test_ctl_val); 391 + else 392 + clk_alpha_pll_write_config(regmap, PLL_TEST_CTL(pll), 393 + config->test_ctl_val); 394 + 395 + if (config->test_ctl_hi_mask) 396 + regmap_update_bits(regmap, PLL_TEST_CTL_U(pll), 397 + config->test_ctl_hi_mask, 398 + config->test_ctl_hi_val); 399 + else 400 + clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U(pll), 401 + config->test_ctl_hi_val); 391 402 392 403 if (pll->flags & SUPPORTS_FSM_MODE) 393 404 qcom_pll_set_fsm_mode(regmap, PLL_MODE(pll), 6, 0);
+2
drivers/clk/qcom/clk-alpha-pll.h
··· 123 123 u32 user_ctl_hi_val; 124 124 u32 user_ctl_hi1_val; 125 125 u32 test_ctl_val; 126 + u32 test_ctl_mask; 126 127 u32 test_ctl_hi_val; 128 + u32 test_ctl_hi_mask; 127 129 u32 test_ctl_hi1_val; 128 130 u32 test_ctl_hi2_val; 129 131 u32 main_output_mask;