[U-Boot] [RFC PATCH v2 05/18] clk: imx: pllv3: add disable() support
Giulio Benetti
giulio.benetti at benettiengineering.com
Wed Nov 20 17:56:14 UTC 2019
Add disable() support.
Signed-off-by: Giulio Benetti <giulio.benetti at benettiengineering.com>
---
drivers/clk/imx/clk-pllv3.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
index 84283ab6a9..cb461cd5be 100644
--- a/drivers/clk/imx/clk-pllv3.c
+++ b/drivers/clk/imx/clk-pllv3.c
@@ -54,8 +54,24 @@ static int clk_pllv3_generic_enable(struct clk *clk)
return 0;
}
+static int clk_pllv3_generic_disable(struct clk *clk)
+{
+ struct clk_pllv3 *pll = to_clk_pllv3(clk);
+ u32 val;
+
+ val = readl(pll->base);
+ if (pll->powerup_set)
+ val &= ~pll->power_bit;
+ else
+ val |= pll->power_bit;
+ writel(val, pll->base);
+
+ return 0;
+}
+
static const struct clk_ops clk_pllv3_generic_ops = {
.enable = clk_pllv3_generic_enable,
+ .disable = clk_pllv3_generic_disable,
.get_rate = clk_pllv3_generic_get_rate,
};
--
2.20.1
More information about the U-Boot
mailing list