clk: qcom: regmap-mux: fix parent clock lookup
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Mon, 15 Nov 2021 23:34:07 +0000 (02:34 +0300)
committerStephen Boyd <sboyd@kernel.org>
Thu, 2 Dec 2021 23:07:34 +0000 (15:07 -0800)
commit9a61f813fcc8d56d85fcf9ca6119cf2b5ac91dd5
treeb809b13057cdc6ae85ab5f23e3c74e6dec594b73
parentfa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf
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>
drivers/clk/qcom/clk-regmap-mux.c
drivers/clk/qcom/common.c
drivers/clk/qcom/common.h