Commit 50162433 authored by Konrad Dybcio's avatar Konrad Dybcio Committed by Bjorn Andersson
Browse files

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: default avatarKonrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: default avatarIskren Chernev <me@iskren.info>
Signed-off-by: default avatarBjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230601-topic-alpha_ctl-v1-1-b6a932dfcf68@linaro.org
parent 5ae78997
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -384,8 +384,19 @@ void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,

	regmap_update_bits(regmap, PLL_USER_CTL(pll), mask, val);

	if (config->test_ctl_mask)
		regmap_update_bits(regmap, PLL_TEST_CTL(pll),
				   config->test_ctl_mask,
				   config->test_ctl_val);
	else
		clk_alpha_pll_write_config(regmap, PLL_TEST_CTL(pll),
					   config->test_ctl_val);

	if (config->test_ctl_hi_mask)
		regmap_update_bits(regmap, PLL_TEST_CTL_U(pll),
				   config->test_ctl_hi_mask,
				   config->test_ctl_hi_val);
	else
		clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U(pll),
					   config->test_ctl_hi_val);

+2 −0
Original line number Diff line number Diff line
@@ -123,7 +123,9 @@ struct alpha_pll_config {
	u32 user_ctl_hi_val;
	u32 user_ctl_hi1_val;
	u32 test_ctl_val;
	u32 test_ctl_mask;
	u32 test_ctl_hi_val;
	u32 test_ctl_hi_mask;
	u32 test_ctl_hi1_val;
	u32 test_ctl_hi2_val;
	u32 main_output_mask;