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()
67 dev_err(&od->pdev->dev, in _add_clkdev()
72 l = clkdev_alloc(r, clk_alias, dev_name(&od->pdev->dev)); in _add_clkdev()
74 dev_err(&od->pdev->dev, in _add_clkdev()
125 static int omap_device_build_from_dt(struct platform_device *pdev) in omap_device_build_from_dt() argument
130 struct device_node *node = pdev->dev.of_node; in omap_device_build_from_dt()
137 dev_dbg(&pdev->dev, "No 'hwmods' to build omap_device\n"); in omap_device_build_from_dt()
151 dev_err(&pdev->dev, "Cannot lookup hwmod '%s'\n", in omap_device_build_from_dt()
161 od = omap_device_alloc(pdev, hwmods, oh_cnt); in omap_device_build_from_dt()
163 dev_err(&pdev->dev, "Cannot allocate omap_device for :%s\n", in omap_device_build_from_dt()
170 for (i = 0; i < pdev->num_resources; i++) { in omap_device_build_from_dt()
171 struct resource *r = &pdev->resource[i]; in omap_device_build_from_dt()
174 r->name = dev_name(&pdev->dev); in omap_device_build_from_dt()
177 pdev->dev.pm_domain = &omap_device_pm_domain; in omap_device_build_from_dt()
180 omap_device_enable(pdev); in omap_device_build_from_dt()
181 pm_runtime_set_active(&pdev->dev); in omap_device_build_from_dt()
189 pdev->dev.pm_domain = &omap_device_fail_pm_domain; in omap_device_build_from_dt()
197 struct platform_device *pdev = to_platform_device(dev); in _omap_device_notifier_call() local
202 if (pdev->archdata.od) in _omap_device_notifier_call()
203 omap_device_delete(pdev->archdata.od); in _omap_device_notifier_call()
206 if (pdev->dev.of_node) in _omap_device_notifier_call()
207 omap_device_build_from_dt(pdev); in _omap_device_notifier_call()
211 od = to_omap_device(pdev); in _omap_device_notifier_call()
270 int omap_device_get_context_loss_count(struct platform_device *pdev) in omap_device_get_context_loss_count() argument
275 od = to_omap_device(pdev); in omap_device_get_context_loss_count()
303 od->pdev->name, c, od->hwmods_cnt); in omap_device_count_resources()
377 struct omap_device *omap_device_alloc(struct platform_device *pdev, in omap_device_alloc() argument
398 od->pdev = pdev; in omap_device_alloc()
419 if (!pdev->num_resources) { in omap_device_alloc()
426 for (i = 0; i < pdev->num_resources; i++) { in omap_device_alloc()
427 struct resource *r = &pdev->resource[i]; in omap_device_alloc()
439 res_count += pdev->num_resources; in omap_device_alloc()
447 if (!pdev->num_resources) { in omap_device_alloc()
448 dev_dbg(&pdev->dev, "%s: using %d resources from hwmod\n", in omap_device_alloc()
452 dev_dbg(&pdev->dev, in omap_device_alloc()
454 __func__, res_count - pdev->num_resources); in omap_device_alloc()
455 memcpy(res, pdev->resource, in omap_device_alloc()
456 sizeof(struct resource) * pdev->num_resources); in omap_device_alloc()
457 _od_fill_dma_resources(od, &res[pdev->num_resources]); in omap_device_alloc()
460 ret = platform_device_add_resources(pdev, res, res_count); in omap_device_alloc()
467 pdev->archdata.od = od; in omap_device_alloc()
481 dev_err(&pdev->dev, "omap_device: build failed (%d)\n", ret); in omap_device_alloc()
491 od->pdev->archdata.od = NULL; in omap_device_delete()
545 struct platform_device *pdev; in omap_device_build_ss() local
554 pdev = platform_device_alloc(pdev_name, pdev_id); in omap_device_build_ss()
555 if (!pdev) { in omap_device_build_ss()
561 if (pdev->id != -1) in omap_device_build_ss()
562 dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id); in omap_device_build_ss()
564 dev_set_name(&pdev->dev, "%s", pdev->name); in omap_device_build_ss()
566 od = omap_device_alloc(pdev, ohs, oh_cnt); in omap_device_build_ss()
570 ret = platform_device_add_data(pdev, pdata, pdata_len); in omap_device_build_ss()
574 ret = omap_device_register(pdev); in omap_device_build_ss()
578 return pdev; in omap_device_build_ss()
583 platform_device_put(pdev); in omap_device_build_ss()
594 struct platform_device *pdev = to_platform_device(dev); in _od_runtime_suspend() local
600 omap_device_idle(pdev); in _od_runtime_suspend()
607 struct platform_device *pdev = to_platform_device(dev); in _od_runtime_resume() local
609 omap_device_enable(pdev); in _od_runtime_resume()
631 struct platform_device *pdev = to_platform_device(dev); in _od_suspend_noirq() local
632 struct omap_device *od = to_omap_device(pdev); in _od_suspend_noirq()
644 omap_device_idle(pdev); in _od_suspend_noirq()
654 struct platform_device *pdev = to_platform_device(dev); in _od_resume_noirq() local
655 struct omap_device *od = to_omap_device(pdev); in _od_resume_noirq()
659 omap_device_enable(pdev); in _od_resume_noirq()
707 int omap_device_register(struct platform_device *pdev) in omap_device_register() argument
709 pr_debug("omap_device: %s: registering\n", pdev->name); in omap_device_register()
711 pdev->dev.pm_domain = &omap_device_pm_domain; in omap_device_register()
712 return platform_device_add(pdev); in omap_device_register()
730 int omap_device_enable(struct platform_device *pdev) in omap_device_enable() argument
735 od = to_omap_device(pdev); in omap_device_enable()
738 dev_warn(&pdev->dev, in omap_device_enable()
760 int omap_device_idle(struct platform_device *pdev) in omap_device_idle() argument
765 od = to_omap_device(pdev); in omap_device_idle()
768 dev_warn(&pdev->dev, in omap_device_idle()
793 int omap_device_assert_hardreset(struct platform_device *pdev, const char *name) in omap_device_assert_hardreset() argument
795 struct omap_device *od = to_omap_device(pdev); in omap_device_assert_hardreset()
820 int omap_device_deassert_hardreset(struct platform_device *pdev, in omap_device_deassert_hardreset() argument
823 struct omap_device *od = to_omap_device(pdev); in omap_device_deassert_hardreset()
865 return &oh->od->pdev->dev; in omap_device_get_by_hwmod_name()
889 struct platform_device *pdev = to_platform_device(dev); in omap_device_late_idle() local
890 struct omap_device *od = to_omap_device(pdev); in omap_device_late_idle()
913 omap_device_idle(pdev); in omap_device_late_idle()