Lines Matching +full:init +full:- +full:delay
1 // SPDX-License-Identifier: GPL-2.0-only
12 #include <linux/delay.h>
27 unsigned int delay; member
42 if (apbc->lock) in clk_apbc_prepare()
43 spin_lock_irqsave(apbc->lock, flags); in clk_apbc_prepare()
45 data = readl_relaxed(apbc->base); in clk_apbc_prepare()
46 if (apbc->flags & APBC_POWER_CTRL) in clk_apbc_prepare()
49 writel_relaxed(data, apbc->base); in clk_apbc_prepare()
51 if (apbc->lock) in clk_apbc_prepare()
52 spin_unlock_irqrestore(apbc->lock, flags); in clk_apbc_prepare()
54 udelay(apbc->delay); in clk_apbc_prepare()
56 if (apbc->lock) in clk_apbc_prepare()
57 spin_lock_irqsave(apbc->lock, flags); in clk_apbc_prepare()
59 data = readl_relaxed(apbc->base); in clk_apbc_prepare()
61 writel_relaxed(data, apbc->base); in clk_apbc_prepare()
63 if (apbc->lock) in clk_apbc_prepare()
64 spin_unlock_irqrestore(apbc->lock, flags); in clk_apbc_prepare()
66 udelay(apbc->delay); in clk_apbc_prepare()
68 if (!(apbc->flags & APBC_NO_BUS_CTRL)) { in clk_apbc_prepare()
69 if (apbc->lock) in clk_apbc_prepare()
70 spin_lock_irqsave(apbc->lock, flags); in clk_apbc_prepare()
72 data = readl_relaxed(apbc->base); in clk_apbc_prepare()
74 writel_relaxed(data, apbc->base); in clk_apbc_prepare()
76 if (apbc->lock) in clk_apbc_prepare()
77 spin_unlock_irqrestore(apbc->lock, flags); in clk_apbc_prepare()
89 if (apbc->lock) in clk_apbc_unprepare()
90 spin_lock_irqsave(apbc->lock, flags); in clk_apbc_unprepare()
92 data = readl_relaxed(apbc->base); in clk_apbc_unprepare()
93 if (apbc->flags & APBC_POWER_CTRL) in clk_apbc_unprepare()
96 writel_relaxed(data, apbc->base); in clk_apbc_unprepare()
98 if (apbc->lock) in clk_apbc_unprepare()
99 spin_unlock_irqrestore(apbc->lock, flags); in clk_apbc_unprepare()
103 if (apbc->lock) in clk_apbc_unprepare()
104 spin_lock_irqsave(apbc->lock, flags); in clk_apbc_unprepare()
106 data = readl_relaxed(apbc->base); in clk_apbc_unprepare()
108 writel_relaxed(data, apbc->base); in clk_apbc_unprepare()
110 if (apbc->lock) in clk_apbc_unprepare()
111 spin_unlock_irqrestore(apbc->lock, flags); in clk_apbc_unprepare()
120 void __iomem *base, unsigned int delay, in mmp_clk_register_apbc() argument
125 struct clk_init_data init; in mmp_clk_register_apbc() local
131 init.name = name; in mmp_clk_register_apbc()
132 init.ops = &clk_apbc_ops; in mmp_clk_register_apbc()
133 init.flags = CLK_SET_RATE_PARENT; in mmp_clk_register_apbc()
134 init.parent_names = (parent_name ? &parent_name : NULL); in mmp_clk_register_apbc()
135 init.num_parents = (parent_name ? 1 : 0); in mmp_clk_register_apbc()
137 apbc->base = base; in mmp_clk_register_apbc()
138 apbc->delay = delay; in mmp_clk_register_apbc()
139 apbc->flags = apbc_flags; in mmp_clk_register_apbc()
140 apbc->lock = lock; in mmp_clk_register_apbc()
141 apbc->hw.init = &init; in mmp_clk_register_apbc()
143 clk = clk_register(NULL, &apbc->hw); in mmp_clk_register_apbc()