mirror of
https://github.com/hzyitc/openwrt-redmi-ax3000.git
synced 2025-12-16 16:31:57 +00:00
61 lines
2.2 KiB
Diff
61 lines
2.2 KiB
Diff
From 9bb1a40325c0c4b0489abf8f5dc5cc376ea5d677 Mon Sep 17 00:00:00 2001
|
|
From: Christian Marangi <ansuelsmth@gmail.com>
|
|
Date: Fri, 19 Aug 2022 00:06:20 +0200
|
|
Subject: [PATCH 08/11] clk: qcom: clk-rcg2: add rcg2 mux ops
|
|
|
|
An RCG may act as a mux that switch between 2 parents.
|
|
This is the case on IPQ6018 and IPQ8074 where the APCS core clk that feeds
|
|
the CPU cluster clock just switches between XO and the PLL that feeds it.
|
|
|
|
Add the required ops to add support for this special configuration and use
|
|
the generic mux function to determine the rate.
|
|
|
|
This way we dont have to keep a essentially dummy frequency table to use
|
|
RCG2 as a mux.
|
|
|
|
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
|
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
|
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
|
|
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
|
|
Link: https://lore.kernel.org/r/20220818220628.339366-1-robimarko@gmail.com
|
|
(cherry picked from commit c5d2c96b3a7bd8987fad9957510034130037fccf)
|
|
Signed-off-by: hzy <hzyitc@outlook.com>
|
|
---
|
|
drivers/clk/qcom/clk-rcg.h | 1 +
|
|
drivers/clk/qcom/clk-rcg2.c | 7 +++++++
|
|
2 files changed, 8 insertions(+)
|
|
|
|
diff --git a/drivers/clk/qcom/clk-rcg.h b/drivers/clk/qcom/clk-rcg.h
|
|
index c25b57c3cbc8..4ff199e06e4f 100644
|
|
--- a/drivers/clk/qcom/clk-rcg.h
|
|
+++ b/drivers/clk/qcom/clk-rcg.h
|
|
@@ -155,6 +155,7 @@ struct clk_rcg2 {
|
|
|
|
extern const struct clk_ops clk_rcg2_ops;
|
|
extern const struct clk_ops clk_rcg2_floor_ops;
|
|
+extern const struct clk_ops clk_rcg2_mux_closest_ops;
|
|
extern const struct clk_ops clk_edp_pixel_ops;
|
|
extern const struct clk_ops clk_byte_ops;
|
|
extern const struct clk_ops clk_byte2_ops;
|
|
diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c
|
|
index 89c1adeb84d4..17ab2665bf6e 100644
|
|
--- a/drivers/clk/qcom/clk-rcg2.c
|
|
+++ b/drivers/clk/qcom/clk-rcg2.c
|
|
@@ -387,6 +387,13 @@ const struct clk_ops clk_rcg2_floor_ops = {
|
|
};
|
|
EXPORT_SYMBOL_GPL(clk_rcg2_floor_ops);
|
|
|
|
+const struct clk_ops clk_rcg2_mux_closest_ops = {
|
|
+ .determine_rate = __clk_mux_determine_rate_closest,
|
|
+ .get_parent = clk_rcg2_get_parent,
|
|
+ .set_parent = clk_rcg2_set_parent,
|
|
+};
|
|
+EXPORT_SYMBOL_GPL(clk_rcg2_mux_closest_ops);
|
|
+
|
|
struct frac_entry {
|
|
int num;
|
|
int den;
|
|
--
|
|
2.25.1
|
|
|