Lines Matching refs:apbc

37 	struct clk_apbc *apbc = to_clk_apbc(hw);  in clk_apbc_prepare()  local
45 if (apbc->lock) in clk_apbc_prepare()
46 spin_lock_irqsave(apbc->lock, flags); in clk_apbc_prepare()
48 data = readl_relaxed(apbc->base); in clk_apbc_prepare()
49 if (apbc->flags & APBC_POWER_CTRL) in clk_apbc_prepare()
52 writel_relaxed(data, apbc->base); in clk_apbc_prepare()
54 if (apbc->lock) in clk_apbc_prepare()
55 spin_unlock_irqrestore(apbc->lock, flags); in clk_apbc_prepare()
57 udelay(apbc->delay); in clk_apbc_prepare()
59 if (apbc->lock) in clk_apbc_prepare()
60 spin_lock_irqsave(apbc->lock, flags); in clk_apbc_prepare()
62 data = readl_relaxed(apbc->base); in clk_apbc_prepare()
64 writel_relaxed(data, apbc->base); in clk_apbc_prepare()
66 if (apbc->lock) in clk_apbc_prepare()
67 spin_unlock_irqrestore(apbc->lock, flags); in clk_apbc_prepare()
69 udelay(apbc->delay); in clk_apbc_prepare()
71 if (!(apbc->flags & APBC_NO_BUS_CTRL)) { in clk_apbc_prepare()
72 if (apbc->lock) in clk_apbc_prepare()
73 spin_lock_irqsave(apbc->lock, flags); in clk_apbc_prepare()
75 data = readl_relaxed(apbc->base); in clk_apbc_prepare()
77 writel_relaxed(data, apbc->base); in clk_apbc_prepare()
79 if (apbc->lock) in clk_apbc_prepare()
80 spin_unlock_irqrestore(apbc->lock, flags); in clk_apbc_prepare()
88 struct clk_apbc *apbc = to_clk_apbc(hw); in clk_apbc_unprepare() local
92 if (apbc->lock) in clk_apbc_unprepare()
93 spin_lock_irqsave(apbc->lock, flags); in clk_apbc_unprepare()
95 data = readl_relaxed(apbc->base); in clk_apbc_unprepare()
96 if (apbc->flags & APBC_POWER_CTRL) in clk_apbc_unprepare()
99 writel_relaxed(data, apbc->base); in clk_apbc_unprepare()
101 if (apbc->lock) in clk_apbc_unprepare()
102 spin_unlock_irqrestore(apbc->lock, flags); in clk_apbc_unprepare()
106 if (apbc->lock) in clk_apbc_unprepare()
107 spin_lock_irqsave(apbc->lock, flags); in clk_apbc_unprepare()
109 data = readl_relaxed(apbc->base); in clk_apbc_unprepare()
111 writel_relaxed(data, apbc->base); in clk_apbc_unprepare()
113 if (apbc->lock) in clk_apbc_unprepare()
114 spin_unlock_irqrestore(apbc->lock, flags); in clk_apbc_unprepare()
126 struct clk_apbc *apbc; in mmp_clk_register_apbc() local
130 apbc = kzalloc(sizeof(*apbc), GFP_KERNEL); in mmp_clk_register_apbc()
131 if (!apbc) in mmp_clk_register_apbc()
140 apbc->base = base; in mmp_clk_register_apbc()
141 apbc->delay = delay; in mmp_clk_register_apbc()
142 apbc->flags = apbc_flags; in mmp_clk_register_apbc()
143 apbc->lock = lock; in mmp_clk_register_apbc()
144 apbc->hw.init = &init; in mmp_clk_register_apbc()
146 clk = clk_register(NULL, &apbc->hw); in mmp_clk_register_apbc()
148 kfree(apbc); in mmp_clk_register_apbc()