diff options
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r-- | arch/arm/mach-shmobile/pm_runtime.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/arch/arm/mach-shmobile/pm_runtime.c b/arch/arm/mach-shmobile/pm_runtime.c index 94912d3944d3..12bb504c7f49 100644 --- a/arch/arm/mach-shmobile/pm_runtime.c +++ b/arch/arm/mach-shmobile/pm_runtime.c | |||
@@ -66,11 +66,11 @@ static void platform_pm_runtime_bug(struct device *dev, | |||
66 | dev_err(dev, "runtime pm suspend before resume\n"); | 66 | dev_err(dev, "runtime pm suspend before resume\n"); |
67 | } | 67 | } |
68 | 68 | ||
69 | int platform_pm_runtime_suspend(struct device *dev) | 69 | static int default_platform_runtime_suspend(struct device *dev) |
70 | { | 70 | { |
71 | struct pm_runtime_data *prd = __to_prd(dev); | 71 | struct pm_runtime_data *prd = __to_prd(dev); |
72 | 72 | ||
73 | dev_dbg(dev, "platform_pm_runtime_suspend()\n"); | 73 | dev_dbg(dev, "%s()\n", __func__); |
74 | 74 | ||
75 | platform_pm_runtime_bug(dev, prd); | 75 | platform_pm_runtime_bug(dev, prd); |
76 | 76 | ||
@@ -82,11 +82,11 @@ int platform_pm_runtime_suspend(struct device *dev) | |||
82 | return 0; | 82 | return 0; |
83 | } | 83 | } |
84 | 84 | ||
85 | int platform_pm_runtime_resume(struct device *dev) | 85 | static int default_platform_runtime_resume(struct device *dev) |
86 | { | 86 | { |
87 | struct pm_runtime_data *prd = __to_prd(dev); | 87 | struct pm_runtime_data *prd = __to_prd(dev); |
88 | 88 | ||
89 | dev_dbg(dev, "platform_pm_runtime_resume()\n"); | 89 | dev_dbg(dev, "%s()\n", __func__); |
90 | 90 | ||
91 | platform_pm_runtime_init(dev, prd); | 91 | platform_pm_runtime_init(dev, prd); |
92 | 92 | ||
@@ -98,12 +98,21 @@ int platform_pm_runtime_resume(struct device *dev) | |||
98 | return 0; | 98 | return 0; |
99 | } | 99 | } |
100 | 100 | ||
101 | int platform_pm_runtime_idle(struct device *dev) | 101 | static int default_platform_runtime_idle(struct device *dev) |
102 | { | 102 | { |
103 | /* suspend synchronously to disable clocks immediately */ | 103 | /* suspend synchronously to disable clocks immediately */ |
104 | return pm_runtime_suspend(dev); | 104 | return pm_runtime_suspend(dev); |
105 | } | 105 | } |
106 | 106 | ||
107 | static struct dev_power_domain default_power_domain = { | ||
108 | .ops = { | ||
109 | .runtime_suspend = default_platform_runtime_suspend, | ||
110 | .runtime_resume = default_platform_runtime_resume, | ||
111 | .runtime_idle = default_platform_runtime_idle, | ||
112 | USE_PLATFORM_PM_SLEEP_OPS | ||
113 | }, | ||
114 | }; | ||
115 | |||
107 | static int platform_bus_notify(struct notifier_block *nb, | 116 | static int platform_bus_notify(struct notifier_block *nb, |
108 | unsigned long action, void *data) | 117 | unsigned long action, void *data) |
109 | { | 118 | { |
@@ -114,10 +123,12 @@ static int platform_bus_notify(struct notifier_block *nb, | |||
114 | 123 | ||
115 | if (action == BUS_NOTIFY_BIND_DRIVER) { | 124 | if (action == BUS_NOTIFY_BIND_DRIVER) { |
116 | prd = devres_alloc(__devres_release, sizeof(*prd), GFP_KERNEL); | 125 | prd = devres_alloc(__devres_release, sizeof(*prd), GFP_KERNEL); |
117 | if (prd) | 126 | if (prd) { |
118 | devres_add(dev, prd); | 127 | devres_add(dev, prd); |
119 | else | 128 | dev->pwr_domain = &default_power_domain; |
129 | } else { | ||
120 | dev_err(dev, "unable to alloc memory for runtime pm\n"); | 130 | dev_err(dev, "unable to alloc memory for runtime pm\n"); |
131 | } | ||
121 | } | 132 | } |
122 | 133 | ||
123 | return 0; | 134 | return 0; |