aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/amba/bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/amba/bus.c')
-rw-r--r--drivers/amba/bus.c136
1 files changed, 1 insertions, 135 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index 936c98cb2475..54eaf96ab217 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -113,31 +113,7 @@ static int amba_legacy_resume(struct device *dev)
113 return ret; 113 return ret;
114} 114}
115 115
116static int amba_pm_prepare(struct device *dev) 116#endif /* CONFIG_PM_SLEEP */
117{
118 struct device_driver *drv = dev->driver;
119 int ret = 0;
120
121 if (drv && drv->pm && drv->pm->prepare)
122 ret = drv->pm->prepare(dev);
123
124 return ret;
125}
126
127static void amba_pm_complete(struct device *dev)
128{
129 struct device_driver *drv = dev->driver;
130
131 if (drv && drv->pm && drv->pm->complete)
132 drv->pm->complete(dev);
133}
134
135#else /* !CONFIG_PM_SLEEP */
136
137#define amba_pm_prepare NULL
138#define amba_pm_complete NULL
139
140#endif /* !CONFIG_PM_SLEEP */
141 117
142#ifdef CONFIG_SUSPEND 118#ifdef CONFIG_SUSPEND
143 119
@@ -159,22 +135,6 @@ static int amba_pm_suspend(struct device *dev)
159 return ret; 135 return ret;
160} 136}
161 137
162static int amba_pm_suspend_noirq(struct device *dev)
163{
164 struct device_driver *drv = dev->driver;
165 int ret = 0;
166
167 if (!drv)
168 return 0;
169
170 if (drv->pm) {
171 if (drv->pm->suspend_noirq)
172 ret = drv->pm->suspend_noirq(dev);
173 }
174
175 return ret;
176}
177
178static int amba_pm_resume(struct device *dev) 138static int amba_pm_resume(struct device *dev)
179{ 139{
180 struct device_driver *drv = dev->driver; 140 struct device_driver *drv = dev->driver;
@@ -193,28 +153,10 @@ static int amba_pm_resume(struct device *dev)
193 return ret; 153 return ret;
194} 154}
195 155
196static int amba_pm_resume_noirq(struct device *dev)
197{
198 struct device_driver *drv = dev->driver;
199 int ret = 0;
200
201 if (!drv)
202 return 0;
203
204 if (drv->pm) {
205 if (drv->pm->resume_noirq)
206 ret = drv->pm->resume_noirq(dev);
207 }
208
209 return ret;
210}
211
212#else /* !CONFIG_SUSPEND */ 156#else /* !CONFIG_SUSPEND */
213 157
214#define amba_pm_suspend NULL 158#define amba_pm_suspend NULL
215#define amba_pm_resume NULL 159#define amba_pm_resume NULL
216#define amba_pm_suspend_noirq NULL
217#define amba_pm_resume_noirq NULL
218 160
219#endif /* !CONFIG_SUSPEND */ 161#endif /* !CONFIG_SUSPEND */
220 162
@@ -238,22 +180,6 @@ static int amba_pm_freeze(struct device *dev)
238 return ret; 180 return ret;
239} 181}
240 182
241static int amba_pm_freeze_noirq(struct device *dev)
242{
243 struct device_driver *drv = dev->driver;
244 int ret = 0;
245
246 if (!drv)
247 return 0;
248
249 if (drv->pm) {
250 if (drv->pm->freeze_noirq)
251 ret = drv->pm->freeze_noirq(dev);
252 }
253
254 return ret;
255}
256
257static int amba_pm_thaw(struct device *dev) 183static int amba_pm_thaw(struct device *dev)
258{ 184{
259 struct device_driver *drv = dev->driver; 185 struct device_driver *drv = dev->driver;
@@ -272,22 +198,6 @@ static int amba_pm_thaw(struct device *dev)
272 return ret; 198 return ret;
273} 199}
274 200
275static int amba_pm_thaw_noirq(struct device *dev)
276{
277 struct device_driver *drv = dev->driver;
278 int ret = 0;
279
280 if (!drv)
281 return 0;
282
283 if (drv->pm) {
284 if (drv->pm->thaw_noirq)
285 ret = drv->pm->thaw_noirq(dev);
286 }
287
288 return ret;
289}
290
291static int amba_pm_poweroff(struct device *dev) 201static int amba_pm_poweroff(struct device *dev)
292{ 202{
293 struct device_driver *drv = dev->driver; 203 struct device_driver *drv = dev->driver;
@@ -306,22 +216,6 @@ static int amba_pm_poweroff(struct device *dev)
306 return ret; 216 return ret;
307} 217}
308 218
309static int amba_pm_poweroff_noirq(struct device *dev)
310{
311 struct device_driver *drv = dev->driver;
312 int ret = 0;
313
314 if (!drv)
315 return 0;
316
317 if (drv->pm) {
318 if (drv->pm->poweroff_noirq)
319 ret = drv->pm->poweroff_noirq(dev);
320 }
321
322 return ret;
323}
324
325static int amba_pm_restore(struct device *dev) 219static int amba_pm_restore(struct device *dev)
326{ 220{
327 struct device_driver *drv = dev->driver; 221 struct device_driver *drv = dev->driver;
@@ -340,32 +234,12 @@ static int amba_pm_restore(struct device *dev)
340 return ret; 234 return ret;
341} 235}
342 236
343static int amba_pm_restore_noirq(struct device *dev)
344{
345 struct device_driver *drv = dev->driver;
346 int ret = 0;
347
348 if (!drv)
349 return 0;
350
351 if (drv->pm) {
352 if (drv->pm->restore_noirq)
353 ret = drv->pm->restore_noirq(dev);
354 }
355
356 return ret;
357}
358
359#else /* !CONFIG_HIBERNATE_CALLBACKS */ 237#else /* !CONFIG_HIBERNATE_CALLBACKS */
360 238
361#define amba_pm_freeze NULL 239#define amba_pm_freeze NULL
362#define amba_pm_thaw NULL 240#define amba_pm_thaw NULL
363#define amba_pm_poweroff NULL 241#define amba_pm_poweroff NULL
364#define amba_pm_restore NULL 242#define amba_pm_restore NULL
365#define amba_pm_freeze_noirq NULL
366#define amba_pm_thaw_noirq NULL
367#define amba_pm_poweroff_noirq NULL
368#define amba_pm_restore_noirq NULL
369 243
370#endif /* !CONFIG_HIBERNATE_CALLBACKS */ 244#endif /* !CONFIG_HIBERNATE_CALLBACKS */
371 245
@@ -406,20 +280,12 @@ static int amba_pm_runtime_resume(struct device *dev)
406#ifdef CONFIG_PM 280#ifdef CONFIG_PM
407 281
408static const struct dev_pm_ops amba_pm = { 282static const struct dev_pm_ops amba_pm = {
409 .prepare = amba_pm_prepare,
410 .complete = amba_pm_complete,
411 .suspend = amba_pm_suspend, 283 .suspend = amba_pm_suspend,
412 .resume = amba_pm_resume, 284 .resume = amba_pm_resume,
413 .freeze = amba_pm_freeze, 285 .freeze = amba_pm_freeze,
414 .thaw = amba_pm_thaw, 286 .thaw = amba_pm_thaw,
415 .poweroff = amba_pm_poweroff, 287 .poweroff = amba_pm_poweroff,
416 .restore = amba_pm_restore, 288 .restore = amba_pm_restore,
417 .suspend_noirq = amba_pm_suspend_noirq,
418 .resume_noirq = amba_pm_resume_noirq,
419 .freeze_noirq = amba_pm_freeze_noirq,
420 .thaw_noirq = amba_pm_thaw_noirq,
421 .poweroff_noirq = amba_pm_poweroff_noirq,
422 .restore_noirq = amba_pm_restore_noirq,
423 SET_RUNTIME_PM_OPS( 289 SET_RUNTIME_PM_OPS(
424 amba_pm_runtime_suspend, 290 amba_pm_runtime_suspend,
425 amba_pm_runtime_resume, 291 amba_pm_runtime_resume,