Lines Matching full:od
44 static void omap_device_delete(struct omap_device *od);
50 static void _add_clkdev(struct omap_device *od, const char *clk_alias, in _add_clkdev() argument
59 dev_dbg(&od->pdev->dev, "Creating %s -> %s\n", clk_alias, clk_name); in _add_clkdev()
61 r = clk_get_sys(dev_name(&od->pdev->dev), clk_alias); in _add_clkdev()
63 dev_dbg(&od->pdev->dev, in _add_clkdev()
79 dev_name(&od->pdev->dev)); in _add_clkdev()
81 rc = clk_add_alias(clk_alias, dev_name(&od->pdev->dev), in _add_clkdev()
87 dev_err(&od->pdev->dev, in _add_clkdev()
90 dev_err(&od->pdev->dev, in _add_clkdev()
98 * @od: struct omap_device *od
111 static void _add_hwmod_clocks_clkdev(struct omap_device *od, in _add_hwmod_clocks_clkdev() argument
116 _add_clkdev(od, "fck", oh->main_clk); in _add_hwmod_clocks_clkdev()
119 _add_clkdev(od, oh->opt_clks[i].role, oh->opt_clks[i].clk); in _add_hwmod_clocks_clkdev()
134 struct omap_device *od; in omap_device_build_from_dt() local
179 od = omap_device_alloc(pdev, hwmods, oh_cnt); in omap_device_build_from_dt()
180 if (IS_ERR(od)) { in omap_device_build_from_dt()
183 ret = PTR_ERR(od); in omap_device_build_from_dt()
217 struct omap_device *od; in _omap_device_notifier_call() local
222 if (pdev->archdata.od) in _omap_device_notifier_call()
223 omap_device_delete(pdev->archdata.od); in _omap_device_notifier_call()
226 od = to_omap_device(pdev); in _omap_device_notifier_call()
227 if (od && (od->_state == OMAP_DEVICE_STATE_ENABLED)) { in _omap_device_notifier_call()
235 od = to_omap_device(pdev); in _omap_device_notifier_call()
236 if (od) { in _omap_device_notifier_call()
237 od->_driver_status = BUS_NOTIFY_BIND_DRIVER; in _omap_device_notifier_call()
238 if (od->_state == OMAP_DEVICE_STATE_ENABLED && in _omap_device_notifier_call()
249 od = to_omap_device(pdev); in _omap_device_notifier_call()
250 if (od) in _omap_device_notifier_call()
251 od->_driver_status = event; in _omap_device_notifier_call()
259 * @od: struct omap_device *od
263 static int _omap_device_enable_hwmods(struct omap_device *od) in _omap_device_enable_hwmods() argument
268 for (i = 0; i < od->hwmods_cnt; i++) in _omap_device_enable_hwmods()
269 ret |= omap_hwmod_enable(od->hwmods[i]); in _omap_device_enable_hwmods()
276 * @od: struct omap_device *od
280 static int _omap_device_idle_hwmods(struct omap_device *od) in _omap_device_idle_hwmods() argument
285 for (i = 0; i < od->hwmods_cnt; i++) in _omap_device_idle_hwmods()
286 ret |= omap_hwmod_idle(od->hwmods[i]); in _omap_device_idle_hwmods()
308 struct omap_device *od; in omap_device_alloc() local
312 od = kzalloc(sizeof(struct omap_device), GFP_KERNEL); in omap_device_alloc()
313 if (!od) in omap_device_alloc()
316 od->hwmods_cnt = oh_cnt; in omap_device_alloc()
322 od->hwmods = hwmods; in omap_device_alloc()
323 od->pdev = pdev; in omap_device_alloc()
324 pdev->archdata.od = od; in omap_device_alloc()
327 hwmods[i]->od = od; in omap_device_alloc()
328 _add_hwmod_clocks_clkdev(od, hwmods[i]); in omap_device_alloc()
331 return od; in omap_device_alloc()
334 kfree(od); in omap_device_alloc()
341 static void omap_device_delete(struct omap_device *od) in omap_device_delete() argument
343 if (!od) in omap_device_delete()
346 od->pdev->archdata.od = NULL; in omap_device_delete()
347 kfree(od->hwmods); in omap_device_delete()
348 kfree(od); in omap_device_delete()
396 struct omap_device *od = to_omap_device(pdev); in _od_suspend_noirq() local
400 if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER) in _od_suspend_noirq()
408 od->flags |= OMAP_DEVICE_SUSPENDED; in _od_suspend_noirq()
418 struct omap_device *od = to_omap_device(pdev); in _od_resume_noirq() local
420 if (od->flags & OMAP_DEVICE_SUSPENDED) { in _od_resume_noirq()
421 od->flags &= ~OMAP_DEVICE_SUSPENDED; in _od_resume_noirq()
456 * Do whatever is necessary for the hwmods underlying omap_device @od
467 struct omap_device *od; in omap_device_enable() local
469 od = to_omap_device(pdev); in omap_device_enable()
471 if (od->_state == OMAP_DEVICE_STATE_ENABLED) { in omap_device_enable()
474 __func__, od->_state); in omap_device_enable()
478 ret = _omap_device_enable_hwmods(od); in omap_device_enable()
481 od->_state = OMAP_DEVICE_STATE_ENABLED; in omap_device_enable()
490 * Idle omap_device @od. Device drivers call this function indirectly
498 struct omap_device *od; in omap_device_idle() local
500 od = to_omap_device(pdev); in omap_device_idle()
502 if (od->_state != OMAP_DEVICE_STATE_ENABLED) { in omap_device_idle()
505 __func__, od->_state); in omap_device_idle()
509 ret = _omap_device_idle_hwmods(od); in omap_device_idle()
512 od->_state = OMAP_DEVICE_STATE_IDLE; in omap_device_idle()
531 struct omap_device *od = to_omap_device(pdev); in omap_device_assert_hardreset() local
535 for (i = 0; i < od->hwmods_cnt; i++) { in omap_device_assert_hardreset()
536 ret = omap_hwmod_assert_hardreset(od->hwmods[i], name); in omap_device_assert_hardreset()
559 struct omap_device *od = to_omap_device(pdev); in omap_device_deassert_hardreset() local
563 for (i = 0; i < od->hwmods_cnt; i++) { in omap_device_deassert_hardreset()
564 ret = omap_hwmod_deassert_hardreset(od->hwmods[i], name); in omap_device_deassert_hardreset()
594 struct omap_device *od = to_omap_device(pdev); in omap_device_late_idle() local
597 if (!od) in omap_device_late_idle()
609 for (i = 0; i < od->hwmods_cnt; i++) in omap_device_late_idle()
610 if (od->hwmods[i]->flags & HWMOD_INIT_NO_IDLE) in omap_device_late_idle()
613 if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER && in omap_device_late_idle()
614 od->_driver_status != BUS_NOTIFY_BIND_DRIVER) { in omap_device_late_idle()
615 if (od->_state == OMAP_DEVICE_STATE_ENABLED) { in omap_device_late_idle()