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

clk: qcom: branch: Add clk_branch2_prepare_ops

Add the clk_branch2_prepare_ops for supporting clock controller
where the hardware register is accessed by MDIO bus, and the
spin lock can't be used because of sleep during the MDIO
operation.

The clock is enabled by the .prepare instead of .enable when
the clk_branch2_prepare_ops is used.

Acked-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Luo Jie <quic_luoj@quicinc.com>
Link: https://lore.kernel.org/r/20240605124541.2711467-2-quic_luoj@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>

authored by

Luo Jie and committed by
Bjorn Andersson
7311bbff 7e828d77

+8
+7
drivers/clk/qcom/clk-branch.c
··· 191 191 .is_enabled = clk_is_enabled_regmap, 192 192 }; 193 193 EXPORT_SYMBOL_GPL(clk_branch_simple_ops); 194 + 195 + const struct clk_ops clk_branch2_prepare_ops = { 196 + .prepare = clk_branch2_enable, 197 + .unprepare = clk_branch2_disable, 198 + .is_prepared = clk_is_enabled_regmap, 199 + }; 200 + EXPORT_SYMBOL_GPL(clk_branch2_prepare_ops);
+1
drivers/clk/qcom/clk-branch.h
··· 109 109 extern const struct clk_ops clk_branch_simple_ops; 110 110 extern const struct clk_ops clk_branch2_aon_ops; 111 111 extern const struct clk_ops clk_branch2_mem_ops; 112 + extern const struct clk_ops clk_branch2_prepare_ops; 112 113 113 114 #define to_clk_branch(_hw) \ 114 115 container_of(to_clk_regmap(_hw), struct clk_branch, clkr)