1 From 18ae57b1e8abee6c453381470f6e18991d2901a8 Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Wed, 9 Nov 2022 01:56:28 +0100
4 Subject: [PATCH 3/6] clk: qcom: krait-cc: also enable secondary mux and div
7 clk-krait ignore any rate change if clk is not flagged as enabled.
8 Correctly enable the secondary mux and div clk to correctly change rate
9 instead of silently ignoring the request.
11 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
12 Signed-off-by: Bjorn Andersson <andersson@kernel.org>
13 Link: https://lore.kernel.org/r/20221109005631.3189-2-ansuelsmth@gmail.com
15 drivers/clk/qcom/krait-cc.c | 21 ++++++++++++++++++++-
16 1 file changed, 20 insertions(+), 1 deletion(-)
18 --- a/drivers/clk/qcom/krait-cc.c
19 +++ b/drivers/clk/qcom/krait-cc.c
20 @@ -80,6 +80,7 @@ krait_add_div(struct device *dev, int id
22 const char *p_names[1];
26 div = devm_kzalloc(dev, sizeof(*div), GFP_KERNEL);
28 @@ -103,6 +104,17 @@ krait_add_div(struct device *dev, int id
31 clk = devm_clk_register(dev, &div->hw);
35 + /* clk-krait ignore any rate change if mux is not flagged as enabled */
37 + for_each_online_cpu(cpu)
38 + clk_prepare_enable(div->hw.clk);
40 + clk_prepare_enable(div->hw.clk);
46 @@ -113,7 +125,7 @@ static int
47 krait_add_sec_mux(struct device *dev, int id, const char *s,
48 unsigned int offset, bool unique_aux)
52 struct krait_mux_clk *mux;
53 static const char *sec_mux_list[] = {
55 @@ -165,6 +177,13 @@ krait_add_sec_mux(struct device *dev, in
59 + /* clk-krait ignore any rate change if mux is not flagged as enabled */
61 + for_each_online_cpu(cpu)
62 + clk_prepare_enable(mux->hw.clk);
64 + clk_prepare_enable(mux->hw.clk);
68 kfree(sec_mux_list[0]);