Commit 18ae57b1 authored by Christian Marangi's avatar Christian Marangi Committed by Bjorn Andersson

clk: qcom: krait-cc: also enable secondary mux and div clk

clk-krait ignore any rate change if clk is not flagged as enabled.
Correctly enable the secondary mux and div clk to correctly change rate
instead of silently ignoring the request.
Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
Signed-off-by: default avatarBjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20221109005631.3189-2-ansuelsmth@gmail.com
parent 8e456411
...@@ -80,6 +80,7 @@ krait_add_div(struct device *dev, int id, const char *s, unsigned int offset) ...@@ -80,6 +80,7 @@ krait_add_div(struct device *dev, int id, const char *s, unsigned int offset)
}; };
const char *p_names[1]; const char *p_names[1];
struct clk *clk; struct clk *clk;
int cpu;
div = devm_kzalloc(dev, sizeof(*div), GFP_KERNEL); div = devm_kzalloc(dev, sizeof(*div), GFP_KERNEL);
if (!div) if (!div)
...@@ -103,6 +104,17 @@ krait_add_div(struct device *dev, int id, const char *s, unsigned int offset) ...@@ -103,6 +104,17 @@ krait_add_div(struct device *dev, int id, const char *s, unsigned int offset)
} }
clk = devm_clk_register(dev, &div->hw); clk = devm_clk_register(dev, &div->hw);
if (IS_ERR(clk))
goto err;
/* clk-krait ignore any rate change if mux is not flagged as enabled */
if (id < 0)
for_each_online_cpu(cpu)
clk_prepare_enable(div->hw.clk);
else
clk_prepare_enable(div->hw.clk);
err:
kfree(p_names[0]); kfree(p_names[0]);
kfree(init.name); kfree(init.name);
...@@ -113,7 +125,7 @@ static int ...@@ -113,7 +125,7 @@ static int
krait_add_sec_mux(struct device *dev, int id, const char *s, krait_add_sec_mux(struct device *dev, int id, const char *s,
unsigned int offset, bool unique_aux) unsigned int offset, bool unique_aux)
{ {
int ret; int cpu, ret;
struct krait_mux_clk *mux; struct krait_mux_clk *mux;
static const char *sec_mux_list[] = { static const char *sec_mux_list[] = {
"qsb", "qsb",
...@@ -165,6 +177,13 @@ krait_add_sec_mux(struct device *dev, int id, const char *s, ...@@ -165,6 +177,13 @@ krait_add_sec_mux(struct device *dev, int id, const char *s,
if (ret) if (ret)
goto unique_aux; goto unique_aux;
/* clk-krait ignore any rate change if mux is not flagged as enabled */
if (id < 0)
for_each_online_cpu(cpu)
clk_prepare_enable(mux->hw.clk);
else
clk_prepare_enable(mux->hw.clk);
unique_aux: unique_aux:
if (unique_aux) if (unique_aux)
kfree(sec_mux_list[0]); kfree(sec_mux_list[0]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment