diff options
Diffstat (limited to 'arch/arm/plat-omap/omap_device.c')
-rw-r--r-- | arch/arm/plat-omap/omap_device.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index 2d00ab01d150..6de28ea3cd65 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c | |||
@@ -314,8 +314,6 @@ static void _add_hwmod_clocks_clkdev(struct omap_device *od, | |||
314 | } | 314 | } |
315 | 315 | ||
316 | 316 | ||
317 | static struct dev_pm_domain omap_device_pm_domain; | ||
318 | |||
319 | /** | 317 | /** |
320 | * omap_device_build_from_dt - build an omap_device with multiple hwmods | 318 | * omap_device_build_from_dt - build an omap_device with multiple hwmods |
321 | * @pdev_name: name of the platform_device driver to use | 319 | * @pdev_name: name of the platform_device driver to use |
@@ -756,14 +754,12 @@ static int _od_suspend_noirq(struct device *dev) | |||
756 | struct omap_device *od = to_omap_device(pdev); | 754 | struct omap_device *od = to_omap_device(pdev); |
757 | int ret; | 755 | int ret; |
758 | 756 | ||
759 | if (od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND) | ||
760 | return pm_generic_suspend_noirq(dev); | ||
761 | |||
762 | ret = pm_generic_suspend_noirq(dev); | 757 | ret = pm_generic_suspend_noirq(dev); |
763 | 758 | ||
764 | if (!ret && !pm_runtime_status_suspended(dev)) { | 759 | if (!ret && !pm_runtime_status_suspended(dev)) { |
765 | if (pm_generic_runtime_suspend(dev) == 0) { | 760 | if (pm_generic_runtime_suspend(dev) == 0) { |
766 | omap_device_idle(pdev); | 761 | if (!(od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND)) |
762 | omap_device_idle(pdev); | ||
767 | od->flags |= OMAP_DEVICE_SUSPENDED; | 763 | od->flags |= OMAP_DEVICE_SUSPENDED; |
768 | } | 764 | } |
769 | } | 765 | } |
@@ -776,13 +772,11 @@ static int _od_resume_noirq(struct device *dev) | |||
776 | struct platform_device *pdev = to_platform_device(dev); | 772 | struct platform_device *pdev = to_platform_device(dev); |
777 | struct omap_device *od = to_omap_device(pdev); | 773 | struct omap_device *od = to_omap_device(pdev); |
778 | 774 | ||
779 | if (od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND) | ||
780 | return pm_generic_resume_noirq(dev); | ||
781 | |||
782 | if ((od->flags & OMAP_DEVICE_SUSPENDED) && | 775 | if ((od->flags & OMAP_DEVICE_SUSPENDED) && |
783 | !pm_runtime_status_suspended(dev)) { | 776 | !pm_runtime_status_suspended(dev)) { |
784 | od->flags &= ~OMAP_DEVICE_SUSPENDED; | 777 | od->flags &= ~OMAP_DEVICE_SUSPENDED; |
785 | omap_device_enable(pdev); | 778 | if (!(od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND)) |
779 | omap_device_enable(pdev); | ||
786 | pm_generic_runtime_resume(dev); | 780 | pm_generic_runtime_resume(dev); |
787 | } | 781 | } |
788 | 782 | ||
@@ -793,7 +787,7 @@ static int _od_resume_noirq(struct device *dev) | |||
793 | #define _od_resume_noirq NULL | 787 | #define _od_resume_noirq NULL |
794 | #endif | 788 | #endif |
795 | 789 | ||
796 | static struct dev_pm_domain omap_device_pm_domain = { | 790 | struct dev_pm_domain omap_device_pm_domain = { |
797 | .ops = { | 791 | .ops = { |
798 | SET_RUNTIME_PM_OPS(_od_runtime_suspend, _od_runtime_resume, | 792 | SET_RUNTIME_PM_OPS(_od_runtime_suspend, _od_runtime_resume, |
799 | _od_runtime_idle) | 793 | _od_runtime_idle) |
@@ -815,7 +809,6 @@ int omap_device_register(struct platform_device *pdev) | |||
815 | { | 809 | { |
816 | pr_debug("omap_device: %s: registering\n", pdev->name); | 810 | pr_debug("omap_device: %s: registering\n", pdev->name); |
817 | 811 | ||
818 | pdev->dev.parent = &omap_device_parent; | ||
819 | pdev->dev.pm_domain = &omap_device_pm_domain; | 812 | pdev->dev.pm_domain = &omap_device_pm_domain; |
820 | return platform_device_add(pdev); | 813 | return platform_device_add(pdev); |
821 | } | 814 | } |
@@ -1124,11 +1117,6 @@ int omap_device_enable_clocks(struct omap_device *od) | |||
1124 | return 0; | 1117 | return 0; |
1125 | } | 1118 | } |
1126 | 1119 | ||
1127 | struct device omap_device_parent = { | ||
1128 | .init_name = "omap", | ||
1129 | .parent = &platform_bus, | ||
1130 | }; | ||
1131 | |||
1132 | static struct notifier_block platform_nb = { | 1120 | static struct notifier_block platform_nb = { |
1133 | .notifier_call = _omap_device_notifier_call, | 1121 | .notifier_call = _omap_device_notifier_call, |
1134 | }; | 1122 | }; |
@@ -1136,6 +1124,6 @@ static struct notifier_block platform_nb = { | |||
1136 | static int __init omap_device_init(void) | 1124 | static int __init omap_device_init(void) |
1137 | { | 1125 | { |
1138 | bus_register_notifier(&platform_bus_type, &platform_nb); | 1126 | bus_register_notifier(&platform_bus_type, &platform_nb); |
1139 | return device_register(&omap_device_parent); | 1127 | return 0; |
1140 | } | 1128 | } |
1141 | core_initcall(omap_device_init); | 1129 | core_initcall(omap_device_init); |