Lines Matching +full:scu +full:- +full:clk

1 // SPDX-License-Identifier: GPL-2.0+
8 #include <linux/clk-provider.h>
14 #include "clk-scu.h"
23 * struct clk_lpcg_scu - Description of LPCG clock
46 struct clk_lpcg_scu *clk = to_clk_lpcg_scu(hw); in clk_lpcg_scu_enable() local
52 reg = readl_relaxed(clk->reg); in clk_lpcg_scu_enable()
53 reg &= ~(CLK_GATE_SCU_LPCG_MASK << clk->bit_idx); in clk_lpcg_scu_enable()
56 if (clk->hw_gate) in clk_lpcg_scu_enable()
59 reg |= val << clk->bit_idx; in clk_lpcg_scu_enable()
60 writel(reg, clk->reg); in clk_lpcg_scu_enable()
69 struct clk_lpcg_scu *clk = to_clk_lpcg_scu(hw); in clk_lpcg_scu_disable() local
75 reg = readl_relaxed(clk->reg); in clk_lpcg_scu_disable()
76 reg &= ~(CLK_GATE_SCU_LPCG_MASK << clk->bit_idx); in clk_lpcg_scu_disable()
77 writel(reg, clk->reg); in clk_lpcg_scu_disable()
91 struct clk_lpcg_scu *clk; in __imx_clk_lpcg_scu() local
96 clk = kzalloc(sizeof(*clk), GFP_KERNEL); in __imx_clk_lpcg_scu()
97 if (!clk) in __imx_clk_lpcg_scu()
98 return ERR_PTR(-ENOMEM); in __imx_clk_lpcg_scu()
100 clk->reg = reg; in __imx_clk_lpcg_scu()
101 clk->bit_idx = bit_idx; in __imx_clk_lpcg_scu()
102 clk->hw_gate = hw_gate; in __imx_clk_lpcg_scu()
110 clk->hw.init = &init; in __imx_clk_lpcg_scu()
112 hw = &clk->hw; in __imx_clk_lpcg_scu()
115 kfree(clk); in __imx_clk_lpcg_scu()
121 dev_set_drvdata(dev, clk); in __imx_clk_lpcg_scu()
128 struct clk_lpcg_scu *clk = to_clk_lpcg_scu(hw); in imx_clk_lpcg_scu_unregister() local
130 clk_hw_unregister(&clk->hw); in imx_clk_lpcg_scu_unregister()
131 kfree(clk); in imx_clk_lpcg_scu_unregister()
136 struct clk_lpcg_scu *clk = dev_get_drvdata(dev); in imx_clk_lpcg_scu_suspend() local
138 clk->state = readl_relaxed(clk->reg); in imx_clk_lpcg_scu_suspend()
139 dev_dbg(dev, "save lpcg state 0x%x\n", clk->state); in imx_clk_lpcg_scu_suspend()
146 struct clk_lpcg_scu *clk = dev_get_drvdata(dev); in imx_clk_lpcg_scu_resume() local
153 writel(clk->state, clk->reg); in imx_clk_lpcg_scu_resume()
154 writel(clk->state, clk->reg); in imx_clk_lpcg_scu_resume()
155 dev_dbg(dev, "restore lpcg state 0x%x\n", clk->state); in imx_clk_lpcg_scu_resume()