[U-Boot] [PATCH V3 09/16] clk: imx: gate2 add set rate
Peng Fan
peng.fan at nxp.com
Wed Jul 31 07:01:45 UTC 2019
Add set rate for imx clk-gate2
Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
V3:
None
V2:
Rebase
drivers/clk/imx/clk-gate2.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/clk/imx/clk-gate2.c b/drivers/clk/imx/clk-gate2.c
index 571be32088..1b9db6e791 100644
--- a/drivers/clk/imx/clk-gate2.c
+++ b/drivers/clk/imx/clk-gate2.c
@@ -60,7 +60,18 @@ static int clk_gate2_disable(struct clk *clk)
return 0;
}
+static ulong clk_gate2_set_rate(struct clk *clk, ulong rate)
+{
+ struct clk *parent = clk_get_parent(clk);
+
+ if (parent)
+ return clk_set_rate(parent, rate);
+
+ return -ENODEV;
+}
+
static const struct clk_ops clk_gate2_ops = {
+ .set_rate = clk_gate2_set_rate,
.enable = clk_gate2_enable,
.disable = clk_gate2_disable,
.get_rate = clk_generic_get_rate,
--
2.16.4
More information about the U-Boot
mailing list