--- zzzz-none-000/linux-4.4.271/drivers/clk/qcom/clk-regmap-mux.c 2021-06-03 06:22:09.000000000 +0000 +++ dakota-7530ac-750/linux-4.4.271/drivers/clk/qcom/clk-regmap-mux.c 2023-01-11 09:25:41.000000000 +0000 @@ -27,14 +27,21 @@ { struct clk_regmap_mux *mux = to_clk_regmap_mux(hw); struct clk_regmap *clkr = to_clk_regmap(hw); + int num_parents = clk_hw_get_num_parents(hw); unsigned int mask = GENMASK(mux->width - 1, 0); - unsigned int val; + unsigned int val, i; regmap_read(clkr->regmap, mux->reg, &val); val >>= mux->shift; val &= mask; + if (mux->parent_map) { + for (i = 0; i < num_parents; i++) + if (val == mux->parent_map[i].cfg) + return i; + } + return val; } @@ -45,6 +52,9 @@ unsigned int mask = GENMASK(mux->width + mux->shift - 1, mux->shift); unsigned int val; + if (mux->parent_map) + index = mux->parent_map[index].cfg; + val = index; val <<= mux->shift;