Lines Matching refs:ce
40 * @ce: PM clock entry corresponding to the clock.
42 static inline void __pm_clk_enable(struct device *dev, struct pm_clock_entry *ce)
46 if (ce->status < PCE_STATUS_ERROR) {
47 ret = clk_enable(ce->clk);
49 ce->status = PCE_STATUS_ENABLED;
52 __func__, ce->clk, ret);
59 * @ce: PM clock entry corresponding to the clock.
61 static void pm_clk_acquire(struct device *dev, struct pm_clock_entry *ce)
63 if (!ce->clk)
64 ce->clk = clk_get(dev, ce->con_id);
65 if (IS_ERR(ce->clk)) {
66 ce->status = PCE_STATUS_ERROR;
68 if (clk_prepare(ce->clk)) {
69 ce->status = PCE_STATUS_ERROR;
72 ce->status = PCE_STATUS_ACQUIRED;
75 ce->clk, ce->con_id);
84 struct pm_clock_entry *ce;
89 ce = kzalloc(sizeof(*ce), GFP_KERNEL);
90 if (!ce)
94 ce->con_id = kstrdup(con_id, GFP_KERNEL);
95 if (!ce->con_id) {
96 kfree(ce);
101 kfree(ce);
104 ce->clk = clk;
107 pm_clk_acquire(dev, ce);
110 list_add_tail(&ce->node, &psd->clock_list);
235 * @ce: PM clock entry to destroy.
237 static void __pm_clk_remove(struct pm_clock_entry *ce)
239 if (!ce)
242 if (ce->status < PCE_STATUS_ERROR) {
243 if (ce->status == PCE_STATUS_ENABLED)
244 clk_disable(ce->clk);
246 if (ce->status >= PCE_STATUS_ACQUIRED) {
247 clk_unprepare(ce->clk);
248 clk_put(ce->clk);
252 kfree(ce->con_id);
253 kfree(ce);
267 struct pm_clock_entry *ce;
274 list_for_each_entry(ce, &psd->clock_list, node) {
275 if (!con_id && !ce->con_id)
277 else if (!con_id || !ce->con_id)
279 else if (!strcmp(con_id, ce->con_id))
287 list_del(&ce->node);
290 __pm_clk_remove(ce);
305 struct pm_clock_entry *ce;
312 list_for_each_entry(ce, &psd->clock_list, node) {
313 if (clk == ce->clk)
321 list_del(&ce->node);
324 __pm_clk_remove(ce);
367 struct pm_clock_entry *ce, *c;
377 list_for_each_entry_safe_reverse(ce, c, &psd->clock_list, node)
378 list_move(&ce->node, &list);
384 list_for_each_entry_safe_reverse(ce, c, &list, node) {
385 list_del(&ce->node);
386 __pm_clk_remove(ce);
398 struct pm_clock_entry *ce;
408 list_for_each_entry_reverse(ce, &psd->clock_list, node) {
409 if (ce->status < PCE_STATUS_ERROR) {
410 if (ce->status == PCE_STATUS_ENABLED)
411 clk_disable(ce->clk);
412 ce->status = PCE_STATUS_ACQUIRED;
429 struct pm_clock_entry *ce;
439 list_for_each_entry(ce, &psd->clock_list, node)
440 __pm_clk_enable(dev, ce);