aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x/patches-5.10/097-3-clk-qcom-krait-add-missing-enable-disable.patch
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2021-03-01 01:03:55 +0100
committerPetr Štetiar <ynezz@true.cz>2021-05-07 07:05:16 +0200
commitcde218d14b118e76099b0b0af992b3d3126c8035 (patch)
tree13d65c4cbec994ef25c5d8e80a4b6ba34a2f2cd5 /target/linux/ipq806x/patches-5.10/097-3-clk-qcom-krait-add-missing-enable-disable.patch
parent96f10c9d7a88717e84782449122b958e5a15eddd (diff)
downloadupstream-cde218d14b118e76099b0b0af992b3d3126c8035.tar.gz
upstream-cde218d14b118e76099b0b0af992b3d3126c8035.tar.bz2
upstream-cde218d14b118e76099b0b0af992b3d3126c8035.zip
ipq806x: fix missing clk and reset
Patch 0030 wrongly disables gsbi1 instead of gsbi4. Fix the wrong patch and also include other fix from the original qsdk source. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Diffstat (limited to 'target/linux/ipq806x/patches-5.10/097-3-clk-qcom-krait-add-missing-enable-disable.patch')
-rw-r--r--target/linux/ipq806x/patches-5.10/097-3-clk-qcom-krait-add-missing-enable-disable.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/target/linux/ipq806x/patches-5.10/097-3-clk-qcom-krait-add-missing-enable-disable.patch b/target/linux/ipq806x/patches-5.10/097-3-clk-qcom-krait-add-missing-enable-disable.patch
new file mode 100644
index 0000000000..777c54c83a
--- /dev/null
+++ b/target/linux/ipq806x/patches-5.10/097-3-clk-qcom-krait-add-missing-enable-disable.patch
@@ -0,0 +1,62 @@
+From f8fdbecdaca97f0f2eebd77256e2eca4a8da6c39 Mon Sep 17 00:00:00 2001
+From: Ansuel Smith <ansuelsmth@gmail.com>
+Date: Sun, 7 Feb 2021 17:08:16 +0100
+Subject: [PATCH 3/4] clk: qcom: krait: add missing enable disable
+
+Add missing enable disable mux function. Add extra check to
+div2_round_rate.
+
+Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
+---
+ drivers/clk/qcom/clk-krait.c | 27 +++++++++++++++++++++++++--
+ 1 file changed, 25 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/clk/qcom/clk-krait.c b/drivers/clk/qcom/clk-krait.c
+index 59f1af415b58..ba796b621669 100644
+--- a/drivers/clk/qcom/clk-krait.c
++++ b/drivers/clk/qcom/clk-krait.c
+@@ -68,7 +68,25 @@ static u8 krait_mux_get_parent(struct clk_hw *hw)
+ return clk_mux_val_to_index(hw, mux->parent_map, 0, sel);
+ }
+
++static int krait_mux_enable(struct clk_hw *hw)
++{
++ struct krait_mux_clk *mux = to_krait_mux_clk(hw);
++
++ __krait_mux_set_sel(mux, mux->en_mask);
++
++ return 0;
++}
++
++static void krait_mux_disable(struct clk_hw *hw)
++{
++ struct krait_mux_clk *mux = to_krait_mux_clk(hw);
++
++ __krait_mux_set_sel(mux, mux->safe_sel);
++}
++
+ const struct clk_ops krait_mux_clk_ops = {
++ .enable = krait_mux_enable,
++ .disable = krait_mux_disable,
+ .set_parent = krait_mux_set_parent,
+ .get_parent = krait_mux_get_parent,
+ .determine_rate = __clk_mux_determine_rate_closest,
+@@ -79,8 +97,13 @@ EXPORT_SYMBOL_GPL(krait_mux_clk_ops);
+ static long krait_div2_round_rate(struct clk_hw *hw, unsigned long rate,
+ unsigned long *parent_rate)
+ {
+- *parent_rate = clk_hw_round_rate(clk_hw_get_parent(hw), rate * 2);
+- return DIV_ROUND_UP(*parent_rate, 2);
++ struct clk_hw *hw_parent = clk_hw_get_parent(hw);
++
++ if (hw_parent) {
++ *parent_rate = clk_hw_round_rate(hw_parent, rate * 2);
++ return DIV_ROUND_UP(*parent_rate, 2);
++ } else
++ return -1;
+ }
+
+ static int krait_div2_set_rate(struct clk_hw *hw, unsigned long rate,
+--
+2.29.2
+