• Home
  • Raw
  • Download

Lines Matching refs:od

46 static void _add_clkdev(struct omap_device *od, const char *clk_alias,  in _add_clkdev()  argument
55 dev_dbg(&od->pdev->dev, "Creating %s -> %s\n", clk_alias, clk_name); in _add_clkdev()
57 r = clk_get_sys(dev_name(&od->pdev->dev), clk_alias); in _add_clkdev()
59 dev_dbg(&od->pdev->dev, in _add_clkdev()
65 rc = clk_add_alias(clk_alias, dev_name(&od->pdev->dev), clk_name, NULL); in _add_clkdev()
68 dev_err(&od->pdev->dev, in _add_clkdev()
71 dev_err(&od->pdev->dev, in _add_clkdev()
95 static void _add_hwmod_clocks_clkdev(struct omap_device *od, in _add_hwmod_clocks_clkdev() argument
100 _add_clkdev(od, "fck", oh->main_clk); in _add_hwmod_clocks_clkdev()
103 _add_clkdev(od, oh->opt_clks[i].role, oh->opt_clks[i].clk); in _add_hwmod_clocks_clkdev()
122 struct omap_device *od; in omap_device_build_from_dt() local
155 od = omap_device_alloc(pdev, hwmods, oh_cnt); in omap_device_build_from_dt()
156 if (IS_ERR(od)) { in omap_device_build_from_dt()
159 ret = PTR_ERR(od); in omap_device_build_from_dt()
192 struct omap_device *od; in _omap_device_notifier_call() local
196 if (pdev->archdata.od) in _omap_device_notifier_call()
197 omap_device_delete(pdev->archdata.od); in _omap_device_notifier_call()
205 od = to_omap_device(pdev); in _omap_device_notifier_call()
206 if (od) in _omap_device_notifier_call()
207 od->_driver_status = event; in _omap_device_notifier_call()
219 static int _omap_device_enable_hwmods(struct omap_device *od) in _omap_device_enable_hwmods() argument
224 for (i = 0; i < od->hwmods_cnt; i++) in _omap_device_enable_hwmods()
225 ret |= omap_hwmod_enable(od->hwmods[i]); in _omap_device_enable_hwmods()
236 static int _omap_device_idle_hwmods(struct omap_device *od) in _omap_device_idle_hwmods() argument
241 for (i = 0; i < od->hwmods_cnt; i++) in _omap_device_idle_hwmods()
242 ret |= omap_hwmod_idle(od->hwmods[i]); in _omap_device_idle_hwmods()
266 struct omap_device *od; in omap_device_get_context_loss_count() local
269 od = to_omap_device(pdev); in omap_device_get_context_loss_count()
271 if (od->hwmods_cnt) in omap_device_get_context_loss_count()
272 ret = omap_hwmod_get_context_loss_count(od->hwmods[0]); in omap_device_get_context_loss_count()
287 static int omap_device_count_resources(struct omap_device *od, in omap_device_count_resources() argument
293 for (i = 0; i < od->hwmods_cnt; i++) in omap_device_count_resources()
294 c += omap_hwmod_count_resources(od->hwmods[i], flags); in omap_device_count_resources()
297 od->pdev->name, c, od->hwmods_cnt); in omap_device_count_resources()
319 static int omap_device_fill_resources(struct omap_device *od, in omap_device_fill_resources() argument
324 for (i = 0; i < od->hwmods_cnt; i++) { in omap_device_fill_resources()
325 r = omap_hwmod_fill_resources(od->hwmods[i], res); in omap_device_fill_resources()
346 static int _od_fill_dma_resources(struct omap_device *od, in _od_fill_dma_resources() argument
351 for (i = 0; i < od->hwmods_cnt; i++) { in _od_fill_dma_resources()
352 r = omap_hwmod_fill_dma_resources(od->hwmods[i], res); in _od_fill_dma_resources()
375 struct omap_device *od; in omap_device_alloc() local
380 od = kzalloc(sizeof(struct omap_device), GFP_KERNEL); in omap_device_alloc()
381 if (!od) { in omap_device_alloc()
385 od->hwmods_cnt = oh_cnt; in omap_device_alloc()
391 od->hwmods = hwmods; in omap_device_alloc()
392 od->pdev = pdev; in omap_device_alloc()
415 res_count = omap_device_count_resources(od, IORESOURCE_IRQ | in omap_device_alloc()
428 res_count = omap_device_count_resources(od, IORESOURCE_DMA); in omap_device_alloc()
444 omap_device_fill_resources(od, res); in omap_device_alloc()
451 _od_fill_dma_resources(od, &res[pdev->num_resources]); in omap_device_alloc()
461 pdev->archdata.od = od; in omap_device_alloc()
464 hwmods[i]->od = od; in omap_device_alloc()
465 _add_hwmod_clocks_clkdev(od, hwmods[i]); in omap_device_alloc()
468 return od; in omap_device_alloc()
473 kfree(od); in omap_device_alloc()
480 void omap_device_delete(struct omap_device *od) in omap_device_delete() argument
482 if (!od) in omap_device_delete()
485 od->pdev->archdata.od = NULL; in omap_device_delete()
486 kfree(od->hwmods); in omap_device_delete()
487 kfree(od); in omap_device_delete()
540 struct omap_device *od; in omap_device_build_ss() local
560 od = omap_device_alloc(pdev, ohs, oh_cnt); in omap_device_build_ss()
561 if (IS_ERR(od)) in omap_device_build_ss()
575 omap_device_delete(od); in omap_device_build_ss()
628 struct omap_device *od = to_omap_device(pdev); in _od_suspend_noirq() local
632 if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER) in _od_suspend_noirq()
641 od->flags |= OMAP_DEVICE_SUSPENDED; in _od_suspend_noirq()
651 struct omap_device *od = to_omap_device(pdev); in _od_resume_noirq() local
653 if (od->flags & OMAP_DEVICE_SUSPENDED) { in _od_resume_noirq()
654 od->flags &= ~OMAP_DEVICE_SUSPENDED; in _od_resume_noirq()
726 struct omap_device *od; in omap_device_enable() local
728 od = to_omap_device(pdev); in omap_device_enable()
730 if (od->_state == OMAP_DEVICE_STATE_ENABLED) { in omap_device_enable()
733 __func__, od->_state); in omap_device_enable()
737 ret = _omap_device_enable_hwmods(od); in omap_device_enable()
740 od->_state = OMAP_DEVICE_STATE_ENABLED; in omap_device_enable()
757 struct omap_device *od; in omap_device_idle() local
759 od = to_omap_device(pdev); in omap_device_idle()
761 if (od->_state != OMAP_DEVICE_STATE_ENABLED) { in omap_device_idle()
764 __func__, od->_state); in omap_device_idle()
768 ret = _omap_device_idle_hwmods(od); in omap_device_idle()
771 od->_state = OMAP_DEVICE_STATE_IDLE; in omap_device_idle()
790 struct omap_device *od = to_omap_device(pdev); in omap_device_assert_hardreset() local
794 for (i = 0; i < od->hwmods_cnt; i++) { in omap_device_assert_hardreset()
795 ret = omap_hwmod_assert_hardreset(od->hwmods[i], name); in omap_device_assert_hardreset()
818 struct omap_device *od = to_omap_device(pdev); in omap_device_deassert_hardreset() local
822 for (i = 0; i < od->hwmods_cnt; i++) { in omap_device_deassert_hardreset()
823 ret = omap_hwmod_deassert_hardreset(od->hwmods[i], name); in omap_device_deassert_hardreset()
854 if (!oh->od) { in omap_device_get_by_hwmod_name()
860 return &oh->od->pdev->dev; in omap_device_get_by_hwmod_name()
885 struct omap_device *od = to_omap_device(pdev); in omap_device_late_idle() local
888 if (!od) in omap_device_late_idle()
900 for (i = 0; i < od->hwmods_cnt; i++) in omap_device_late_idle()
901 if (od->hwmods[i]->flags & HWMOD_INIT_NO_IDLE) in omap_device_late_idle()
904 if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER && in omap_device_late_idle()
905 od->_driver_status != BUS_NOTIFY_BIND_DRIVER) { in omap_device_late_idle()
906 if (od->_state == OMAP_DEVICE_STATE_ENABLED) { in omap_device_late_idle()