Lines Matching refs:pdev
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()
119 static int omap_device_build_from_dt(struct platform_device *pdev) in omap_device_build_from_dt() argument
124 struct device_node *node = pdev->dev.of_node; in omap_device_build_from_dt()
131 dev_dbg(&pdev->dev, "No 'hwmods' to build omap_device\n"); in omap_device_build_from_dt()
145 dev_err(&pdev->dev, "Cannot lookup hwmod '%s'\n", in omap_device_build_from_dt()
155 od = omap_device_alloc(pdev, hwmods, oh_cnt); in omap_device_build_from_dt()
157 dev_err(&pdev->dev, "Cannot allocate omap_device for :%s\n", in omap_device_build_from_dt()
164 for (i = 0; i < pdev->num_resources; i++) { in omap_device_build_from_dt()
165 struct resource *r = &pdev->resource[i]; in omap_device_build_from_dt()
168 r->name = dev_name(&pdev->dev); in omap_device_build_from_dt()
171 pdev->dev.pm_domain = &omap_device_pm_domain; in omap_device_build_from_dt()
174 omap_device_enable(pdev); in omap_device_build_from_dt()
175 pm_runtime_set_active(&pdev->dev); in omap_device_build_from_dt()
183 pdev->dev.pm_domain = &omap_device_fail_pm_domain; in omap_device_build_from_dt()
191 struct platform_device *pdev = to_platform_device(dev); 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()
200 if (pdev->dev.of_node) in _omap_device_notifier_call()
201 omap_device_build_from_dt(pdev); in _omap_device_notifier_call()
205 od = to_omap_device(pdev); in _omap_device_notifier_call()
264 int omap_device_get_context_loss_count(struct platform_device *pdev) in omap_device_get_context_loss_count() argument
269 od = to_omap_device(pdev); in omap_device_get_context_loss_count()
297 od->pdev->name, c, od->hwmods_cnt); in omap_device_count_resources()
371 struct omap_device *omap_device_alloc(struct platform_device *pdev, in omap_device_alloc() argument
392 od->pdev = pdev; in omap_device_alloc()
413 if (!pdev->num_resources) { in omap_device_alloc()
420 for (i = 0; i < pdev->num_resources; i++) { in omap_device_alloc()
421 struct resource *r = &pdev->resource[i]; in omap_device_alloc()
433 res_count += pdev->num_resources; in omap_device_alloc()
441 if (!pdev->num_resources) { in omap_device_alloc()
442 dev_dbg(&pdev->dev, "%s: using %d resources from hwmod\n", in omap_device_alloc()
446 dev_dbg(&pdev->dev, in omap_device_alloc()
448 __func__, res_count - pdev->num_resources); in omap_device_alloc()
449 memcpy(res, pdev->resource, in omap_device_alloc()
450 sizeof(struct resource) * pdev->num_resources); in omap_device_alloc()
451 _od_fill_dma_resources(od, &res[pdev->num_resources]); in omap_device_alloc()
454 ret = platform_device_add_resources(pdev, res, res_count); in omap_device_alloc()
461 pdev->archdata.od = od; in omap_device_alloc()
475 dev_err(&pdev->dev, "omap_device: build failed (%d)\n", ret); in omap_device_alloc()
485 od->pdev->archdata.od = NULL; in omap_device_delete()
539 struct platform_device *pdev; in omap_device_build_ss() local
548 pdev = platform_device_alloc(pdev_name, pdev_id); in omap_device_build_ss()
549 if (!pdev) { in omap_device_build_ss()
555 if (pdev->id != -1) in omap_device_build_ss()
556 dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id); in omap_device_build_ss()
558 dev_set_name(&pdev->dev, "%s", pdev->name); in omap_device_build_ss()
560 od = omap_device_alloc(pdev, ohs, oh_cnt); in omap_device_build_ss()
564 ret = platform_device_add_data(pdev, pdata, pdata_len); in omap_device_build_ss()
568 ret = omap_device_register(pdev); in omap_device_build_ss()
572 return pdev; in omap_device_build_ss()
577 platform_device_put(pdev); in omap_device_build_ss()
588 struct platform_device *pdev = to_platform_device(dev); in _od_runtime_suspend() local
595 return omap_device_idle(pdev); in _od_runtime_suspend()
600 struct platform_device *pdev = to_platform_device(dev); in _od_runtime_resume() local
603 ret = omap_device_enable(pdev); in _od_runtime_resume()
627 struct platform_device *pdev = to_platform_device(dev); in _od_suspend_noirq() local
628 struct omap_device *od = to_omap_device(pdev); in _od_suspend_noirq()
640 omap_device_idle(pdev); in _od_suspend_noirq()
650 struct platform_device *pdev = to_platform_device(dev); in _od_resume_noirq() local
651 struct omap_device *od = to_omap_device(pdev); in _od_resume_noirq()
655 omap_device_enable(pdev); in _od_resume_noirq()
700 int omap_device_register(struct platform_device *pdev) in omap_device_register() argument
702 pr_debug("omap_device: %s: registering\n", pdev->name); in omap_device_register()
704 pdev->dev.pm_domain = &omap_device_pm_domain; in omap_device_register()
705 return platform_device_add(pdev); in omap_device_register()
723 int omap_device_enable(struct platform_device *pdev) in omap_device_enable() argument
728 od = to_omap_device(pdev); in omap_device_enable()
731 dev_warn(&pdev->dev, in omap_device_enable()
754 int omap_device_idle(struct platform_device *pdev) in omap_device_idle() argument
759 od = to_omap_device(pdev); in omap_device_idle()
762 dev_warn(&pdev->dev, in omap_device_idle()
788 int omap_device_assert_hardreset(struct platform_device *pdev, const char *name) in omap_device_assert_hardreset() argument
790 struct omap_device *od = to_omap_device(pdev); in omap_device_assert_hardreset()
815 int omap_device_deassert_hardreset(struct platform_device *pdev, in omap_device_deassert_hardreset() argument
818 struct omap_device *od = to_omap_device(pdev); in omap_device_deassert_hardreset()
860 return &oh->od->pdev->dev; in omap_device_get_by_hwmod_name()
884 struct platform_device *pdev = to_platform_device(dev); in omap_device_late_idle() local
885 struct omap_device *od = to_omap_device(pdev); in omap_device_late_idle()
909 omap_device_idle(pdev); in omap_device_late_idle()