summaryrefslogtreecommitdiffstats
path: root/drivers/clk/qcom/common.h
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>2021-11-16 00:34:07 +0100
committerStephen Boyd <sboyd@kernel.org>2021-12-03 00:07:34 +0100
commit9a61f813fcc8d56d85fcf9ca6119cf2b5ac91dd5 (patch)
treeb809b13057cdc6ae85ab5f23e3c74e6dec594b73 /drivers/clk/qcom/common.h
parentLinux 5.16-rc1 (diff)
downloadlinux-9a61f813fcc8d56d85fcf9ca6119cf2b5ac91dd5.tar.xz
linux-9a61f813fcc8d56d85fcf9ca6119cf2b5ac91dd5.zip
clk: qcom: regmap-mux: fix parent clock lookup
The function mux_get_parent() uses qcom_find_src_index() to find the parent clock index, which is incorrect: qcom_find_src_index() uses src enum for the lookup, while mux_get_parent() should use cfg field (which corresponds to the register value). Add qcom_find_cfg_index() function doing this kind of lookup and use it for mux parent lookup. Fixes: df964016490b ("clk: qcom: add parent map for regmap mux") Cc: stable@vger.kernel.org Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20211115233407.1046179-1-dmitry.baryshkov@linaro.org Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/qcom/common.h')
-rw-r--r--drivers/clk/qcom/common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/clk/qcom/common.h b/drivers/clk/qcom/common.h
index bb39a7e106d8..9c8f7b798d9f 100644
--- a/drivers/clk/qcom/common.h
+++ b/drivers/clk/qcom/common.h
@@ -49,6 +49,8 @@ extern void
qcom_pll_set_fsm_mode(struct regmap *m, u32 reg, u8 bias_count, u8 lock_count);
extern int qcom_find_src_index(struct clk_hw *hw, const struct parent_map *map,
u8 src);
+extern int qcom_find_cfg_index(struct clk_hw *hw, const struct parent_map *map,
+ u8 cfg);
extern int qcom_cc_register_board_clk(struct device *dev, const char *path,
const char *name, unsigned long rate);