Lines Matching refs:apbc

34 	struct clk_apbc *apbc = to_clk_apbc(hw);  in clk_apbc_prepare()  local
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()
85 struct clk_apbc *apbc = to_clk_apbc(hw); in clk_apbc_unprepare() local
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()
123 struct clk_apbc *apbc; in mmp_clk_register_apbc() local
127 apbc = kzalloc(sizeof(*apbc), GFP_KERNEL); in mmp_clk_register_apbc()
128 if (!apbc) 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()
145 kfree(apbc); in mmp_clk_register_apbc()