diff options
98 files changed, 281 insertions, 535 deletions
diff --git a/Documentation/ABI/stable/sysfs-bus-usb b/Documentation/ABI/stable/sysfs-bus-usb index e2bc700a6f9c..831f15d9672f 100644 --- a/Documentation/ABI/stable/sysfs-bus-usb +++ b/Documentation/ABI/stable/sysfs-bus-usb | |||
@@ -32,10 +32,9 @@ Date: January 2008 | |||
32 | KernelVersion: 2.6.25 | 32 | KernelVersion: 2.6.25 |
33 | Contact: Sarah Sharp <sarah.a.sharp@intel.com> | 33 | Contact: Sarah Sharp <sarah.a.sharp@intel.com> |
34 | Description: | 34 | Description: |
35 | If CONFIG_PM_RUNTIME is enabled then this file | 35 | If CONFIG_PM is enabled, then this file is present. When read, |
36 | is present. When read, it returns the total time (in msec) | 36 | it returns the total time (in msec) that the USB device has been |
37 | that the USB device has been connected to the machine. This | 37 | connected to the machine. This file is read-only. |
38 | file is read-only. | ||
39 | Users: | 38 | Users: |
40 | PowerTOP <powertop@lists.01.org> | 39 | PowerTOP <powertop@lists.01.org> |
41 | https://01.org/powertop/ | 40 | https://01.org/powertop/ |
@@ -45,10 +44,9 @@ Date: January 2008 | |||
45 | KernelVersion: 2.6.25 | 44 | KernelVersion: 2.6.25 |
46 | Contact: Sarah Sharp <sarah.a.sharp@intel.com> | 45 | Contact: Sarah Sharp <sarah.a.sharp@intel.com> |
47 | Description: | 46 | Description: |
48 | If CONFIG_PM_RUNTIME is enabled then this file | 47 | If CONFIG_PM is enabled, then this file is present. When read, |
49 | is present. When read, it returns the total time (in msec) | 48 | it returns the total time (in msec) that the USB device has been |
50 | that the USB device has been active, i.e. not in a suspended | 49 | active, i.e. not in a suspended state. This file is read-only. |
51 | state. This file is read-only. | ||
52 | 50 | ||
53 | Tools can use this file and the connected_duration file to | 51 | Tools can use this file and the connected_duration file to |
54 | compute the percentage of time that a device has been active. | 52 | compute the percentage of time that a device has been active. |
diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb index 614d451cee41..e5cc7633d013 100644 --- a/Documentation/ABI/testing/sysfs-bus-usb +++ b/Documentation/ABI/testing/sysfs-bus-usb | |||
@@ -104,16 +104,15 @@ What: /sys/bus/usb/devices/.../power/usb2_hardware_lpm | |||
104 | Date: September 2011 | 104 | Date: September 2011 |
105 | Contact: Andiry Xu <andiry.xu@amd.com> | 105 | Contact: Andiry Xu <andiry.xu@amd.com> |
106 | Description: | 106 | Description: |
107 | If CONFIG_PM_RUNTIME is set and a USB 2.0 lpm-capable device | 107 | If CONFIG_PM is set and a USB 2.0 lpm-capable device is plugged |
108 | is plugged in to a xHCI host which support link PM, it will | 108 | in to a xHCI host which support link PM, it will perform a LPM |
109 | perform a LPM test; if the test is passed and host supports | 109 | test; if the test is passed and host supports USB2 hardware LPM |
110 | USB2 hardware LPM (xHCI 1.0 feature), USB2 hardware LPM will | 110 | (xHCI 1.0 feature), USB2 hardware LPM will be enabled for the |
111 | be enabled for the device and the USB device directory will | 111 | device and the USB device directory will contain a file named |
112 | contain a file named power/usb2_hardware_lpm. The file holds | 112 | power/usb2_hardware_lpm. The file holds a string value (enable |
113 | a string value (enable or disable) indicating whether or not | 113 | or disable) indicating whether or not USB2 hardware LPM is |
114 | USB2 hardware LPM is enabled for the device. Developer can | 114 | enabled for the device. Developer can write y/Y/1 or n/N/0 to |
115 | write y/Y/1 or n/N/0 to the file to enable/disable the | 115 | the file to enable/disable the feature. |
116 | feature. | ||
117 | 116 | ||
118 | What: /sys/bus/usb/devices/.../removable | 117 | What: /sys/bus/usb/devices/.../removable |
119 | Date: February 2012 | 118 | Date: February 2012 |
diff --git a/Documentation/usb/power-management.txt b/Documentation/usb/power-management.txt index 7b90fe034c4b..b5f83911732a 100644 --- a/Documentation/usb/power-management.txt +++ b/Documentation/usb/power-management.txt | |||
@@ -47,14 +47,15 @@ dynamic PM is implemented in the USB subsystem, although system PM is | |||
47 | covered to some extent (see Documentation/power/*.txt for more | 47 | covered to some extent (see Documentation/power/*.txt for more |
48 | information about system PM). | 48 | information about system PM). |
49 | 49 | ||
50 | Note: Dynamic PM support for USB is present only if the kernel was | 50 | System PM support is present only if the kernel was built with CONFIG_SUSPEND |
51 | built with CONFIG_USB_SUSPEND enabled (which depends on | 51 | or CONFIG_HIBERNATION enabled. Dynamic PM support for USB is present whenever |
52 | CONFIG_PM_RUNTIME). System PM support is present only if the kernel | 52 | the kernel was built with CONFIG_PM enabled. |
53 | was built with CONFIG_SUSPEND or CONFIG_HIBERNATION enabled. | 53 | |
54 | 54 | [Historically, dynamic PM support for USB was present only if the | |
55 | (Starting with the 3.10 kernel release, dynamic PM support for USB is | 55 | kernel had been built with CONFIG_USB_SUSPEND enabled (which depended on |
56 | present whenever the kernel was built with CONFIG_PM_RUNTIME enabled. | 56 | CONFIG_PM_RUNTIME). Starting with the 3.10 kernel release, dynamic PM support |
57 | The CONFIG_USB_SUSPEND option has been eliminated.) | 57 | for USB was present whenever the kernel was built with CONFIG_PM_RUNTIME |
58 | enabled. The CONFIG_USB_SUSPEND option had been eliminated.] | ||
58 | 59 | ||
59 | 60 | ||
60 | What is Remote Wakeup? | 61 | What is Remote Wakeup? |
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index c84c88bbbbd7..536d13b0bea6 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -11,7 +11,6 @@ config IA64 | |||
11 | select PCI if (!IA64_HP_SIM) | 11 | select PCI if (!IA64_HP_SIM) |
12 | select ACPI if (!IA64_HP_SIM) | 12 | select ACPI if (!IA64_HP_SIM) |
13 | select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI | 13 | select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI |
14 | select PM if (!IA64_HP_SIM) | ||
15 | select HAVE_UNSTABLE_SCHED_CLOCK | 14 | select HAVE_UNSTABLE_SCHED_CLOCK |
16 | select HAVE_IDE | 15 | select HAVE_IDE |
17 | select HAVE_OPROFILE | 16 | select HAVE_OPROFILE |
@@ -233,6 +232,7 @@ config IA64_SGI_UV | |||
233 | config IA64_HP_SIM | 232 | config IA64_HP_SIM |
234 | bool "Ski-simulator" | 233 | bool "Ski-simulator" |
235 | select SWIOTLB | 234 | select SWIOTLB |
235 | depends on !PM_RUNTIME | ||
236 | 236 | ||
237 | endchoice | 237 | endchoice |
238 | 238 | ||
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 244fb4c81e25..a1403470f80e 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -222,7 +222,6 @@ config CPU_SHX3 | |||
222 | config ARCH_SHMOBILE | 222 | config ARCH_SHMOBILE |
223 | bool | 223 | bool |
224 | select ARCH_SUSPEND_POSSIBLE | 224 | select ARCH_SUSPEND_POSSIBLE |
225 | select PM | ||
226 | select PM_RUNTIME | 225 | select PM_RUNTIME |
227 | 226 | ||
228 | config CPU_HAS_PMU | 227 | config CPU_HAS_PMU |
diff --git a/block/blk-core.c b/block/blk-core.c index 0421b53e6431..2bb7d9c0f63e 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -1325,7 +1325,7 @@ void part_round_stats(int cpu, struct hd_struct *part) | |||
1325 | } | 1325 | } |
1326 | EXPORT_SYMBOL_GPL(part_round_stats); | 1326 | EXPORT_SYMBOL_GPL(part_round_stats); |
1327 | 1327 | ||
1328 | #ifdef CONFIG_PM_RUNTIME | 1328 | #ifdef CONFIG_PM |
1329 | static void blk_pm_put_request(struct request *rq) | 1329 | static void blk_pm_put_request(struct request *rq) |
1330 | { | 1330 | { |
1331 | if (rq->q->dev && !(rq->cmd_flags & REQ_PM) && !--rq->q->nr_pending) | 1331 | if (rq->q->dev && !(rq->cmd_flags & REQ_PM) && !--rq->q->nr_pending) |
@@ -2134,7 +2134,7 @@ void blk_account_io_done(struct request *req) | |||
2134 | } | 2134 | } |
2135 | } | 2135 | } |
2136 | 2136 | ||
2137 | #ifdef CONFIG_PM_RUNTIME | 2137 | #ifdef CONFIG_PM |
2138 | /* | 2138 | /* |
2139 | * Don't process normal requests when queue is suspended | 2139 | * Don't process normal requests when queue is suspended |
2140 | * or in the process of suspending/resuming | 2140 | * or in the process of suspending/resuming |
@@ -3159,7 +3159,7 @@ void blk_finish_plug(struct blk_plug *plug) | |||
3159 | } | 3159 | } |
3160 | EXPORT_SYMBOL(blk_finish_plug); | 3160 | EXPORT_SYMBOL(blk_finish_plug); |
3161 | 3161 | ||
3162 | #ifdef CONFIG_PM_RUNTIME | 3162 | #ifdef CONFIG_PM |
3163 | /** | 3163 | /** |
3164 | * blk_pm_runtime_init - Block layer runtime PM initialization routine | 3164 | * blk_pm_runtime_init - Block layer runtime PM initialization routine |
3165 | * @q: the queue of the device | 3165 | * @q: the queue of the device |
diff --git a/block/elevator.c b/block/elevator.c index afa3b037a17c..59794d0d38e3 100644 --- a/block/elevator.c +++ b/block/elevator.c | |||
@@ -539,7 +539,7 @@ void elv_bio_merged(struct request_queue *q, struct request *rq, | |||
539 | e->type->ops.elevator_bio_merged_fn(q, rq, bio); | 539 | e->type->ops.elevator_bio_merged_fn(q, rq, bio); |
540 | } | 540 | } |
541 | 541 | ||
542 | #ifdef CONFIG_PM_RUNTIME | 542 | #ifdef CONFIG_PM |
543 | static void blk_pm_requeue_request(struct request *rq) | 543 | static void blk_pm_requeue_request(struct request *rq) |
544 | { | 544 | { |
545 | if (rq->q->dev && !(rq->cmd_flags & REQ_PM)) | 545 | if (rq->q->dev && !(rq->cmd_flags & REQ_PM)) |
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index d1dd0ada14b7..4f3febf8a589 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c | |||
@@ -588,7 +588,6 @@ static int acpi_lpss_resume_early(struct device *dev) | |||
588 | } | 588 | } |
589 | #endif /* CONFIG_PM_SLEEP */ | 589 | #endif /* CONFIG_PM_SLEEP */ |
590 | 590 | ||
591 | #ifdef CONFIG_PM_RUNTIME | ||
592 | static int acpi_lpss_runtime_suspend(struct device *dev) | 591 | static int acpi_lpss_runtime_suspend(struct device *dev) |
593 | { | 592 | { |
594 | struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); | 593 | struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); |
@@ -631,11 +630,11 @@ static int acpi_lpss_runtime_resume(struct device *dev) | |||
631 | 630 | ||
632 | return pm_generic_runtime_resume(dev); | 631 | return pm_generic_runtime_resume(dev); |
633 | } | 632 | } |
634 | #endif /* CONFIG_PM_RUNTIME */ | ||
635 | #endif /* CONFIG_PM */ | 633 | #endif /* CONFIG_PM */ |
636 | 634 | ||
637 | static struct dev_pm_domain acpi_lpss_pm_domain = { | 635 | static struct dev_pm_domain acpi_lpss_pm_domain = { |
638 | .ops = { | 636 | .ops = { |
637 | #ifdef CONFIG_PM | ||
639 | #ifdef CONFIG_PM_SLEEP | 638 | #ifdef CONFIG_PM_SLEEP |
640 | .prepare = acpi_subsys_prepare, | 639 | .prepare = acpi_subsys_prepare, |
641 | .complete = acpi_subsys_complete, | 640 | .complete = acpi_subsys_complete, |
@@ -647,7 +646,6 @@ static struct dev_pm_domain acpi_lpss_pm_domain = { | |||
647 | .poweroff_late = acpi_lpss_suspend_late, | 646 | .poweroff_late = acpi_lpss_suspend_late, |
648 | .restore_early = acpi_lpss_resume_early, | 647 | .restore_early = acpi_lpss_resume_early, |
649 | #endif | 648 | #endif |
650 | #ifdef CONFIG_PM_RUNTIME | ||
651 | .runtime_suspend = acpi_lpss_runtime_suspend, | 649 | .runtime_suspend = acpi_lpss_runtime_suspend, |
652 | .runtime_resume = acpi_lpss_runtime_resume, | 650 | .runtime_resume = acpi_lpss_runtime_resume, |
653 | #endif | 651 | #endif |
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index 076af8149566..897640188acd 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c | |||
@@ -692,7 +692,6 @@ static int acpi_device_wakeup(struct acpi_device *adev, u32 target_state, | |||
692 | return 0; | 692 | return 0; |
693 | } | 693 | } |
694 | 694 | ||
695 | #ifdef CONFIG_PM_RUNTIME | ||
696 | /** | 695 | /** |
697 | * acpi_pm_device_run_wake - Enable/disable remote wakeup for given device. | 696 | * acpi_pm_device_run_wake - Enable/disable remote wakeup for given device. |
698 | * @dev: Device to enable/disable the platform to wake up. | 697 | * @dev: Device to enable/disable the platform to wake up. |
@@ -714,7 +713,6 @@ int acpi_pm_device_run_wake(struct device *phys_dev, bool enable) | |||
714 | return acpi_device_wakeup(adev, ACPI_STATE_S0, enable); | 713 | return acpi_device_wakeup(adev, ACPI_STATE_S0, enable); |
715 | } | 714 | } |
716 | EXPORT_SYMBOL(acpi_pm_device_run_wake); | 715 | EXPORT_SYMBOL(acpi_pm_device_run_wake); |
717 | #endif /* CONFIG_PM_RUNTIME */ | ||
718 | 716 | ||
719 | #ifdef CONFIG_PM_SLEEP | 717 | #ifdef CONFIG_PM_SLEEP |
720 | /** | 718 | /** |
@@ -773,7 +771,6 @@ static int acpi_dev_pm_full_power(struct acpi_device *adev) | |||
773 | acpi_device_set_power(adev, ACPI_STATE_D0) : 0; | 771 | acpi_device_set_power(adev, ACPI_STATE_D0) : 0; |
774 | } | 772 | } |
775 | 773 | ||
776 | #ifdef CONFIG_PM_RUNTIME | ||
777 | /** | 774 | /** |
778 | * acpi_dev_runtime_suspend - Put device into a low-power state using ACPI. | 775 | * acpi_dev_runtime_suspend - Put device into a low-power state using ACPI. |
779 | * @dev: Device to put into a low-power state. | 776 | * @dev: Device to put into a low-power state. |
@@ -855,7 +852,6 @@ int acpi_subsys_runtime_resume(struct device *dev) | |||
855 | return ret ? ret : pm_generic_runtime_resume(dev); | 852 | return ret ? ret : pm_generic_runtime_resume(dev); |
856 | } | 853 | } |
857 | EXPORT_SYMBOL_GPL(acpi_subsys_runtime_resume); | 854 | EXPORT_SYMBOL_GPL(acpi_subsys_runtime_resume); |
858 | #endif /* CONFIG_PM_RUNTIME */ | ||
859 | 855 | ||
860 | #ifdef CONFIG_PM_SLEEP | 856 | #ifdef CONFIG_PM_SLEEP |
861 | /** | 857 | /** |
@@ -1023,10 +1019,9 @@ EXPORT_SYMBOL_GPL(acpi_subsys_freeze); | |||
1023 | 1019 | ||
1024 | static struct dev_pm_domain acpi_general_pm_domain = { | 1020 | static struct dev_pm_domain acpi_general_pm_domain = { |
1025 | .ops = { | 1021 | .ops = { |
1026 | #ifdef CONFIG_PM_RUNTIME | 1022 | #ifdef CONFIG_PM |
1027 | .runtime_suspend = acpi_subsys_runtime_suspend, | 1023 | .runtime_suspend = acpi_subsys_runtime_suspend, |
1028 | .runtime_resume = acpi_subsys_runtime_resume, | 1024 | .runtime_resume = acpi_subsys_runtime_resume, |
1029 | #endif | ||
1030 | #ifdef CONFIG_PM_SLEEP | 1025 | #ifdef CONFIG_PM_SLEEP |
1031 | .prepare = acpi_subsys_prepare, | 1026 | .prepare = acpi_subsys_prepare, |
1032 | .complete = acpi_subsys_complete, | 1027 | .complete = acpi_subsys_complete, |
@@ -1038,6 +1033,7 @@ static struct dev_pm_domain acpi_general_pm_domain = { | |||
1038 | .poweroff_late = acpi_subsys_suspend_late, | 1033 | .poweroff_late = acpi_subsys_suspend_late, |
1039 | .restore_early = acpi_subsys_resume_early, | 1034 | .restore_early = acpi_subsys_resume_early, |
1040 | #endif | 1035 | #endif |
1036 | #endif | ||
1041 | }, | 1037 | }, |
1042 | }; | 1038 | }; |
1043 | 1039 | ||
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 6e6b80eb0bba..7cc4e33179f9 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c | |||
@@ -484,7 +484,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev) | |||
484 | /* Keep IOAPIC pin configuration when suspending */ | 484 | /* Keep IOAPIC pin configuration when suspending */ |
485 | if (dev->dev.power.is_prepared) | 485 | if (dev->dev.power.is_prepared) |
486 | return; | 486 | return; |
487 | #ifdef CONFIG_PM_RUNTIME | 487 | #ifdef CONFIG_PM |
488 | if (dev->dev.power.runtime_status == RPM_SUSPENDING) | 488 | if (dev->dev.power.runtime_status == RPM_SUSPENDING) |
489 | return; | 489 | return; |
490 | #endif | 490 | #endif |
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 47bbdc1b5be3..973a3332a85f 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c | |||
@@ -124,7 +124,7 @@ static const struct dev_pm_ops amba_pm = { | |||
124 | .thaw = pm_generic_thaw, | 124 | .thaw = pm_generic_thaw, |
125 | .poweroff = pm_generic_poweroff, | 125 | .poweroff = pm_generic_poweroff, |
126 | .restore = pm_generic_restore, | 126 | .restore = pm_generic_restore, |
127 | SET_PM_RUNTIME_PM_OPS( | 127 | SET_RUNTIME_PM_OPS( |
128 | amba_pm_runtime_suspend, | 128 | amba_pm_runtime_suspend, |
129 | amba_pm_runtime_resume, | 129 | amba_pm_runtime_resume, |
130 | NULL | 130 | NULL |
diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c index b32b5d47b3c5..d626576a4f75 100644 --- a/drivers/base/power/clock_ops.c +++ b/drivers/base/power/clock_ops.c | |||
@@ -256,10 +256,6 @@ void pm_clk_destroy(struct device *dev) | |||
256 | } | 256 | } |
257 | } | 257 | } |
258 | 258 | ||
259 | #endif /* CONFIG_PM */ | ||
260 | |||
261 | #ifdef CONFIG_PM_RUNTIME | ||
262 | |||
263 | /** | 259 | /** |
264 | * pm_clk_suspend - Disable clocks in a device's PM clock list. | 260 | * pm_clk_suspend - Disable clocks in a device's PM clock list. |
265 | * @dev: Device to disable the clocks for. | 261 | * @dev: Device to disable the clocks for. |
@@ -373,68 +369,7 @@ static int pm_clk_notify(struct notifier_block *nb, | |||
373 | return 0; | 369 | return 0; |
374 | } | 370 | } |
375 | 371 | ||
376 | #else /* !CONFIG_PM_RUNTIME */ | 372 | #else /* !CONFIG_PM */ |
377 | |||
378 | #ifdef CONFIG_PM | ||
379 | |||
380 | /** | ||
381 | * pm_clk_suspend - Disable clocks in a device's PM clock list. | ||
382 | * @dev: Device to disable the clocks for. | ||
383 | */ | ||
384 | int pm_clk_suspend(struct device *dev) | ||
385 | { | ||
386 | struct pm_subsys_data *psd = dev_to_psd(dev); | ||
387 | struct pm_clock_entry *ce; | ||
388 | unsigned long flags; | ||
389 | |||
390 | dev_dbg(dev, "%s()\n", __func__); | ||
391 | |||
392 | /* If there is no driver, the clocks are already disabled. */ | ||
393 | if (!psd || !dev->driver) | ||
394 | return 0; | ||
395 | |||
396 | spin_lock_irqsave(&psd->lock, flags); | ||
397 | |||
398 | list_for_each_entry_reverse(ce, &psd->clock_list, node) { | ||
399 | if (ce->status < PCE_STATUS_ERROR) { | ||
400 | if (ce->status == PCE_STATUS_ENABLED) | ||
401 | clk_disable(ce->clk); | ||
402 | ce->status = PCE_STATUS_ACQUIRED; | ||
403 | } | ||
404 | } | ||
405 | |||
406 | spin_unlock_irqrestore(&psd->lock, flags); | ||
407 | |||
408 | return 0; | ||
409 | } | ||
410 | |||
411 | /** | ||
412 | * pm_clk_resume - Enable clocks in a device's PM clock list. | ||
413 | * @dev: Device to enable the clocks for. | ||
414 | */ | ||
415 | int pm_clk_resume(struct device *dev) | ||
416 | { | ||
417 | struct pm_subsys_data *psd = dev_to_psd(dev); | ||
418 | struct pm_clock_entry *ce; | ||
419 | unsigned long flags; | ||
420 | |||
421 | dev_dbg(dev, "%s()\n", __func__); | ||
422 | |||
423 | /* If there is no driver, the clocks should remain disabled. */ | ||
424 | if (!psd || !dev->driver) | ||
425 | return 0; | ||
426 | |||
427 | spin_lock_irqsave(&psd->lock, flags); | ||
428 | |||
429 | list_for_each_entry(ce, &psd->clock_list, node) | ||
430 | __pm_clk_enable(dev, ce); | ||
431 | |||
432 | spin_unlock_irqrestore(&psd->lock, flags); | ||
433 | |||
434 | return 0; | ||
435 | } | ||
436 | |||
437 | #endif /* CONFIG_PM */ | ||
438 | 373 | ||
439 | /** | 374 | /** |
440 | * enable_clock - Enable a device clock. | 375 | * enable_clock - Enable a device clock. |
@@ -514,7 +449,7 @@ static int pm_clk_notify(struct notifier_block *nb, | |||
514 | return 0; | 449 | return 0; |
515 | } | 450 | } |
516 | 451 | ||
517 | #endif /* !CONFIG_PM_RUNTIME */ | 452 | #endif /* !CONFIG_PM */ |
518 | 453 | ||
519 | /** | 454 | /** |
520 | * pm_clk_add_notifier - Add bus type notifier for power management clocks. | 455 | * pm_clk_add_notifier - Add bus type notifier for power management clocks. |
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 5d7b7548873a..6a103a35ea9b 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c | |||
@@ -318,8 +318,6 @@ int pm_genpd_name_poweron(const char *domain_name) | |||
318 | return genpd ? pm_genpd_poweron(genpd) : -EINVAL; | 318 | return genpd ? pm_genpd_poweron(genpd) : -EINVAL; |
319 | } | 319 | } |
320 | 320 | ||
321 | #ifdef CONFIG_PM_RUNTIME | ||
322 | |||
323 | static int genpd_start_dev_no_timing(struct generic_pm_domain *genpd, | 321 | static int genpd_start_dev_no_timing(struct generic_pm_domain *genpd, |
324 | struct device *dev) | 322 | struct device *dev) |
325 | { | 323 | { |
@@ -778,24 +776,6 @@ static int __init genpd_poweroff_unused(void) | |||
778 | } | 776 | } |
779 | late_initcall(genpd_poweroff_unused); | 777 | late_initcall(genpd_poweroff_unused); |
780 | 778 | ||
781 | #else | ||
782 | |||
783 | static inline int genpd_dev_pm_qos_notifier(struct notifier_block *nb, | ||
784 | unsigned long val, void *ptr) | ||
785 | { | ||
786 | return NOTIFY_DONE; | ||
787 | } | ||
788 | |||
789 | static inline void | ||
790 | genpd_queue_power_off_work(struct generic_pm_domain *genpd) {} | ||
791 | |||
792 | static inline void genpd_power_off_work_fn(struct work_struct *work) {} | ||
793 | |||
794 | #define pm_genpd_runtime_suspend NULL | ||
795 | #define pm_genpd_runtime_resume NULL | ||
796 | |||
797 | #endif /* CONFIG_PM_RUNTIME */ | ||
798 | |||
799 | #ifdef CONFIG_PM_SLEEP | 779 | #ifdef CONFIG_PM_SLEEP |
800 | 780 | ||
801 | /** | 781 | /** |
@@ -1384,7 +1364,7 @@ void pm_genpd_syscore_poweron(struct device *dev) | |||
1384 | } | 1364 | } |
1385 | EXPORT_SYMBOL_GPL(pm_genpd_syscore_poweron); | 1365 | EXPORT_SYMBOL_GPL(pm_genpd_syscore_poweron); |
1386 | 1366 | ||
1387 | #else | 1367 | #else /* !CONFIG_PM_SLEEP */ |
1388 | 1368 | ||
1389 | #define pm_genpd_prepare NULL | 1369 | #define pm_genpd_prepare NULL |
1390 | #define pm_genpd_suspend NULL | 1370 | #define pm_genpd_suspend NULL |
@@ -2247,7 +2227,7 @@ int genpd_dev_pm_attach(struct device *dev) | |||
2247 | return 0; | 2227 | return 0; |
2248 | } | 2228 | } |
2249 | EXPORT_SYMBOL_GPL(genpd_dev_pm_attach); | 2229 | EXPORT_SYMBOL_GPL(genpd_dev_pm_attach); |
2250 | #endif | 2230 | #endif /* CONFIG_PM_GENERIC_DOMAINS_OF */ |
2251 | 2231 | ||
2252 | 2232 | ||
2253 | /*** debugfs support ***/ | 2233 | /*** debugfs support ***/ |
@@ -2263,10 +2243,8 @@ static struct dentry *pm_genpd_debugfs_dir; | |||
2263 | 2243 | ||
2264 | /* | 2244 | /* |
2265 | * TODO: This function is a slightly modified version of rtpm_status_show | 2245 | * TODO: This function is a slightly modified version of rtpm_status_show |
2266 | * from sysfs.c, but dependencies between PM_GENERIC_DOMAINS and PM_RUNTIME | 2246 | * from sysfs.c, so generalize it. |
2267 | * are too loose to generalize it. | ||
2268 | */ | 2247 | */ |
2269 | #ifdef CONFIG_PM_RUNTIME | ||
2270 | static void rtpm_status_str(struct seq_file *s, struct device *dev) | 2248 | static void rtpm_status_str(struct seq_file *s, struct device *dev) |
2271 | { | 2249 | { |
2272 | static const char * const status_lookup[] = { | 2250 | static const char * const status_lookup[] = { |
@@ -2288,12 +2266,6 @@ static void rtpm_status_str(struct seq_file *s, struct device *dev) | |||
2288 | 2266 | ||
2289 | seq_puts(s, p); | 2267 | seq_puts(s, p); |
2290 | } | 2268 | } |
2291 | #else | ||
2292 | static void rtpm_status_str(struct seq_file *s, struct device *dev) | ||
2293 | { | ||
2294 | seq_puts(s, "active"); | ||
2295 | } | ||
2296 | #endif | ||
2297 | 2269 | ||
2298 | static int pm_genpd_summary_one(struct seq_file *s, | 2270 | static int pm_genpd_summary_one(struct seq_file *s, |
2299 | struct generic_pm_domain *gpd) | 2271 | struct generic_pm_domain *gpd) |
diff --git a/drivers/base/power/domain_governor.c b/drivers/base/power/domain_governor.c index d88a62e104d4..2a4154a09e4d 100644 --- a/drivers/base/power/domain_governor.c +++ b/drivers/base/power/domain_governor.c | |||
@@ -11,8 +11,6 @@ | |||
11 | #include <linux/pm_qos.h> | 11 | #include <linux/pm_qos.h> |
12 | #include <linux/hrtimer.h> | 12 | #include <linux/hrtimer.h> |
13 | 13 | ||
14 | #ifdef CONFIG_PM_RUNTIME | ||
15 | |||
16 | static int dev_update_qos_constraint(struct device *dev, void *data) | 14 | static int dev_update_qos_constraint(struct device *dev, void *data) |
17 | { | 15 | { |
18 | s64 *constraint_ns_p = data; | 16 | s64 *constraint_ns_p = data; |
@@ -227,15 +225,6 @@ static bool always_on_power_down_ok(struct dev_pm_domain *domain) | |||
227 | return false; | 225 | return false; |
228 | } | 226 | } |
229 | 227 | ||
230 | #else /* !CONFIG_PM_RUNTIME */ | ||
231 | |||
232 | static inline bool default_stop_ok(struct device *dev) { return false; } | ||
233 | |||
234 | #define default_power_down_ok NULL | ||
235 | #define always_on_power_down_ok NULL | ||
236 | |||
237 | #endif /* !CONFIG_PM_RUNTIME */ | ||
238 | |||
239 | struct dev_power_governor simple_qos_governor = { | 228 | struct dev_power_governor simple_qos_governor = { |
240 | .stop_ok = default_stop_ok, | 229 | .stop_ok = default_stop_ok, |
241 | .power_down_ok = default_power_down_ok, | 230 | .power_down_ok = default_power_down_ok, |
diff --git a/drivers/base/power/power.h b/drivers/base/power/power.h index a21223d95926..b6b8a273c5da 100644 --- a/drivers/base/power/power.h +++ b/drivers/base/power/power.h | |||
@@ -9,7 +9,7 @@ static inline void device_pm_init_common(struct device *dev) | |||
9 | } | 9 | } |
10 | } | 10 | } |
11 | 11 | ||
12 | #ifdef CONFIG_PM_RUNTIME | 12 | #ifdef CONFIG_PM |
13 | 13 | ||
14 | static inline void pm_runtime_early_init(struct device *dev) | 14 | static inline void pm_runtime_early_init(struct device *dev) |
15 | { | 15 | { |
@@ -20,7 +20,21 @@ static inline void pm_runtime_early_init(struct device *dev) | |||
20 | extern void pm_runtime_init(struct device *dev); | 20 | extern void pm_runtime_init(struct device *dev); |
21 | extern void pm_runtime_remove(struct device *dev); | 21 | extern void pm_runtime_remove(struct device *dev); |
22 | 22 | ||
23 | #else /* !CONFIG_PM_RUNTIME */ | 23 | /* |
24 | * sysfs.c | ||
25 | */ | ||
26 | |||
27 | extern int dpm_sysfs_add(struct device *dev); | ||
28 | extern void dpm_sysfs_remove(struct device *dev); | ||
29 | extern void rpm_sysfs_remove(struct device *dev); | ||
30 | extern int wakeup_sysfs_add(struct device *dev); | ||
31 | extern void wakeup_sysfs_remove(struct device *dev); | ||
32 | extern int pm_qos_sysfs_add_resume_latency(struct device *dev); | ||
33 | extern void pm_qos_sysfs_remove_resume_latency(struct device *dev); | ||
34 | extern int pm_qos_sysfs_add_flags(struct device *dev); | ||
35 | extern void pm_qos_sysfs_remove_flags(struct device *dev); | ||
36 | |||
37 | #else /* CONFIG_PM */ | ||
24 | 38 | ||
25 | static inline void pm_runtime_early_init(struct device *dev) | 39 | static inline void pm_runtime_early_init(struct device *dev) |
26 | { | 40 | { |
@@ -30,7 +44,15 @@ static inline void pm_runtime_early_init(struct device *dev) | |||
30 | static inline void pm_runtime_init(struct device *dev) {} | 44 | static inline void pm_runtime_init(struct device *dev) {} |
31 | static inline void pm_runtime_remove(struct device *dev) {} | 45 | static inline void pm_runtime_remove(struct device *dev) {} |
32 | 46 | ||
33 | #endif /* !CONFIG_PM_RUNTIME */ | 47 | static inline int dpm_sysfs_add(struct device *dev) { return 0; } |
48 | static inline void dpm_sysfs_remove(struct device *dev) {} | ||
49 | static inline void rpm_sysfs_remove(struct device *dev) {} | ||
50 | static inline int wakeup_sysfs_add(struct device *dev) { return 0; } | ||
51 | static inline void wakeup_sysfs_remove(struct device *dev) {} | ||
52 | static inline int pm_qos_sysfs_add(struct device *dev) { return 0; } | ||
53 | static inline void pm_qos_sysfs_remove(struct device *dev) {} | ||
54 | |||
55 | #endif | ||
34 | 56 | ||
35 | #ifdef CONFIG_PM_SLEEP | 57 | #ifdef CONFIG_PM_SLEEP |
36 | 58 | ||
@@ -77,31 +99,3 @@ static inline void device_pm_init(struct device *dev) | |||
77 | device_pm_sleep_init(dev); | 99 | device_pm_sleep_init(dev); |
78 | pm_runtime_init(dev); | 100 | pm_runtime_init(dev); |
79 | } | 101 | } |
80 | |||
81 | #ifdef CONFIG_PM | ||
82 | |||
83 | /* | ||
84 | * sysfs.c | ||
85 | */ | ||
86 | |||
87 | extern int dpm_sysfs_add(struct device *dev); | ||
88 | extern void dpm_sysfs_remove(struct device *dev); | ||
89 | extern void rpm_sysfs_remove(struct device *dev); | ||
90 | extern int wakeup_sysfs_add(struct device *dev); | ||
91 | extern void wakeup_sysfs_remove(struct device *dev); | ||
92 | extern int pm_qos_sysfs_add_resume_latency(struct device *dev); | ||
93 | extern void pm_qos_sysfs_remove_resume_latency(struct device *dev); | ||
94 | extern int pm_qos_sysfs_add_flags(struct device *dev); | ||
95 | extern void pm_qos_sysfs_remove_flags(struct device *dev); | ||
96 | |||
97 | #else /* CONFIG_PM */ | ||
98 | |||
99 | static inline int dpm_sysfs_add(struct device *dev) { return 0; } | ||
100 | static inline void dpm_sysfs_remove(struct device *dev) {} | ||
101 | static inline void rpm_sysfs_remove(struct device *dev) {} | ||
102 | static inline int wakeup_sysfs_add(struct device *dev) { return 0; } | ||
103 | static inline void wakeup_sysfs_remove(struct device *dev) {} | ||
104 | static inline int pm_qos_sysfs_add(struct device *dev) { return 0; } | ||
105 | static inline void pm_qos_sysfs_remove(struct device *dev) {} | ||
106 | |||
107 | #endif | ||
diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c index 36b9eb4862cb..a8fe4c1a8d07 100644 --- a/drivers/base/power/qos.c +++ b/drivers/base/power/qos.c | |||
@@ -599,7 +599,6 @@ int dev_pm_qos_add_ancestor_request(struct device *dev, | |||
599 | } | 599 | } |
600 | EXPORT_SYMBOL_GPL(dev_pm_qos_add_ancestor_request); | 600 | EXPORT_SYMBOL_GPL(dev_pm_qos_add_ancestor_request); |
601 | 601 | ||
602 | #ifdef CONFIG_PM_RUNTIME | ||
603 | static void __dev_pm_qos_drop_user_request(struct device *dev, | 602 | static void __dev_pm_qos_drop_user_request(struct device *dev, |
604 | enum dev_pm_qos_req_type type) | 603 | enum dev_pm_qos_req_type type) |
605 | { | 604 | { |
@@ -880,7 +879,3 @@ int dev_pm_qos_update_user_latency_tolerance(struct device *dev, s32 val) | |||
880 | mutex_unlock(&dev_pm_qos_mtx); | 879 | mutex_unlock(&dev_pm_qos_mtx); |
881 | return ret; | 880 | return ret; |
882 | } | 881 | } |
883 | #else /* !CONFIG_PM_RUNTIME */ | ||
884 | static void __dev_pm_qos_hide_latency_limit(struct device *dev) {} | ||
885 | static void __dev_pm_qos_hide_flags(struct device *dev) {} | ||
886 | #endif /* CONFIG_PM_RUNTIME */ | ||
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 67c7938e430b..5070c4fe8542 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c | |||
@@ -13,43 +13,38 @@ | |||
13 | #include <trace/events/rpm.h> | 13 | #include <trace/events/rpm.h> |
14 | #include "power.h" | 14 | #include "power.h" |
15 | 15 | ||
16 | #define RPM_GET_CALLBACK(dev, cb) \ | 16 | typedef int (*pm_callback_t)(struct device *); |
17 | ({ \ | ||
18 | int (*__rpm_cb)(struct device *__d); \ | ||
19 | \ | ||
20 | if (dev->pm_domain) \ | ||
21 | __rpm_cb = dev->pm_domain->ops.cb; \ | ||
22 | else if (dev->type && dev->type->pm) \ | ||
23 | __rpm_cb = dev->type->pm->cb; \ | ||
24 | else if (dev->class && dev->class->pm) \ | ||
25 | __rpm_cb = dev->class->pm->cb; \ | ||
26 | else if (dev->bus && dev->bus->pm) \ | ||
27 | __rpm_cb = dev->bus->pm->cb; \ | ||
28 | else \ | ||
29 | __rpm_cb = NULL; \ | ||
30 | \ | ||
31 | if (!__rpm_cb && dev->driver && dev->driver->pm) \ | ||
32 | __rpm_cb = dev->driver->pm->cb; \ | ||
33 | \ | ||
34 | __rpm_cb; \ | ||
35 | }) | ||
36 | |||
37 | static int (*rpm_get_suspend_cb(struct device *dev))(struct device *) | ||
38 | { | ||
39 | return RPM_GET_CALLBACK(dev, runtime_suspend); | ||
40 | } | ||
41 | 17 | ||
42 | static int (*rpm_get_resume_cb(struct device *dev))(struct device *) | 18 | static pm_callback_t __rpm_get_callback(struct device *dev, size_t cb_offset) |
43 | { | 19 | { |
44 | return RPM_GET_CALLBACK(dev, runtime_resume); | 20 | pm_callback_t cb; |
45 | } | 21 | const struct dev_pm_ops *ops; |
22 | |||
23 | if (dev->pm_domain) | ||
24 | ops = &dev->pm_domain->ops; | ||
25 | else if (dev->type && dev->type->pm) | ||
26 | ops = dev->type->pm; | ||
27 | else if (dev->class && dev->class->pm) | ||
28 | ops = dev->class->pm; | ||
29 | else if (dev->bus && dev->bus->pm) | ||
30 | ops = dev->bus->pm; | ||
31 | else | ||
32 | ops = NULL; | ||
46 | 33 | ||
47 | #ifdef CONFIG_PM_RUNTIME | 34 | if (ops) |
48 | static int (*rpm_get_idle_cb(struct device *dev))(struct device *) | 35 | cb = *(pm_callback_t *)((void *)ops + cb_offset); |
49 | { | 36 | else |
50 | return RPM_GET_CALLBACK(dev, runtime_idle); | 37 | cb = NULL; |
38 | |||
39 | if (!cb && dev->driver && dev->driver->pm) | ||
40 | cb = *(pm_callback_t *)((void *)dev->driver->pm + cb_offset); | ||
41 | |||
42 | return cb; | ||
51 | } | 43 | } |
52 | 44 | ||
45 | #define RPM_GET_CALLBACK(dev, callback) \ | ||
46 | __rpm_get_callback(dev, offsetof(struct dev_pm_ops, callback)) | ||
47 | |||
53 | static int rpm_resume(struct device *dev, int rpmflags); | 48 | static int rpm_resume(struct device *dev, int rpmflags); |
54 | static int rpm_suspend(struct device *dev, int rpmflags); | 49 | static int rpm_suspend(struct device *dev, int rpmflags); |
55 | 50 | ||
@@ -347,7 +342,7 @@ static int rpm_idle(struct device *dev, int rpmflags) | |||
347 | 342 | ||
348 | dev->power.idle_notification = true; | 343 | dev->power.idle_notification = true; |
349 | 344 | ||
350 | callback = rpm_get_idle_cb(dev); | 345 | callback = RPM_GET_CALLBACK(dev, runtime_idle); |
351 | 346 | ||
352 | if (callback) | 347 | if (callback) |
353 | retval = __rpm_callback(callback, dev); | 348 | retval = __rpm_callback(callback, dev); |
@@ -517,7 +512,7 @@ static int rpm_suspend(struct device *dev, int rpmflags) | |||
517 | 512 | ||
518 | __update_runtime_status(dev, RPM_SUSPENDING); | 513 | __update_runtime_status(dev, RPM_SUSPENDING); |
519 | 514 | ||
520 | callback = rpm_get_suspend_cb(dev); | 515 | callback = RPM_GET_CALLBACK(dev, runtime_suspend); |
521 | 516 | ||
522 | retval = rpm_callback(callback, dev); | 517 | retval = rpm_callback(callback, dev); |
523 | if (retval) | 518 | if (retval) |
@@ -737,7 +732,7 @@ static int rpm_resume(struct device *dev, int rpmflags) | |||
737 | 732 | ||
738 | __update_runtime_status(dev, RPM_RESUMING); | 733 | __update_runtime_status(dev, RPM_RESUMING); |
739 | 734 | ||
740 | callback = rpm_get_resume_cb(dev); | 735 | callback = RPM_GET_CALLBACK(dev, runtime_resume); |
741 | 736 | ||
742 | retval = rpm_callback(callback, dev); | 737 | retval = rpm_callback(callback, dev); |
743 | if (retval) { | 738 | if (retval) { |
@@ -1402,7 +1397,6 @@ void pm_runtime_remove(struct device *dev) | |||
1402 | if (dev->power.irq_safe && dev->parent) | 1397 | if (dev->power.irq_safe && dev->parent) |
1403 | pm_runtime_put(dev->parent); | 1398 | pm_runtime_put(dev->parent); |
1404 | } | 1399 | } |
1405 | #endif | ||
1406 | 1400 | ||
1407 | /** | 1401 | /** |
1408 | * pm_runtime_force_suspend - Force a device into suspend state if needed. | 1402 | * pm_runtime_force_suspend - Force a device into suspend state if needed. |
@@ -1422,16 +1416,10 @@ int pm_runtime_force_suspend(struct device *dev) | |||
1422 | int ret = 0; | 1416 | int ret = 0; |
1423 | 1417 | ||
1424 | pm_runtime_disable(dev); | 1418 | pm_runtime_disable(dev); |
1425 | |||
1426 | /* | ||
1427 | * Note that pm_runtime_status_suspended() returns false while | ||
1428 | * !CONFIG_PM_RUNTIME, which means the device will be put into low | ||
1429 | * power state. | ||
1430 | */ | ||
1431 | if (pm_runtime_status_suspended(dev)) | 1419 | if (pm_runtime_status_suspended(dev)) |
1432 | return 0; | 1420 | return 0; |
1433 | 1421 | ||
1434 | callback = rpm_get_suspend_cb(dev); | 1422 | callback = RPM_GET_CALLBACK(dev, runtime_suspend); |
1435 | 1423 | ||
1436 | if (!callback) { | 1424 | if (!callback) { |
1437 | ret = -ENOSYS; | 1425 | ret = -ENOSYS; |
@@ -1467,7 +1455,7 @@ int pm_runtime_force_resume(struct device *dev) | |||
1467 | int (*callback)(struct device *); | 1455 | int (*callback)(struct device *); |
1468 | int ret = 0; | 1456 | int ret = 0; |
1469 | 1457 | ||
1470 | callback = rpm_get_resume_cb(dev); | 1458 | callback = RPM_GET_CALLBACK(dev, runtime_resume); |
1471 | 1459 | ||
1472 | if (!callback) { | 1460 | if (!callback) { |
1473 | ret = -ENOSYS; | 1461 | ret = -ENOSYS; |
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c index a9d26ed11bf4..d2be3f9c211c 100644 --- a/drivers/base/power/sysfs.c +++ b/drivers/base/power/sysfs.c | |||
@@ -95,7 +95,6 @@ | |||
95 | const char power_group_name[] = "power"; | 95 | const char power_group_name[] = "power"; |
96 | EXPORT_SYMBOL_GPL(power_group_name); | 96 | EXPORT_SYMBOL_GPL(power_group_name); |
97 | 97 | ||
98 | #ifdef CONFIG_PM_RUNTIME | ||
99 | static const char ctrl_auto[] = "auto"; | 98 | static const char ctrl_auto[] = "auto"; |
100 | static const char ctrl_on[] = "on"; | 99 | static const char ctrl_on[] = "on"; |
101 | 100 | ||
@@ -330,7 +329,6 @@ static ssize_t pm_qos_remote_wakeup_store(struct device *dev, | |||
330 | 329 | ||
331 | static DEVICE_ATTR(pm_qos_remote_wakeup, 0644, | 330 | static DEVICE_ATTR(pm_qos_remote_wakeup, 0644, |
332 | pm_qos_remote_wakeup_show, pm_qos_remote_wakeup_store); | 331 | pm_qos_remote_wakeup_show, pm_qos_remote_wakeup_store); |
333 | #endif /* CONFIG_PM_RUNTIME */ | ||
334 | 332 | ||
335 | #ifdef CONFIG_PM_SLEEP | 333 | #ifdef CONFIG_PM_SLEEP |
336 | static const char _enabled[] = "enabled"; | 334 | static const char _enabled[] = "enabled"; |
@@ -531,8 +529,6 @@ static DEVICE_ATTR(wakeup_prevent_sleep_time_ms, 0444, | |||
531 | #endif /* CONFIG_PM_SLEEP */ | 529 | #endif /* CONFIG_PM_SLEEP */ |
532 | 530 | ||
533 | #ifdef CONFIG_PM_ADVANCED_DEBUG | 531 | #ifdef CONFIG_PM_ADVANCED_DEBUG |
534 | #ifdef CONFIG_PM_RUNTIME | ||
535 | |||
536 | static ssize_t rtpm_usagecount_show(struct device *dev, | 532 | static ssize_t rtpm_usagecount_show(struct device *dev, |
537 | struct device_attribute *attr, char *buf) | 533 | struct device_attribute *attr, char *buf) |
538 | { | 534 | { |
@@ -562,10 +558,7 @@ static DEVICE_ATTR(runtime_usage, 0444, rtpm_usagecount_show, NULL); | |||
562 | static DEVICE_ATTR(runtime_active_kids, 0444, rtpm_children_show, NULL); | 558 | static DEVICE_ATTR(runtime_active_kids, 0444, rtpm_children_show, NULL); |
563 | static DEVICE_ATTR(runtime_enabled, 0444, rtpm_enabled_show, NULL); | 559 | static DEVICE_ATTR(runtime_enabled, 0444, rtpm_enabled_show, NULL); |
564 | 560 | ||
565 | #endif | ||
566 | |||
567 | #ifdef CONFIG_PM_SLEEP | 561 | #ifdef CONFIG_PM_SLEEP |
568 | |||
569 | static ssize_t async_show(struct device *dev, struct device_attribute *attr, | 562 | static ssize_t async_show(struct device *dev, struct device_attribute *attr, |
570 | char *buf) | 563 | char *buf) |
571 | { | 564 | { |
@@ -595,7 +588,7 @@ static ssize_t async_store(struct device *dev, struct device_attribute *attr, | |||
595 | 588 | ||
596 | static DEVICE_ATTR(async, 0644, async_show, async_store); | 589 | static DEVICE_ATTR(async, 0644, async_show, async_store); |
597 | 590 | ||
598 | #endif | 591 | #endif /* CONFIG_PM_SLEEP */ |
599 | #endif /* CONFIG_PM_ADVANCED_DEBUG */ | 592 | #endif /* CONFIG_PM_ADVANCED_DEBUG */ |
600 | 593 | ||
601 | static struct attribute *power_attrs[] = { | 594 | static struct attribute *power_attrs[] = { |
@@ -603,12 +596,10 @@ static struct attribute *power_attrs[] = { | |||
603 | #ifdef CONFIG_PM_SLEEP | 596 | #ifdef CONFIG_PM_SLEEP |
604 | &dev_attr_async.attr, | 597 | &dev_attr_async.attr, |
605 | #endif | 598 | #endif |
606 | #ifdef CONFIG_PM_RUNTIME | ||
607 | &dev_attr_runtime_status.attr, | 599 | &dev_attr_runtime_status.attr, |
608 | &dev_attr_runtime_usage.attr, | 600 | &dev_attr_runtime_usage.attr, |
609 | &dev_attr_runtime_active_kids.attr, | 601 | &dev_attr_runtime_active_kids.attr, |
610 | &dev_attr_runtime_enabled.attr, | 602 | &dev_attr_runtime_enabled.attr, |
611 | #endif | ||
612 | #endif /* CONFIG_PM_ADVANCED_DEBUG */ | 603 | #endif /* CONFIG_PM_ADVANCED_DEBUG */ |
613 | NULL, | 604 | NULL, |
614 | }; | 605 | }; |
@@ -640,7 +631,6 @@ static struct attribute_group pm_wakeup_attr_group = { | |||
640 | }; | 631 | }; |
641 | 632 | ||
642 | static struct attribute *runtime_attrs[] = { | 633 | static struct attribute *runtime_attrs[] = { |
643 | #ifdef CONFIG_PM_RUNTIME | ||
644 | #ifndef CONFIG_PM_ADVANCED_DEBUG | 634 | #ifndef CONFIG_PM_ADVANCED_DEBUG |
645 | &dev_attr_runtime_status.attr, | 635 | &dev_attr_runtime_status.attr, |
646 | #endif | 636 | #endif |
@@ -648,7 +638,6 @@ static struct attribute *runtime_attrs[] = { | |||
648 | &dev_attr_runtime_suspended_time.attr, | 638 | &dev_attr_runtime_suspended_time.attr, |
649 | &dev_attr_runtime_active_time.attr, | 639 | &dev_attr_runtime_active_time.attr, |
650 | &dev_attr_autosuspend_delay_ms.attr, | 640 | &dev_attr_autosuspend_delay_ms.attr, |
651 | #endif /* CONFIG_PM_RUNTIME */ | ||
652 | NULL, | 641 | NULL, |
653 | }; | 642 | }; |
654 | static struct attribute_group pm_runtime_attr_group = { | 643 | static struct attribute_group pm_runtime_attr_group = { |
@@ -657,9 +646,7 @@ static struct attribute_group pm_runtime_attr_group = { | |||
657 | }; | 646 | }; |
658 | 647 | ||
659 | static struct attribute *pm_qos_resume_latency_attrs[] = { | 648 | static struct attribute *pm_qos_resume_latency_attrs[] = { |
660 | #ifdef CONFIG_PM_RUNTIME | ||
661 | &dev_attr_pm_qos_resume_latency_us.attr, | 649 | &dev_attr_pm_qos_resume_latency_us.attr, |
662 | #endif /* CONFIG_PM_RUNTIME */ | ||
663 | NULL, | 650 | NULL, |
664 | }; | 651 | }; |
665 | static struct attribute_group pm_qos_resume_latency_attr_group = { | 652 | static struct attribute_group pm_qos_resume_latency_attr_group = { |
@@ -668,9 +655,7 @@ static struct attribute_group pm_qos_resume_latency_attr_group = { | |||
668 | }; | 655 | }; |
669 | 656 | ||
670 | static struct attribute *pm_qos_latency_tolerance_attrs[] = { | 657 | static struct attribute *pm_qos_latency_tolerance_attrs[] = { |
671 | #ifdef CONFIG_PM_RUNTIME | ||
672 | &dev_attr_pm_qos_latency_tolerance_us.attr, | 658 | &dev_attr_pm_qos_latency_tolerance_us.attr, |
673 | #endif /* CONFIG_PM_RUNTIME */ | ||
674 | NULL, | 659 | NULL, |
675 | }; | 660 | }; |
676 | static struct attribute_group pm_qos_latency_tolerance_attr_group = { | 661 | static struct attribute_group pm_qos_latency_tolerance_attr_group = { |
@@ -679,10 +664,8 @@ static struct attribute_group pm_qos_latency_tolerance_attr_group = { | |||
679 | }; | 664 | }; |
680 | 665 | ||
681 | static struct attribute *pm_qos_flags_attrs[] = { | 666 | static struct attribute *pm_qos_flags_attrs[] = { |
682 | #ifdef CONFIG_PM_RUNTIME | ||
683 | &dev_attr_pm_qos_no_power_off.attr, | 667 | &dev_attr_pm_qos_no_power_off.attr, |
684 | &dev_attr_pm_qos_remote_wakeup.attr, | 668 | &dev_attr_pm_qos_remote_wakeup.attr, |
685 | #endif /* CONFIG_PM_RUNTIME */ | ||
686 | NULL, | 669 | NULL, |
687 | }; | 670 | }; |
688 | static struct attribute_group pm_qos_flags_attr_group = { | 671 | static struct attribute_group pm_qos_flags_attr_group = { |
diff --git a/drivers/char/hw_random/exynos-rng.c b/drivers/char/hw_random/exynos-rng.c index 9f8277cc44b4..993efd7f6c7e 100644 --- a/drivers/char/hw_random/exynos-rng.c +++ b/drivers/char/hw_random/exynos-rng.c | |||
@@ -143,7 +143,7 @@ static int exynos_rng_remove(struct platform_device *pdev) | |||
143 | return 0; | 143 | return 0; |
144 | } | 144 | } |
145 | 145 | ||
146 | #if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME) | 146 | #ifdef CONFIG_PM |
147 | static int exynos_rng_runtime_suspend(struct device *dev) | 147 | static int exynos_rng_runtime_suspend(struct device *dev) |
148 | { | 148 | { |
149 | struct platform_device *pdev = to_platform_device(dev); | 149 | struct platform_device *pdev = to_platform_device(dev); |
diff --git a/drivers/dma/nbpfaxi.c b/drivers/dma/nbpfaxi.c index 5aeada56a442..bda20e6e1007 100644 --- a/drivers/dma/nbpfaxi.c +++ b/drivers/dma/nbpfaxi.c | |||
@@ -1479,7 +1479,7 @@ static struct platform_device_id nbpf_ids[] = { | |||
1479 | }; | 1479 | }; |
1480 | MODULE_DEVICE_TABLE(platform, nbpf_ids); | 1480 | MODULE_DEVICE_TABLE(platform, nbpf_ids); |
1481 | 1481 | ||
1482 | #ifdef CONFIG_PM_RUNTIME | 1482 | #ifdef CONFIG_PM |
1483 | static int nbpf_runtime_suspend(struct device *dev) | 1483 | static int nbpf_runtime_suspend(struct device *dev) |
1484 | { | 1484 | { |
1485 | struct nbpf_device *nbpf = platform_get_drvdata(to_platform_device(dev)); | 1485 | struct nbpf_device *nbpf = platform_get_drvdata(to_platform_device(dev)); |
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 5fe59335e247..d9ca3e32d748 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c | |||
@@ -3051,7 +3051,7 @@ static int dma40_runtime_resume(struct device *dev) | |||
3051 | 3051 | ||
3052 | static const struct dev_pm_ops dma40_pm_ops = { | 3052 | static const struct dev_pm_ops dma40_pm_ops = { |
3053 | SET_LATE_SYSTEM_SLEEP_PM_OPS(dma40_suspend, dma40_resume) | 3053 | SET_LATE_SYSTEM_SLEEP_PM_OPS(dma40_suspend, dma40_resume) |
3054 | SET_PM_RUNTIME_PM_OPS(dma40_runtime_suspend, | 3054 | SET_RUNTIME_PM_OPS(dma40_runtime_suspend, |
3055 | dma40_runtime_resume, | 3055 | dma40_runtime_resume, |
3056 | NULL) | 3056 | NULL) |
3057 | }; | 3057 | }; |
diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c index 16efa603ff65..1c867d0303db 100644 --- a/drivers/dma/tegra20-apb-dma.c +++ b/drivers/dma/tegra20-apb-dma.c | |||
@@ -1587,7 +1587,7 @@ static int tegra_dma_pm_resume(struct device *dev) | |||
1587 | #endif | 1587 | #endif |
1588 | 1588 | ||
1589 | static const struct dev_pm_ops tegra_dma_dev_pm_ops = { | 1589 | static const struct dev_pm_ops tegra_dma_dev_pm_ops = { |
1590 | #ifdef CONFIG_PM_RUNTIME | 1590 | #ifdef CONFIG_PM |
1591 | .runtime_suspend = tegra_dma_runtime_suspend, | 1591 | .runtime_suspend = tegra_dma_runtime_suspend, |
1592 | .runtime_resume = tegra_dma_runtime_resume, | 1592 | .runtime_resume = tegra_dma_runtime_resume, |
1593 | #endif | 1593 | #endif |
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 415682f69214..3d6b445665ad 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
@@ -1259,7 +1259,7 @@ static int omap_gpio_probe(struct platform_device *pdev) | |||
1259 | 1259 | ||
1260 | #ifdef CONFIG_ARCH_OMAP2PLUS | 1260 | #ifdef CONFIG_ARCH_OMAP2PLUS |
1261 | 1261 | ||
1262 | #if defined(CONFIG_PM_RUNTIME) | 1262 | #if defined(CONFIG_PM) |
1263 | static void omap_gpio_restore_context(struct gpio_bank *bank); | 1263 | static void omap_gpio_restore_context(struct gpio_bank *bank); |
1264 | 1264 | ||
1265 | static int omap_gpio_runtime_suspend(struct device *dev) | 1265 | static int omap_gpio_runtime_suspend(struct device *dev) |
@@ -1440,7 +1440,7 @@ static int omap_gpio_runtime_resume(struct device *dev) | |||
1440 | 1440 | ||
1441 | return 0; | 1441 | return 0; |
1442 | } | 1442 | } |
1443 | #endif /* CONFIG_PM_RUNTIME */ | 1443 | #endif /* CONFIG_PM */ |
1444 | 1444 | ||
1445 | void omap2_gpio_prepare_for_idle(int pwr_mode) | 1445 | void omap2_gpio_prepare_for_idle(int pwr_mode) |
1446 | { | 1446 | { |
@@ -1468,7 +1468,7 @@ void omap2_gpio_resume_after_idle(void) | |||
1468 | } | 1468 | } |
1469 | } | 1469 | } |
1470 | 1470 | ||
1471 | #if defined(CONFIG_PM_RUNTIME) | 1471 | #if defined(CONFIG_PM) |
1472 | static void omap_gpio_init_context(struct gpio_bank *p) | 1472 | static void omap_gpio_init_context(struct gpio_bank *p) |
1473 | { | 1473 | { |
1474 | struct omap_gpio_reg_offs *regs = p->regs; | 1474 | struct omap_gpio_reg_offs *regs = p->regs; |
@@ -1525,7 +1525,7 @@ static void omap_gpio_restore_context(struct gpio_bank *bank) | |||
1525 | writel_relaxed(bank->context.irqenable2, | 1525 | writel_relaxed(bank->context.irqenable2, |
1526 | bank->base + bank->regs->irqenable2); | 1526 | bank->base + bank->regs->irqenable2); |
1527 | } | 1527 | } |
1528 | #endif /* CONFIG_PM_RUNTIME */ | 1528 | #endif /* CONFIG_PM */ |
1529 | #else | 1529 | #else |
1530 | #define omap_gpio_runtime_suspend NULL | 1530 | #define omap_gpio_runtime_suspend NULL |
1531 | #define omap_gpio_runtime_resume NULL | 1531 | #define omap_gpio_runtime_resume NULL |
diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index 74cd480bf8de..184c4b1b2558 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c | |||
@@ -578,7 +578,7 @@ static void zynq_gpio_free(struct gpio_chip *chip, unsigned offset) | |||
578 | 578 | ||
579 | static const struct dev_pm_ops zynq_gpio_dev_pm_ops = { | 579 | static const struct dev_pm_ops zynq_gpio_dev_pm_ops = { |
580 | SET_SYSTEM_SLEEP_PM_OPS(zynq_gpio_suspend, zynq_gpio_resume) | 580 | SET_SYSTEM_SLEEP_PM_OPS(zynq_gpio_suspend, zynq_gpio_resume) |
581 | SET_PM_RUNTIME_PM_OPS(zynq_gpio_runtime_suspend, | 581 | SET_RUNTIME_PM_OPS(zynq_gpio_runtime_suspend, |
582 | zynq_gpio_runtime_resume, NULL) | 582 | zynq_gpio_runtime_resume, NULL) |
583 | }; | 583 | }; |
584 | 584 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 68d38eb6774d..835b6af00970 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c | |||
@@ -1817,7 +1817,7 @@ static int fimc_resume(struct device *dev) | |||
1817 | } | 1817 | } |
1818 | #endif | 1818 | #endif |
1819 | 1819 | ||
1820 | #ifdef CONFIG_PM_RUNTIME | 1820 | #ifdef CONFIG_PM |
1821 | static int fimc_runtime_suspend(struct device *dev) | 1821 | static int fimc_runtime_suspend(struct device *dev) |
1822 | { | 1822 | { |
1823 | struct fimc_context *ctx = get_fimc_context(dev); | 1823 | struct fimc_context *ctx = get_fimc_context(dev); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index 6ff8599f6cbf..81a250830808 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c | |||
@@ -1540,7 +1540,7 @@ static int g2d_resume(struct device *dev) | |||
1540 | } | 1540 | } |
1541 | #endif | 1541 | #endif |
1542 | 1542 | ||
1543 | #ifdef CONFIG_PM_RUNTIME | 1543 | #ifdef CONFIG_PM |
1544 | static int g2d_runtime_suspend(struct device *dev) | 1544 | static int g2d_runtime_suspend(struct device *dev) |
1545 | { | 1545 | { |
1546 | struct g2d_data *g2d = dev_get_drvdata(dev); | 1546 | struct g2d_data *g2d = dev_get_drvdata(dev); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index c6a013fc321c..0261468c8019 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c | |||
@@ -1764,7 +1764,7 @@ static int gsc_resume(struct device *dev) | |||
1764 | } | 1764 | } |
1765 | #endif | 1765 | #endif |
1766 | 1766 | ||
1767 | #ifdef CONFIG_PM_RUNTIME | 1767 | #ifdef CONFIG_PM |
1768 | static int gsc_runtime_suspend(struct device *dev) | 1768 | static int gsc_runtime_suspend(struct device *dev) |
1769 | { | 1769 | { |
1770 | struct gsc_context *ctx = get_gsc_context(dev); | 1770 | struct gsc_context *ctx = get_gsc_context(dev); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index b6a37d4f5b13..425e70625388 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c | |||
@@ -822,7 +822,7 @@ static int rotator_resume(struct device *dev) | |||
822 | } | 822 | } |
823 | #endif | 823 | #endif |
824 | 824 | ||
825 | #ifdef CONFIG_PM_RUNTIME | 825 | #ifdef CONFIG_PM |
826 | static int rotator_runtime_suspend(struct device *dev) | 826 | static int rotator_runtime_suspend(struct device *dev) |
827 | { | 827 | { |
828 | struct rot_context *rot = dev_get_drvdata(dev); | 828 | struct rot_context *rot = dev_get_drvdata(dev); |
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c index 747d54421e73..f09e70cafaf1 100644 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c | |||
@@ -1095,7 +1095,7 @@ static int i2c_hid_resume(struct device *dev) | |||
1095 | } | 1095 | } |
1096 | #endif | 1096 | #endif |
1097 | 1097 | ||
1098 | #ifdef CONFIG_PM_RUNTIME | 1098 | #ifdef CONFIG_PM |
1099 | static int i2c_hid_runtime_suspend(struct device *dev) | 1099 | static int i2c_hid_runtime_suspend(struct device *dev) |
1100 | { | 1100 | { |
1101 | struct i2c_client *client = to_i2c_client(dev); | 1101 | struct i2c_client *client = to_i2c_client(dev); |
diff --git a/drivers/hsi/controllers/omap_ssi.c b/drivers/hsi/controllers/omap_ssi.c index bf0eace4cb67..4d5b682fc6af 100644 --- a/drivers/hsi/controllers/omap_ssi.c +++ b/drivers/hsi/controllers/omap_ssi.c | |||
@@ -555,7 +555,7 @@ static int __exit ssi_remove(struct platform_device *pd) | |||
555 | return 0; | 555 | return 0; |
556 | } | 556 | } |
557 | 557 | ||
558 | #ifdef CONFIG_PM_RUNTIME | 558 | #ifdef CONFIG_PM |
559 | static int omap_ssi_runtime_suspend(struct device *dev) | 559 | static int omap_ssi_runtime_suspend(struct device *dev) |
560 | { | 560 | { |
561 | struct hsi_controller *ssi = dev_get_drvdata(dev); | 561 | struct hsi_controller *ssi = dev_get_drvdata(dev); |
diff --git a/drivers/hsi/controllers/omap_ssi_port.c b/drivers/hsi/controllers/omap_ssi_port.c index 4c0b5820581e..d836cfe50513 100644 --- a/drivers/hsi/controllers/omap_ssi_port.c +++ b/drivers/hsi/controllers/omap_ssi_port.c | |||
@@ -1260,7 +1260,7 @@ static int __exit ssi_port_remove(struct platform_device *pd) | |||
1260 | return 0; | 1260 | return 0; |
1261 | } | 1261 | } |
1262 | 1262 | ||
1263 | #ifdef CONFIG_PM_RUNTIME | 1263 | #ifdef CONFIG_PM |
1264 | static int ssi_save_port_ctx(struct omap_ssi_port *omap_port) | 1264 | static int ssi_save_port_ctx(struct omap_ssi_port *omap_port) |
1265 | { | 1265 | { |
1266 | struct hsi_port *port = to_hsi_port(omap_port->dev); | 1266 | struct hsi_port *port = to_hsi_port(omap_port->dev); |
diff --git a/drivers/i2c/busses/i2c-hix5hd2.c b/drivers/i2c/busses/i2c-hix5hd2.c index 9490d0f4255c..8fe78d08e01c 100644 --- a/drivers/i2c/busses/i2c-hix5hd2.c +++ b/drivers/i2c/busses/i2c-hix5hd2.c | |||
@@ -528,7 +528,7 @@ static int hix5hd2_i2c_runtime_resume(struct device *dev) | |||
528 | #endif | 528 | #endif |
529 | 529 | ||
530 | static const struct dev_pm_ops hix5hd2_i2c_pm_ops = { | 530 | static const struct dev_pm_ops hix5hd2_i2c_pm_ops = { |
531 | SET_PM_RUNTIME_PM_OPS(hix5hd2_i2c_runtime_suspend, | 531 | SET_RUNTIME_PM_OPS(hix5hd2_i2c_runtime_suspend, |
532 | hix5hd2_i2c_runtime_resume, | 532 | hix5hd2_i2c_runtime_resume, |
533 | NULL) | 533 | NULL) |
534 | }; | 534 | }; |
diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index 9ad038d223c4..97998946c4f6 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c | |||
@@ -932,7 +932,7 @@ static int nmk_i2c_runtime_resume(struct device *dev) | |||
932 | 932 | ||
933 | static const struct dev_pm_ops nmk_i2c_pm = { | 933 | static const struct dev_pm_ops nmk_i2c_pm = { |
934 | SET_LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early) | 934 | SET_LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early) |
935 | SET_PM_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend, | 935 | SET_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend, |
936 | nmk_i2c_runtime_resume, | 936 | nmk_i2c_runtime_resume, |
937 | NULL) | 937 | NULL) |
938 | }; | 938 | }; |
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 277a2288d4a8..0e650a0d0ad0 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c | |||
@@ -1280,7 +1280,6 @@ static int omap_i2c_remove(struct platform_device *pdev) | |||
1280 | } | 1280 | } |
1281 | 1281 | ||
1282 | #ifdef CONFIG_PM | 1282 | #ifdef CONFIG_PM |
1283 | #ifdef CONFIG_PM_RUNTIME | ||
1284 | static int omap_i2c_runtime_suspend(struct device *dev) | 1283 | static int omap_i2c_runtime_suspend(struct device *dev) |
1285 | { | 1284 | { |
1286 | struct platform_device *pdev = to_platform_device(dev); | 1285 | struct platform_device *pdev = to_platform_device(dev); |
@@ -1318,7 +1317,6 @@ static int omap_i2c_runtime_resume(struct device *dev) | |||
1318 | 1317 | ||
1319 | return 0; | 1318 | return 0; |
1320 | } | 1319 | } |
1321 | #endif /* CONFIG_PM_RUNTIME */ | ||
1322 | 1320 | ||
1323 | static struct dev_pm_ops omap_i2c_pm_ops = { | 1321 | static struct dev_pm_ops omap_i2c_pm_ops = { |
1324 | SET_RUNTIME_PM_OPS(omap_i2c_runtime_suspend, | 1322 | SET_RUNTIME_PM_OPS(omap_i2c_runtime_suspend, |
diff --git a/drivers/iio/accel/bmc150-accel.c b/drivers/iio/accel/bmc150-accel.c index 513bd6d14293..066d0c04072c 100644 --- a/drivers/iio/accel/bmc150-accel.c +++ b/drivers/iio/accel/bmc150-accel.c | |||
@@ -513,7 +513,7 @@ static int bmc150_accel_get_bw(struct bmc150_accel_data *data, int *val, | |||
513 | return -EINVAL; | 513 | return -EINVAL; |
514 | } | 514 | } |
515 | 515 | ||
516 | #ifdef CONFIG_PM_RUNTIME | 516 | #ifdef CONFIG_PM |
517 | static int bmc150_accel_get_startup_times(struct bmc150_accel_data *data) | 517 | static int bmc150_accel_get_startup_times(struct bmc150_accel_data *data) |
518 | { | 518 | { |
519 | int i; | 519 | int i; |
@@ -1371,7 +1371,7 @@ static int bmc150_accel_resume(struct device *dev) | |||
1371 | } | 1371 | } |
1372 | #endif | 1372 | #endif |
1373 | 1373 | ||
1374 | #ifdef CONFIG_PM_RUNTIME | 1374 | #ifdef CONFIG_PM |
1375 | static int bmc150_accel_runtime_suspend(struct device *dev) | 1375 | static int bmc150_accel_runtime_suspend(struct device *dev) |
1376 | { | 1376 | { |
1377 | struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); | 1377 | struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); |
diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c index 320aa72c0349..da2fe93739a2 100644 --- a/drivers/iio/accel/kxcjk-1013.c +++ b/drivers/iio/accel/kxcjk-1013.c | |||
@@ -360,7 +360,7 @@ static int kxcjk1013_chip_init(struct kxcjk1013_data *data) | |||
360 | return 0; | 360 | return 0; |
361 | } | 361 | } |
362 | 362 | ||
363 | #ifdef CONFIG_PM_RUNTIME | 363 | #ifdef CONFIG_PM |
364 | static int kxcjk1013_get_startup_times(struct kxcjk1013_data *data) | 364 | static int kxcjk1013_get_startup_times(struct kxcjk1013_data *data) |
365 | { | 365 | { |
366 | int i; | 366 | int i; |
@@ -1359,7 +1359,7 @@ static int kxcjk1013_resume(struct device *dev) | |||
1359 | } | 1359 | } |
1360 | #endif | 1360 | #endif |
1361 | 1361 | ||
1362 | #ifdef CONFIG_PM_RUNTIME | 1362 | #ifdef CONFIG_PM |
1363 | static int kxcjk1013_runtime_suspend(struct device *dev) | 1363 | static int kxcjk1013_runtime_suspend(struct device *dev) |
1364 | { | 1364 | { |
1365 | struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); | 1365 | struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); |
diff --git a/drivers/iio/gyro/bmg160.c b/drivers/iio/gyro/bmg160.c index d2fa526740ca..60451b328242 100644 --- a/drivers/iio/gyro/bmg160.c +++ b/drivers/iio/gyro/bmg160.c | |||
@@ -256,7 +256,7 @@ static int bmg160_chip_init(struct bmg160_data *data) | |||
256 | 256 | ||
257 | static int bmg160_set_power_state(struct bmg160_data *data, bool on) | 257 | static int bmg160_set_power_state(struct bmg160_data *data, bool on) |
258 | { | 258 | { |
259 | #ifdef CONFIG_PM_RUNTIME | 259 | #ifdef CONFIG_PM |
260 | int ret; | 260 | int ret; |
261 | 261 | ||
262 | if (on) | 262 | if (on) |
@@ -1202,7 +1202,7 @@ static int bmg160_resume(struct device *dev) | |||
1202 | } | 1202 | } |
1203 | #endif | 1203 | #endif |
1204 | 1204 | ||
1205 | #ifdef CONFIG_PM_RUNTIME | 1205 | #ifdef CONFIG_PM |
1206 | static int bmg160_runtime_suspend(struct device *dev) | 1206 | static int bmg160_runtime_suspend(struct device *dev) |
1207 | { | 1207 | { |
1208 | struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); | 1208 | struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); |
diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c index 5e80fbf7b5ed..c994e3bbd776 100644 --- a/drivers/input/keyboard/samsung-keypad.c +++ b/drivers/input/keyboard/samsung-keypad.c | |||
@@ -463,7 +463,7 @@ static int samsung_keypad_remove(struct platform_device *pdev) | |||
463 | return 0; | 463 | return 0; |
464 | } | 464 | } |
465 | 465 | ||
466 | #ifdef CONFIG_PM_RUNTIME | 466 | #ifdef CONFIG_PM |
467 | static int samsung_keypad_runtime_suspend(struct device *dev) | 467 | static int samsung_keypad_runtime_suspend(struct device *dev) |
468 | { | 468 | { |
469 | struct platform_device *pdev = to_platform_device(dev); | 469 | struct platform_device *pdev = to_platform_device(dev); |
diff --git a/drivers/input/touchscreen/cyttsp4_core.c b/drivers/input/touchscreen/cyttsp4_core.c index a035a390f8e2..568a3d340c8a 100644 --- a/drivers/input/touchscreen/cyttsp4_core.c +++ b/drivers/input/touchscreen/cyttsp4_core.c | |||
@@ -1716,7 +1716,7 @@ static void cyttsp4_free_si_ptrs(struct cyttsp4 *cd) | |||
1716 | kfree(si->btn_rec_data); | 1716 | kfree(si->btn_rec_data); |
1717 | } | 1717 | } |
1718 | 1718 | ||
1719 | #if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME) | 1719 | #ifdef CONFIG_PM |
1720 | static int cyttsp4_core_sleep(struct cyttsp4 *cd) | 1720 | static int cyttsp4_core_sleep(struct cyttsp4 *cd) |
1721 | { | 1721 | { |
1722 | int rc; | 1722 | int rc; |
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index ced47609f5ef..5f0cd5cafea2 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c | |||
@@ -1980,7 +1980,7 @@ static int coda_probe(struct platform_device *pdev) | |||
1980 | 1980 | ||
1981 | /* | 1981 | /* |
1982 | * Start activated so we can directly call coda_hw_init in | 1982 | * Start activated so we can directly call coda_hw_init in |
1983 | * coda_fw_callback regardless of whether CONFIG_PM_RUNTIME is | 1983 | * coda_fw_callback regardless of whether CONFIG_PM is |
1984 | * enabled or whether the device is associated with a PM domain. | 1984 | * enabled or whether the device is associated with a PM domain. |
1985 | */ | 1985 | */ |
1986 | pm_runtime_get_noresume(&pdev->dev); | 1986 | pm_runtime_get_noresume(&pdev->dev); |
@@ -2013,7 +2013,7 @@ static int coda_remove(struct platform_device *pdev) | |||
2013 | return 0; | 2013 | return 0; |
2014 | } | 2014 | } |
2015 | 2015 | ||
2016 | #ifdef CONFIG_PM_RUNTIME | 2016 | #ifdef CONFIG_PM |
2017 | static int coda_runtime_resume(struct device *dev) | 2017 | static int coda_runtime_resume(struct device *dev) |
2018 | { | 2018 | { |
2019 | struct coda_dev *cdev = dev_get_drvdata(dev); | 2019 | struct coda_dev *cdev = dev_get_drvdata(dev); |
diff --git a/drivers/media/platform/exynos4-is/fimc-core.c b/drivers/media/platform/exynos4-is/fimc-core.c index aee92d908e49..f5d85520caf3 100644 --- a/drivers/media/platform/exynos4-is/fimc-core.c +++ b/drivers/media/platform/exynos4-is/fimc-core.c | |||
@@ -832,7 +832,7 @@ err: | |||
832 | return -ENXIO; | 832 | return -ENXIO; |
833 | } | 833 | } |
834 | 834 | ||
835 | #if defined(CONFIG_PM_RUNTIME) || defined(CONFIG_PM_SLEEP) | 835 | #ifdef CONFIG_PM |
836 | static int fimc_m2m_suspend(struct fimc_dev *fimc) | 836 | static int fimc_m2m_suspend(struct fimc_dev *fimc) |
837 | { | 837 | { |
838 | unsigned long flags; | 838 | unsigned long flags; |
@@ -871,7 +871,7 @@ static int fimc_m2m_resume(struct fimc_dev *fimc) | |||
871 | 871 | ||
872 | return 0; | 872 | return 0; |
873 | } | 873 | } |
874 | #endif /* CONFIG_PM_RUNTIME || CONFIG_PM_SLEEP */ | 874 | #endif /* CONFIG_PM */ |
875 | 875 | ||
876 | static const struct of_device_id fimc_of_match[]; | 876 | static const struct of_device_id fimc_of_match[]; |
877 | 877 | ||
@@ -1039,7 +1039,7 @@ err_sclk: | |||
1039 | return ret; | 1039 | return ret; |
1040 | } | 1040 | } |
1041 | 1041 | ||
1042 | #ifdef CONFIG_PM_RUNTIME | 1042 | #ifdef CONFIG_PM |
1043 | static int fimc_runtime_resume(struct device *dev) | 1043 | static int fimc_runtime_resume(struct device *dev) |
1044 | { | 1044 | { |
1045 | struct fimc_dev *fimc = dev_get_drvdata(dev); | 1045 | struct fimc_dev *fimc = dev_get_drvdata(dev); |
diff --git a/drivers/media/platform/exynos4-is/fimc-is-i2c.c b/drivers/media/platform/exynos4-is/fimc-is-i2c.c index 371cad4fcce9..d83033170789 100644 --- a/drivers/media/platform/exynos4-is/fimc-is-i2c.c +++ b/drivers/media/platform/exynos4-is/fimc-is-i2c.c | |||
@@ -81,7 +81,7 @@ static int fimc_is_i2c_remove(struct platform_device *pdev) | |||
81 | return 0; | 81 | return 0; |
82 | } | 82 | } |
83 | 83 | ||
84 | #if defined(CONFIG_PM_RUNTIME) || defined(CONFIG_PM_SLEEP) | 84 | #ifdef CONFIG_PM |
85 | static int fimc_is_i2c_runtime_suspend(struct device *dev) | 85 | static int fimc_is_i2c_runtime_suspend(struct device *dev) |
86 | { | 86 | { |
87 | struct fimc_is_i2c *isp_i2c = dev_get_drvdata(dev); | 87 | struct fimc_is_i2c *isp_i2c = dev_get_drvdata(dev); |
diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c index a97d2352f1d7..6c1eb308f7b5 100644 --- a/drivers/media/platform/exynos4-is/fimc-lite.c +++ b/drivers/media/platform/exynos4-is/fimc-lite.c | |||
@@ -1588,7 +1588,7 @@ err_clk_put: | |||
1588 | return ret; | 1588 | return ret; |
1589 | } | 1589 | } |
1590 | 1590 | ||
1591 | #ifdef CONFIG_PM_RUNTIME | 1591 | #ifdef CONFIG_PM |
1592 | static int fimc_lite_runtime_resume(struct device *dev) | 1592 | static int fimc_lite_runtime_resume(struct device *dev) |
1593 | { | 1593 | { |
1594 | struct fimc_lite *fimc = dev_get_drvdata(dev); | 1594 | struct fimc_lite *fimc = dev_get_drvdata(dev); |
diff --git a/drivers/media/platform/exynos4-is/mipi-csis.c b/drivers/media/platform/exynos4-is/mipi-csis.c index db6fd14d1936..be5d6fc895cb 100644 --- a/drivers/media/platform/exynos4-is/mipi-csis.c +++ b/drivers/media/platform/exynos4-is/mipi-csis.c | |||
@@ -978,7 +978,7 @@ static int s5pcsis_resume(struct device *dev) | |||
978 | } | 978 | } |
979 | #endif | 979 | #endif |
980 | 980 | ||
981 | #ifdef CONFIG_PM_RUNTIME | 981 | #ifdef CONFIG_PM |
982 | static int s5pcsis_runtime_suspend(struct device *dev) | 982 | static int s5pcsis_runtime_suspend(struct device *dev) |
983 | { | 983 | { |
984 | return s5pcsis_pm_suspend(dev, true); | 984 | return s5pcsis_pm_suspend(dev, true); |
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c index 6fcc7f072ace..fe2727413f3a 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c | |||
@@ -2632,7 +2632,7 @@ static int s5p_jpeg_remove(struct platform_device *pdev) | |||
2632 | return 0; | 2632 | return 0; |
2633 | } | 2633 | } |
2634 | 2634 | ||
2635 | #if defined(CONFIG_PM_RUNTIME) || defined(CONFIG_PM_SLEEP) | 2635 | #ifdef CONFIG_PM |
2636 | static int s5p_jpeg_runtime_suspend(struct device *dev) | 2636 | static int s5p_jpeg_runtime_suspend(struct device *dev) |
2637 | { | 2637 | { |
2638 | struct s5p_jpeg *jpeg = dev_get_drvdata(dev); | 2638 | struct s5p_jpeg *jpeg = dev_get_drvdata(dev); |
@@ -2682,7 +2682,7 @@ static int s5p_jpeg_runtime_resume(struct device *dev) | |||
2682 | 2682 | ||
2683 | return 0; | 2683 | return 0; |
2684 | } | 2684 | } |
2685 | #endif /* CONFIG_PM_RUNTIME || CONFIG_PM_SLEEP */ | 2685 | #endif /* CONFIG_PM */ |
2686 | 2686 | ||
2687 | #ifdef CONFIG_PM_SLEEP | 2687 | #ifdef CONFIG_PM_SLEEP |
2688 | static int s5p_jpeg_suspend(struct device *dev) | 2688 | static int s5p_jpeg_suspend(struct device *dev) |
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 165bc86c5962..363fd8c0a699 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c | |||
@@ -1302,7 +1302,7 @@ static int s5p_mfc_resume(struct device *dev) | |||
1302 | } | 1302 | } |
1303 | #endif | 1303 | #endif |
1304 | 1304 | ||
1305 | #ifdef CONFIG_PM_RUNTIME | 1305 | #ifdef CONFIG_PM |
1306 | static int s5p_mfc_runtime_suspend(struct device *dev) | 1306 | static int s5p_mfc_runtime_suspend(struct device *dev) |
1307 | { | 1307 | { |
1308 | struct platform_device *pdev = to_platform_device(dev); | 1308 | struct platform_device *pdev = to_platform_device(dev); |
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c b/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c index 826c48945bf5..5f97a3398c11 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c | |||
@@ -13,9 +13,7 @@ | |||
13 | #include <linux/clk.h> | 13 | #include <linux/clk.h> |
14 | #include <linux/err.h> | 14 | #include <linux/err.h> |
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #ifdef CONFIG_PM_RUNTIME | ||
17 | #include <linux/pm_runtime.h> | 16 | #include <linux/pm_runtime.h> |
18 | #endif | ||
19 | #include "s5p_mfc_common.h" | 17 | #include "s5p_mfc_common.h" |
20 | #include "s5p_mfc_debug.h" | 18 | #include "s5p_mfc_debug.h" |
21 | #include "s5p_mfc_pm.h" | 19 | #include "s5p_mfc_pm.h" |
@@ -67,7 +65,7 @@ int s5p_mfc_init_pm(struct s5p_mfc_dev *dev) | |||
67 | } | 65 | } |
68 | 66 | ||
69 | atomic_set(&pm->power, 0); | 67 | atomic_set(&pm->power, 0); |
70 | #ifdef CONFIG_PM_RUNTIME | 68 | #ifdef CONFIG_PM |
71 | pm->device = &dev->plat_dev->dev; | 69 | pm->device = &dev->plat_dev->dev; |
72 | pm_runtime_enable(pm->device); | 70 | pm_runtime_enable(pm->device); |
73 | #endif | 71 | #endif |
@@ -93,7 +91,7 @@ void s5p_mfc_final_pm(struct s5p_mfc_dev *dev) | |||
93 | } | 91 | } |
94 | clk_unprepare(pm->clock_gate); | 92 | clk_unprepare(pm->clock_gate); |
95 | clk_put(pm->clock_gate); | 93 | clk_put(pm->clock_gate); |
96 | #ifdef CONFIG_PM_RUNTIME | 94 | #ifdef CONFIG_PM |
97 | pm_runtime_disable(pm->device); | 95 | pm_runtime_disable(pm->device); |
98 | #endif | 96 | #endif |
99 | } | 97 | } |
@@ -120,7 +118,7 @@ void s5p_mfc_clock_off(void) | |||
120 | 118 | ||
121 | int s5p_mfc_power_on(void) | 119 | int s5p_mfc_power_on(void) |
122 | { | 120 | { |
123 | #ifdef CONFIG_PM_RUNTIME | 121 | #ifdef CONFIG_PM |
124 | return pm_runtime_get_sync(pm->device); | 122 | return pm_runtime_get_sync(pm->device); |
125 | #else | 123 | #else |
126 | atomic_set(&pm->power, 1); | 124 | atomic_set(&pm->power, 1); |
@@ -130,7 +128,7 @@ int s5p_mfc_power_on(void) | |||
130 | 128 | ||
131 | int s5p_mfc_power_off(void) | 129 | int s5p_mfc_power_off(void) |
132 | { | 130 | { |
133 | #ifdef CONFIG_PM_RUNTIME | 131 | #ifdef CONFIG_PM |
134 | return pm_runtime_put_sync(pm->device); | 132 | return pm_runtime_put_sync(pm->device); |
135 | #else | 133 | #else |
136 | atomic_set(&pm->power, 0); | 134 | atomic_set(&pm->power, 0); |
diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c index 36000f920981..8e3168d160b2 100644 --- a/drivers/mfd/ab8500-gpadc.c +++ b/drivers/mfd/ab8500-gpadc.c | |||
@@ -867,7 +867,7 @@ static void ab8500_gpadc_read_calibration_data(struct ab8500_gpadc *gpadc) | |||
867 | gpadc->cal_data[ADC_INPUT_VBAT].offset); | 867 | gpadc->cal_data[ADC_INPUT_VBAT].offset); |
868 | } | 868 | } |
869 | 869 | ||
870 | #ifdef CONFIG_PM_RUNTIME | 870 | #ifdef CONFIG_PM |
871 | static int ab8500_gpadc_runtime_suspend(struct device *dev) | 871 | static int ab8500_gpadc_runtime_suspend(struct device *dev) |
872 | { | 872 | { |
873 | struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); | 873 | struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); |
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c index bce7c0784b6b..09ba8f186e6a 100644 --- a/drivers/mfd/arizona-core.c +++ b/drivers/mfd/arizona-core.c | |||
@@ -330,7 +330,7 @@ err_fll: | |||
330 | return err; | 330 | return err; |
331 | } | 331 | } |
332 | 332 | ||
333 | #ifdef CONFIG_PM_RUNTIME | 333 | #ifdef CONFIG_PM |
334 | static int arizona_runtime_resume(struct device *dev) | 334 | static int arizona_runtime_resume(struct device *dev) |
335 | { | 335 | { |
336 | struct arizona *arizona = dev_get_drvdata(dev); | 336 | struct arizona *arizona = dev_get_drvdata(dev); |
@@ -1024,7 +1024,7 @@ int arizona_dev_init(struct arizona *arizona) | |||
1024 | goto err_irq; | 1024 | goto err_irq; |
1025 | } | 1025 | } |
1026 | 1026 | ||
1027 | #ifdef CONFIG_PM_RUNTIME | 1027 | #ifdef CONFIG_PM |
1028 | regulator_disable(arizona->dcvdd); | 1028 | regulator_disable(arizona->dcvdd); |
1029 | #endif | 1029 | #endif |
1030 | 1030 | ||
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index e6fab94e2c8a..6ca9d25cc3f0 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c | |||
@@ -116,7 +116,7 @@ static const char *wm8958_main_supplies[] = { | |||
116 | "SPKVDD2", | 116 | "SPKVDD2", |
117 | }; | 117 | }; |
118 | 118 | ||
119 | #ifdef CONFIG_PM_RUNTIME | 119 | #ifdef CONFIG_PM |
120 | static int wm8994_suspend(struct device *dev) | 120 | static int wm8994_suspend(struct device *dev) |
121 | { | 121 | { |
122 | struct wm8994 *wm8994 = dev_get_drvdata(dev); | 122 | struct wm8994 *wm8994 = dev_get_drvdata(dev); |
diff --git a/drivers/misc/apds990x.c b/drivers/misc/apds990x.c index 868a30a1b417..3739ffa9cdf1 100644 --- a/drivers/misc/apds990x.c +++ b/drivers/misc/apds990x.c | |||
@@ -609,7 +609,7 @@ static int apds990x_detect(struct apds990x_chip *chip) | |||
609 | return ret; | 609 | return ret; |
610 | } | 610 | } |
611 | 611 | ||
612 | #if defined(CONFIG_PM) || defined(CONFIG_PM_RUNTIME) | 612 | #ifdef CONFIG_PM |
613 | static int apds990x_chip_on(struct apds990x_chip *chip) | 613 | static int apds990x_chip_on(struct apds990x_chip *chip) |
614 | { | 614 | { |
615 | int err = regulator_bulk_enable(ARRAY_SIZE(chip->regs), | 615 | int err = regulator_bulk_enable(ARRAY_SIZE(chip->regs), |
@@ -1237,7 +1237,7 @@ static int apds990x_resume(struct device *dev) | |||
1237 | } | 1237 | } |
1238 | #endif | 1238 | #endif |
1239 | 1239 | ||
1240 | #ifdef CONFIG_PM_RUNTIME | 1240 | #ifdef CONFIG_PM |
1241 | static int apds990x_runtime_suspend(struct device *dev) | 1241 | static int apds990x_runtime_suspend(struct device *dev) |
1242 | { | 1242 | { |
1243 | struct i2c_client *client = container_of(dev, struct i2c_client, dev); | 1243 | struct i2c_client *client = container_of(dev, struct i2c_client, dev); |
diff --git a/drivers/misc/bh1770glc.c b/drivers/misc/bh1770glc.c index 7b55f8a152d4..b756381b8250 100644 --- a/drivers/misc/bh1770glc.c +++ b/drivers/misc/bh1770glc.c | |||
@@ -1358,7 +1358,7 @@ static int bh1770_resume(struct device *dev) | |||
1358 | } | 1358 | } |
1359 | #endif | 1359 | #endif |
1360 | 1360 | ||
1361 | #ifdef CONFIG_PM_RUNTIME | 1361 | #ifdef CONFIG_PM |
1362 | static int bh1770_runtime_suspend(struct device *dev) | 1362 | static int bh1770_runtime_suspend(struct device *dev) |
1363 | { | 1363 | { |
1364 | struct i2c_client *client = container_of(dev, struct i2c_client, dev); | 1364 | struct i2c_client *client = container_of(dev, struct i2c_client, dev); |
diff --git a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c index d324f8a97b88..63fe096d4462 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c +++ b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c | |||
@@ -235,7 +235,7 @@ static int lis3lv02d_i2c_resume(struct device *dev) | |||
235 | } | 235 | } |
236 | #endif /* CONFIG_PM_SLEEP */ | 236 | #endif /* CONFIG_PM_SLEEP */ |
237 | 237 | ||
238 | #ifdef CONFIG_PM_RUNTIME | 238 | #ifdef CONFIG_PM |
239 | static int lis3_i2c_runtime_suspend(struct device *dev) | 239 | static int lis3_i2c_runtime_suspend(struct device *dev) |
240 | { | 240 | { |
241 | struct i2c_client *client = container_of(dev, struct i2c_client, dev); | 241 | struct i2c_client *client = container_of(dev, struct i2c_client, dev); |
@@ -253,7 +253,7 @@ static int lis3_i2c_runtime_resume(struct device *dev) | |||
253 | lis3lv02d_poweron(lis3); | 253 | lis3lv02d_poweron(lis3); |
254 | return 0; | 254 | return 0; |
255 | } | 255 | } |
256 | #endif /* CONFIG_PM_RUNTIME */ | 256 | #endif /* CONFIG_PM */ |
257 | 257 | ||
258 | static const struct i2c_device_id lis3lv02d_id[] = { | 258 | static const struct i2c_device_id lis3lv02d_id[] = { |
259 | {"lis3lv02d", LIS3LV02D}, | 259 | {"lis3lv02d", LIS3LV02D}, |
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h index 71744b16cc8c..61b04d7646f1 100644 --- a/drivers/misc/mei/mei_dev.h +++ b/drivers/misc/mei/mei_dev.h | |||
@@ -530,9 +530,9 @@ struct mei_device { | |||
530 | * Power Gating support | 530 | * Power Gating support |
531 | */ | 531 | */ |
532 | enum mei_pg_event pg_event; | 532 | enum mei_pg_event pg_event; |
533 | #ifdef CONFIG_PM_RUNTIME | 533 | #ifdef CONFIG_PM |
534 | struct dev_pm_domain pg_domain; | 534 | struct dev_pm_domain pg_domain; |
535 | #endif /* CONFIG_PM_RUNTIME */ | 535 | #endif /* CONFIG_PM */ |
536 | 536 | ||
537 | unsigned char rd_msg_buf[MEI_RD_MSG_BUF_SIZE]; | 537 | unsigned char rd_msg_buf[MEI_RD_MSG_BUF_SIZE]; |
538 | u32 rd_msg_hdr; | 538 | u32 rd_msg_hdr; |
diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c index f3225b1643ab..cf20d397068a 100644 --- a/drivers/misc/mei/pci-me.c +++ b/drivers/misc/mei/pci-me.c | |||
@@ -89,13 +89,13 @@ static const struct pci_device_id mei_me_pci_tbl[] = { | |||
89 | 89 | ||
90 | MODULE_DEVICE_TABLE(pci, mei_me_pci_tbl); | 90 | MODULE_DEVICE_TABLE(pci, mei_me_pci_tbl); |
91 | 91 | ||
92 | #ifdef CONFIG_PM_RUNTIME | 92 | #ifdef CONFIG_PM |
93 | static inline void mei_me_set_pm_domain(struct mei_device *dev); | 93 | static inline void mei_me_set_pm_domain(struct mei_device *dev); |
94 | static inline void mei_me_unset_pm_domain(struct mei_device *dev); | 94 | static inline void mei_me_unset_pm_domain(struct mei_device *dev); |
95 | #else | 95 | #else |
96 | static inline void mei_me_set_pm_domain(struct mei_device *dev) {} | 96 | static inline void mei_me_set_pm_domain(struct mei_device *dev) {} |
97 | static inline void mei_me_unset_pm_domain(struct mei_device *dev) {} | 97 | static inline void mei_me_unset_pm_domain(struct mei_device *dev) {} |
98 | #endif /* CONFIG_PM_RUNTIME */ | 98 | #endif /* CONFIG_PM */ |
99 | 99 | ||
100 | /** | 100 | /** |
101 | * mei_me_quirk_probe - probe for devices that doesn't valid ME interface | 101 | * mei_me_quirk_probe - probe for devices that doesn't valid ME interface |
@@ -357,7 +357,7 @@ static int mei_me_pci_resume(struct device *device) | |||
357 | } | 357 | } |
358 | #endif /* CONFIG_PM_SLEEP */ | 358 | #endif /* CONFIG_PM_SLEEP */ |
359 | 359 | ||
360 | #ifdef CONFIG_PM_RUNTIME | 360 | #ifdef CONFIG_PM |
361 | static int mei_me_pm_runtime_idle(struct device *device) | 361 | static int mei_me_pm_runtime_idle(struct device *device) |
362 | { | 362 | { |
363 | struct pci_dev *pdev = to_pci_dev(device); | 363 | struct pci_dev *pdev = to_pci_dev(device); |
@@ -453,9 +453,7 @@ static inline void mei_me_unset_pm_domain(struct mei_device *dev) | |||
453 | /* stop using pm callbacks if any */ | 453 | /* stop using pm callbacks if any */ |
454 | dev->dev->pm_domain = NULL; | 454 | dev->dev->pm_domain = NULL; |
455 | } | 455 | } |
456 | #endif /* CONFIG_PM_RUNTIME */ | ||
457 | 456 | ||
458 | #ifdef CONFIG_PM | ||
459 | static const struct dev_pm_ops mei_me_pm_ops = { | 457 | static const struct dev_pm_ops mei_me_pm_ops = { |
460 | SET_SYSTEM_SLEEP_PM_OPS(mei_me_pci_suspend, | 458 | SET_SYSTEM_SLEEP_PM_OPS(mei_me_pci_suspend, |
461 | mei_me_pci_resume) | 459 | mei_me_pci_resume) |
diff --git a/drivers/misc/mei/pci-txe.c b/drivers/misc/mei/pci-txe.c index bee1c6fb7e75..1f572deacf54 100644 --- a/drivers/misc/mei/pci-txe.c +++ b/drivers/misc/mei/pci-txe.c | |||
@@ -42,13 +42,13 @@ static const struct pci_device_id mei_txe_pci_tbl[] = { | |||
42 | }; | 42 | }; |
43 | MODULE_DEVICE_TABLE(pci, mei_txe_pci_tbl); | 43 | MODULE_DEVICE_TABLE(pci, mei_txe_pci_tbl); |
44 | 44 | ||
45 | #ifdef CONFIG_PM_RUNTIME | 45 | #ifdef CONFIG_PM |
46 | static inline void mei_txe_set_pm_domain(struct mei_device *dev); | 46 | static inline void mei_txe_set_pm_domain(struct mei_device *dev); |
47 | static inline void mei_txe_unset_pm_domain(struct mei_device *dev); | 47 | static inline void mei_txe_unset_pm_domain(struct mei_device *dev); |
48 | #else | 48 | #else |
49 | static inline void mei_txe_set_pm_domain(struct mei_device *dev) {} | 49 | static inline void mei_txe_set_pm_domain(struct mei_device *dev) {} |
50 | static inline void mei_txe_unset_pm_domain(struct mei_device *dev) {} | 50 | static inline void mei_txe_unset_pm_domain(struct mei_device *dev) {} |
51 | #endif /* CONFIG_PM_RUNTIME */ | 51 | #endif /* CONFIG_PM */ |
52 | 52 | ||
53 | static void mei_txe_pci_iounmap(struct pci_dev *pdev, struct mei_txe_hw *hw) | 53 | static void mei_txe_pci_iounmap(struct pci_dev *pdev, struct mei_txe_hw *hw) |
54 | { | 54 | { |
@@ -295,7 +295,7 @@ static int mei_txe_pci_resume(struct device *device) | |||
295 | } | 295 | } |
296 | #endif /* CONFIG_PM_SLEEP */ | 296 | #endif /* CONFIG_PM_SLEEP */ |
297 | 297 | ||
298 | #ifdef CONFIG_PM_RUNTIME | 298 | #ifdef CONFIG_PM |
299 | static int mei_txe_pm_runtime_idle(struct device *device) | 299 | static int mei_txe_pm_runtime_idle(struct device *device) |
300 | { | 300 | { |
301 | struct pci_dev *pdev = to_pci_dev(device); | 301 | struct pci_dev *pdev = to_pci_dev(device); |
@@ -401,9 +401,7 @@ static inline void mei_txe_unset_pm_domain(struct mei_device *dev) | |||
401 | /* stop using pm callbacks if any */ | 401 | /* stop using pm callbacks if any */ |
402 | dev->dev->pm_domain = NULL; | 402 | dev->dev->pm_domain = NULL; |
403 | } | 403 | } |
404 | #endif /* CONFIG_PM_RUNTIME */ | ||
405 | 404 | ||
406 | #ifdef CONFIG_PM | ||
407 | static const struct dev_pm_ops mei_txe_pm_ops = { | 405 | static const struct dev_pm_ops mei_txe_pm_ops = { |
408 | SET_SYSTEM_SLEEP_PM_OPS(mei_txe_pci_suspend, | 406 | SET_SYSTEM_SLEEP_PM_OPS(mei_txe_pci_suspend, |
409 | mei_txe_pci_resume) | 407 | mei_txe_pci_resume) |
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 8a1f1240e058..6c0613d56b77 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c | |||
@@ -179,7 +179,7 @@ static int mmc_bus_resume(struct device *dev) | |||
179 | } | 179 | } |
180 | #endif | 180 | #endif |
181 | 181 | ||
182 | #ifdef CONFIG_PM_RUNTIME | 182 | #ifdef CONFIG_PM |
183 | static int mmc_runtime_suspend(struct device *dev) | 183 | static int mmc_runtime_suspend(struct device *dev) |
184 | { | 184 | { |
185 | struct mmc_card *card = mmc_dev_to_card(dev); | 185 | struct mmc_card *card = mmc_dev_to_card(dev); |
@@ -195,7 +195,7 @@ static int mmc_runtime_resume(struct device *dev) | |||
195 | 195 | ||
196 | return host->bus_ops->runtime_resume(host); | 196 | return host->bus_ops->runtime_resume(host); |
197 | } | 197 | } |
198 | #endif /* !CONFIG_PM_RUNTIME */ | 198 | #endif /* !CONFIG_PM */ |
199 | 199 | ||
200 | static const struct dev_pm_ops mmc_bus_pm_ops = { | 200 | static const struct dev_pm_ops mmc_bus_pm_ops = { |
201 | SET_RUNTIME_PM_OPS(mmc_runtime_suspend, mmc_runtime_resume, NULL) | 201 | SET_RUNTIME_PM_OPS(mmc_runtime_suspend, mmc_runtime_resume, NULL) |
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 43af791e2e45..184ea59afa7e 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -1843,7 +1843,7 @@ static int mmci_runtime_resume(struct device *dev) | |||
1843 | static const struct dev_pm_ops mmci_dev_pm_ops = { | 1843 | static const struct dev_pm_ops mmci_dev_pm_ops = { |
1844 | SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, | 1844 | SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, |
1845 | pm_runtime_force_resume) | 1845 | pm_runtime_force_resume) |
1846 | SET_PM_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL) | 1846 | SET_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL) |
1847 | }; | 1847 | }; |
1848 | 1848 | ||
1849 | static struct amba_id mmci_ids[] = { | 1849 | static struct amba_id mmci_ids[] = { |
diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index 9cccc0e89b04..a804e8dc57e3 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c | |||
@@ -416,7 +416,7 @@ static int sdhci_acpi_resume(struct device *dev) | |||
416 | 416 | ||
417 | #endif | 417 | #endif |
418 | 418 | ||
419 | #ifdef CONFIG_PM_RUNTIME | 419 | #ifdef CONFIG_PM |
420 | 420 | ||
421 | static int sdhci_acpi_runtime_suspend(struct device *dev) | 421 | static int sdhci_acpi_runtime_suspend(struct device *dev) |
422 | { | 422 | { |
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 587ee0edeb57..cafa10c10893 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c | |||
@@ -1172,7 +1172,7 @@ static int sdhci_esdhc_imx_remove(struct platform_device *pdev) | |||
1172 | pm_runtime_dont_use_autosuspend(&pdev->dev); | 1172 | pm_runtime_dont_use_autosuspend(&pdev->dev); |
1173 | pm_runtime_disable(&pdev->dev); | 1173 | pm_runtime_disable(&pdev->dev); |
1174 | 1174 | ||
1175 | if (!IS_ENABLED(CONFIG_PM_RUNTIME)) { | 1175 | if (!IS_ENABLED(CONFIG_PM)) { |
1176 | clk_disable_unprepare(imx_data->clk_per); | 1176 | clk_disable_unprepare(imx_data->clk_per); |
1177 | clk_disable_unprepare(imx_data->clk_ipg); | 1177 | clk_disable_unprepare(imx_data->clk_ipg); |
1178 | clk_disable_unprepare(imx_data->clk_ahb); | 1178 | clk_disable_unprepare(imx_data->clk_ahb); |
@@ -1183,7 +1183,7 @@ static int sdhci_esdhc_imx_remove(struct platform_device *pdev) | |||
1183 | return 0; | 1183 | return 0; |
1184 | } | 1184 | } |
1185 | 1185 | ||
1186 | #ifdef CONFIG_PM_RUNTIME | 1186 | #ifdef CONFIG_PM |
1187 | static int sdhci_esdhc_runtime_suspend(struct device *dev) | 1187 | static int sdhci_esdhc_runtime_suspend(struct device *dev) |
1188 | { | 1188 | { |
1189 | struct sdhci_host *host = dev_get_drvdata(dev); | 1189 | struct sdhci_host *host = dev_get_drvdata(dev); |
diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c index 61192973e7cb..de32a09b46d6 100644 --- a/drivers/mmc/host/sdhci-pci.c +++ b/drivers/mmc/host/sdhci-pci.c | |||
@@ -134,7 +134,7 @@ static int pch_hc_probe_slot(struct sdhci_pci_slot *slot) | |||
134 | return 0; | 134 | return 0; |
135 | } | 135 | } |
136 | 136 | ||
137 | #ifdef CONFIG_PM_RUNTIME | 137 | #ifdef CONFIG_PM |
138 | 138 | ||
139 | static irqreturn_t sdhci_pci_sd_cd(int irq, void *dev_id) | 139 | static irqreturn_t sdhci_pci_sd_cd(int irq, void *dev_id) |
140 | { | 140 | { |
@@ -1230,15 +1230,6 @@ static int sdhci_pci_resume(struct device *dev) | |||
1230 | return 0; | 1230 | return 0; |
1231 | } | 1231 | } |
1232 | 1232 | ||
1233 | #else /* CONFIG_PM */ | ||
1234 | |||
1235 | #define sdhci_pci_suspend NULL | ||
1236 | #define sdhci_pci_resume NULL | ||
1237 | |||
1238 | #endif /* CONFIG_PM */ | ||
1239 | |||
1240 | #ifdef CONFIG_PM_RUNTIME | ||
1241 | |||
1242 | static int sdhci_pci_runtime_suspend(struct device *dev) | 1233 | static int sdhci_pci_runtime_suspend(struct device *dev) |
1243 | { | 1234 | { |
1244 | struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); | 1235 | struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); |
@@ -1310,7 +1301,12 @@ static int sdhci_pci_runtime_idle(struct device *dev) | |||
1310 | return 0; | 1301 | return 0; |
1311 | } | 1302 | } |
1312 | 1303 | ||
1313 | #endif | 1304 | #else /* CONFIG_PM */ |
1305 | |||
1306 | #define sdhci_pci_suspend NULL | ||
1307 | #define sdhci_pci_resume NULL | ||
1308 | |||
1309 | #endif /* CONFIG_PM */ | ||
1314 | 1310 | ||
1315 | static const struct dev_pm_ops sdhci_pci_pm_ops = { | 1311 | static const struct dev_pm_ops sdhci_pci_pm_ops = { |
1316 | .suspend = sdhci_pci_suspend, | 1312 | .suspend = sdhci_pci_suspend, |
diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c index 5036d7d39529..88cf1ef970fe 100644 --- a/drivers/mmc/host/sdhci-pxav3.c +++ b/drivers/mmc/host/sdhci-pxav3.c | |||
@@ -436,7 +436,7 @@ static int sdhci_pxav3_resume(struct device *dev) | |||
436 | } | 436 | } |
437 | #endif | 437 | #endif |
438 | 438 | ||
439 | #ifdef CONFIG_PM_RUNTIME | 439 | #ifdef CONFIG_PM |
440 | static int sdhci_pxav3_runtime_suspend(struct device *dev) | 440 | static int sdhci_pxav3_runtime_suspend(struct device *dev) |
441 | { | 441 | { |
442 | struct sdhci_host *host = dev_get_drvdata(dev); | 442 | struct sdhci_host *host = dev_get_drvdata(dev); |
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 0ce6eb17deaf..fbf50efe6288 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c | |||
@@ -609,7 +609,7 @@ static int sdhci_s3c_probe(struct platform_device *pdev) | |||
609 | goto err_req_regs; | 609 | goto err_req_regs; |
610 | } | 610 | } |
611 | 611 | ||
612 | #ifdef CONFIG_PM_RUNTIME | 612 | #ifdef CONFIG_PM |
613 | if (pdata->cd_type != S3C_SDHCI_CD_INTERNAL) | 613 | if (pdata->cd_type != S3C_SDHCI_CD_INTERNAL) |
614 | clk_disable_unprepare(sc->clk_io); | 614 | clk_disable_unprepare(sc->clk_io); |
615 | #endif | 615 | #endif |
@@ -635,7 +635,7 @@ static int sdhci_s3c_remove(struct platform_device *pdev) | |||
635 | if (sc->ext_cd_irq) | 635 | if (sc->ext_cd_irq) |
636 | free_irq(sc->ext_cd_irq, sc); | 636 | free_irq(sc->ext_cd_irq, sc); |
637 | 637 | ||
638 | #ifdef CONFIG_PM_RUNTIME | 638 | #ifdef CONFIG_PM |
639 | if (sc->pdata->cd_type != S3C_SDHCI_CD_INTERNAL) | 639 | if (sc->pdata->cd_type != S3C_SDHCI_CD_INTERNAL) |
640 | clk_prepare_enable(sc->clk_io); | 640 | clk_prepare_enable(sc->clk_io); |
641 | #endif | 641 | #endif |
@@ -667,7 +667,7 @@ static int sdhci_s3c_resume(struct device *dev) | |||
667 | } | 667 | } |
668 | #endif | 668 | #endif |
669 | 669 | ||
670 | #ifdef CONFIG_PM_RUNTIME | 670 | #ifdef CONFIG_PM |
671 | static int sdhci_s3c_runtime_suspend(struct device *dev) | 671 | static int sdhci_s3c_runtime_suspend(struct device *dev) |
672 | { | 672 | { |
673 | struct sdhci_host *host = dev_get_drvdata(dev); | 673 | struct sdhci_host *host = dev_get_drvdata(dev); |
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index ada1a3ea3a87..640e82c40ee9 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -56,7 +56,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode); | |||
56 | static void sdhci_tuning_timer(unsigned long data); | 56 | static void sdhci_tuning_timer(unsigned long data); |
57 | static void sdhci_enable_preset_value(struct sdhci_host *host, bool enable); | 57 | static void sdhci_enable_preset_value(struct sdhci_host *host, bool enable); |
58 | 58 | ||
59 | #ifdef CONFIG_PM_RUNTIME | 59 | #ifdef CONFIG_PM |
60 | static int sdhci_runtime_pm_get(struct sdhci_host *host); | 60 | static int sdhci_runtime_pm_get(struct sdhci_host *host); |
61 | static int sdhci_runtime_pm_put(struct sdhci_host *host); | 61 | static int sdhci_runtime_pm_put(struct sdhci_host *host); |
62 | static void sdhci_runtime_pm_bus_on(struct sdhci_host *host); | 62 | static void sdhci_runtime_pm_bus_on(struct sdhci_host *host); |
@@ -2654,9 +2654,6 @@ int sdhci_resume_host(struct sdhci_host *host) | |||
2654 | } | 2654 | } |
2655 | 2655 | ||
2656 | EXPORT_SYMBOL_GPL(sdhci_resume_host); | 2656 | EXPORT_SYMBOL_GPL(sdhci_resume_host); |
2657 | #endif /* CONFIG_PM */ | ||
2658 | |||
2659 | #ifdef CONFIG_PM_RUNTIME | ||
2660 | 2657 | ||
2661 | static int sdhci_runtime_pm_get(struct sdhci_host *host) | 2658 | static int sdhci_runtime_pm_get(struct sdhci_host *host) |
2662 | { | 2659 | { |
@@ -2757,7 +2754,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host) | |||
2757 | } | 2754 | } |
2758 | EXPORT_SYMBOL_GPL(sdhci_runtime_resume_host); | 2755 | EXPORT_SYMBOL_GPL(sdhci_runtime_resume_host); |
2759 | 2756 | ||
2760 | #endif | 2757 | #endif /* CONFIG_PM */ |
2761 | 2758 | ||
2762 | /*****************************************************************************\ | 2759 | /*****************************************************************************\ |
2763 | * * | 2760 | * * |
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 31896a779d4e..912b260f9d2c 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h | |||
@@ -411,9 +411,6 @@ void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing); | |||
411 | extern int sdhci_suspend_host(struct sdhci_host *host); | 411 | extern int sdhci_suspend_host(struct sdhci_host *host); |
412 | extern int sdhci_resume_host(struct sdhci_host *host); | 412 | extern int sdhci_resume_host(struct sdhci_host *host); |
413 | extern void sdhci_enable_irq_wakeups(struct sdhci_host *host); | 413 | extern void sdhci_enable_irq_wakeups(struct sdhci_host *host); |
414 | #endif | ||
415 | |||
416 | #ifdef CONFIG_PM_RUNTIME | ||
417 | extern int sdhci_runtime_suspend_host(struct sdhci_host *host); | 414 | extern int sdhci_runtime_suspend_host(struct sdhci_host *host); |
418 | extern int sdhci_runtime_resume_host(struct sdhci_host *host); | 415 | extern int sdhci_runtime_resume_host(struct sdhci_host *host); |
419 | #endif | 416 | #endif |
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index a2e81a1ea6af..00c8ebdf8ec7 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c | |||
@@ -375,7 +375,7 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev) | |||
375 | static const struct dev_pm_ops tmio_mmc_dev_pm_ops = { | 375 | static const struct dev_pm_ops tmio_mmc_dev_pm_ops = { |
376 | SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, | 376 | SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, |
377 | pm_runtime_force_resume) | 377 | pm_runtime_force_resume) |
378 | SET_PM_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend, | 378 | SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend, |
379 | tmio_mmc_host_runtime_resume, | 379 | tmio_mmc_host_runtime_resume, |
380 | NULL) | 380 | NULL) |
381 | }; | 381 | }; |
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index 659028ddb8b1..2616fdfdbbeb 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c | |||
@@ -135,7 +135,7 @@ static int tmio_mmc_remove(struct platform_device *pdev) | |||
135 | 135 | ||
136 | static const struct dev_pm_ops tmio_mmc_dev_pm_ops = { | 136 | static const struct dev_pm_ops tmio_mmc_dev_pm_ops = { |
137 | SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_suspend, tmio_mmc_resume) | 137 | SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_suspend, tmio_mmc_resume) |
138 | SET_PM_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend, | 138 | SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend, |
139 | tmio_mmc_host_runtime_resume, | 139 | tmio_mmc_host_runtime_resume, |
140 | NULL) | 140 | NULL) |
141 | }; | 141 | }; |
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index 247335d2c7ec..952ef7c434e8 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c | |||
@@ -6372,7 +6372,6 @@ static int e1000e_pm_resume(struct device *dev) | |||
6372 | } | 6372 | } |
6373 | #endif /* CONFIG_PM_SLEEP */ | 6373 | #endif /* CONFIG_PM_SLEEP */ |
6374 | 6374 | ||
6375 | #ifdef CONFIG_PM_RUNTIME | ||
6376 | static int e1000e_pm_runtime_idle(struct device *dev) | 6375 | static int e1000e_pm_runtime_idle(struct device *dev) |
6377 | { | 6376 | { |
6378 | struct pci_dev *pdev = to_pci_dev(dev); | 6377 | struct pci_dev *pdev = to_pci_dev(dev); |
@@ -6432,7 +6431,6 @@ static int e1000e_pm_runtime_suspend(struct device *dev) | |||
6432 | 6431 | ||
6433 | return 0; | 6432 | return 0; |
6434 | } | 6433 | } |
6435 | #endif /* CONFIG_PM_RUNTIME */ | ||
6436 | #endif /* CONFIG_PM */ | 6434 | #endif /* CONFIG_PM */ |
6437 | 6435 | ||
6438 | static void e1000_shutdown(struct pci_dev *pdev) | 6436 | static void e1000_shutdown(struct pci_dev *pdev) |
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 487cd9c4ac0d..b85880a6e4c4 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -186,11 +186,9 @@ static int igb_pci_enable_sriov(struct pci_dev *dev, int num_vfs); | |||
186 | static int igb_suspend(struct device *); | 186 | static int igb_suspend(struct device *); |
187 | #endif | 187 | #endif |
188 | static int igb_resume(struct device *); | 188 | static int igb_resume(struct device *); |
189 | #ifdef CONFIG_PM_RUNTIME | ||
190 | static int igb_runtime_suspend(struct device *dev); | 189 | static int igb_runtime_suspend(struct device *dev); |
191 | static int igb_runtime_resume(struct device *dev); | 190 | static int igb_runtime_resume(struct device *dev); |
192 | static int igb_runtime_idle(struct device *dev); | 191 | static int igb_runtime_idle(struct device *dev); |
193 | #endif | ||
194 | static const struct dev_pm_ops igb_pm_ops = { | 192 | static const struct dev_pm_ops igb_pm_ops = { |
195 | SET_SYSTEM_SLEEP_PM_OPS(igb_suspend, igb_resume) | 193 | SET_SYSTEM_SLEEP_PM_OPS(igb_suspend, igb_resume) |
196 | SET_RUNTIME_PM_OPS(igb_runtime_suspend, igb_runtime_resume, | 194 | SET_RUNTIME_PM_OPS(igb_runtime_suspend, igb_runtime_resume, |
@@ -7450,7 +7448,6 @@ static int igb_resume(struct device *dev) | |||
7450 | return 0; | 7448 | return 0; |
7451 | } | 7449 | } |
7452 | 7450 | ||
7453 | #ifdef CONFIG_PM_RUNTIME | ||
7454 | static int igb_runtime_idle(struct device *dev) | 7451 | static int igb_runtime_idle(struct device *dev) |
7455 | { | 7452 | { |
7456 | struct pci_dev *pdev = to_pci_dev(dev); | 7453 | struct pci_dev *pdev = to_pci_dev(dev); |
@@ -7487,8 +7484,7 @@ static int igb_runtime_resume(struct device *dev) | |||
7487 | { | 7484 | { |
7488 | return igb_resume(dev); | 7485 | return igb_resume(dev); |
7489 | } | 7486 | } |
7490 | #endif /* CONFIG_PM_RUNTIME */ | 7487 | #endif /* CONFIG_PM */ |
7491 | #endif | ||
7492 | 7488 | ||
7493 | static void igb_shutdown(struct pci_dev *pdev) | 7489 | static void igb_shutdown(struct pci_dev *pdev) |
7494 | { | 7490 | { |
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 2b3c89425bb5..887e6bd95af7 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -1104,7 +1104,7 @@ static int pci_pm_restore(struct device *dev) | |||
1104 | 1104 | ||
1105 | #endif /* !CONFIG_HIBERNATE_CALLBACKS */ | 1105 | #endif /* !CONFIG_HIBERNATE_CALLBACKS */ |
1106 | 1106 | ||
1107 | #ifdef CONFIG_PM_RUNTIME | 1107 | #ifdef CONFIG_PM |
1108 | 1108 | ||
1109 | static int pci_pm_runtime_suspend(struct device *dev) | 1109 | static int pci_pm_runtime_suspend(struct device *dev) |
1110 | { | 1110 | { |
@@ -1200,16 +1200,6 @@ static int pci_pm_runtime_idle(struct device *dev) | |||
1200 | return ret; | 1200 | return ret; |
1201 | } | 1201 | } |
1202 | 1202 | ||
1203 | #else /* !CONFIG_PM_RUNTIME */ | ||
1204 | |||
1205 | #define pci_pm_runtime_suspend NULL | ||
1206 | #define pci_pm_runtime_resume NULL | ||
1207 | #define pci_pm_runtime_idle NULL | ||
1208 | |||
1209 | #endif /* !CONFIG_PM_RUNTIME */ | ||
1210 | |||
1211 | #ifdef CONFIG_PM | ||
1212 | |||
1213 | static const struct dev_pm_ops pci_dev_pm_ops = { | 1203 | static const struct dev_pm_ops pci_dev_pm_ops = { |
1214 | .prepare = pci_pm_prepare, | 1204 | .prepare = pci_pm_prepare, |
1215 | .suspend = pci_pm_suspend, | 1205 | .suspend = pci_pm_suspend, |
@@ -1231,11 +1221,15 @@ static const struct dev_pm_ops pci_dev_pm_ops = { | |||
1231 | 1221 | ||
1232 | #define PCI_PM_OPS_PTR (&pci_dev_pm_ops) | 1222 | #define PCI_PM_OPS_PTR (&pci_dev_pm_ops) |
1233 | 1223 | ||
1234 | #else /* !COMFIG_PM_OPS */ | 1224 | #else /* !CONFIG_PM */ |
1225 | |||
1226 | #define pci_pm_runtime_suspend NULL | ||
1227 | #define pci_pm_runtime_resume NULL | ||
1228 | #define pci_pm_runtime_idle NULL | ||
1235 | 1229 | ||
1236 | #define PCI_PM_OPS_PTR NULL | 1230 | #define PCI_PM_OPS_PTR NULL |
1237 | 1231 | ||
1238 | #endif /* !COMFIG_PM_OPS */ | 1232 | #endif /* !CONFIG_PM */ |
1239 | 1233 | ||
1240 | /** | 1234 | /** |
1241 | * __pci_register_driver - register a new pci driver | 1235 | * __pci_register_driver - register a new pci driver |
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 2c6643fdc0cf..5c21e81b7caf 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
@@ -385,7 +385,7 @@ static ssize_t dev_bus_rescan_store(struct device *dev, | |||
385 | } | 385 | } |
386 | static DEVICE_ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, dev_bus_rescan_store); | 386 | static DEVICE_ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, dev_bus_rescan_store); |
387 | 387 | ||
388 | #if defined(CONFIG_PM_RUNTIME) && defined(CONFIG_ACPI) | 388 | #if defined(CONFIG_PM) && defined(CONFIG_ACPI) |
389 | static ssize_t d3cold_allowed_store(struct device *dev, | 389 | static ssize_t d3cold_allowed_store(struct device *dev, |
390 | struct device_attribute *attr, | 390 | struct device_attribute *attr, |
391 | const char *buf, size_t count) | 391 | const char *buf, size_t count) |
@@ -566,7 +566,7 @@ static struct attribute *pci_dev_attrs[] = { | |||
566 | &dev_attr_enable.attr, | 566 | &dev_attr_enable.attr, |
567 | &dev_attr_broken_parity_status.attr, | 567 | &dev_attr_broken_parity_status.attr, |
568 | &dev_attr_msi_bus.attr, | 568 | &dev_attr_msi_bus.attr, |
569 | #if defined(CONFIG_PM_RUNTIME) && defined(CONFIG_ACPI) | 569 | #if defined(CONFIG_PM) && defined(CONFIG_ACPI) |
570 | &dev_attr_d3cold_allowed.attr, | 570 | &dev_attr_d3cold_allowed.attr, |
571 | #endif | 571 | #endif |
572 | #ifdef CONFIG_OF | 572 | #ifdef CONFIG_OF |
diff --git a/drivers/pci/pcie/Kconfig b/drivers/pci/pcie/Kconfig index 7958e59d6077..e294713c8143 100644 --- a/drivers/pci/pcie/Kconfig +++ b/drivers/pci/pcie/Kconfig | |||
@@ -79,4 +79,4 @@ endchoice | |||
79 | 79 | ||
80 | config PCIE_PME | 80 | config PCIE_PME |
81 | def_bool y | 81 | def_bool y |
82 | depends on PCIEPORTBUS && PM_RUNTIME | 82 | depends on PCIEPORTBUS && PM |
diff --git a/drivers/sh/pm_runtime.c b/drivers/sh/pm_runtime.c index fe2c2d595f59..f3ee439d6f0e 100644 --- a/drivers/sh/pm_runtime.c +++ b/drivers/sh/pm_runtime.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <linux/bitmap.h> | 20 | #include <linux/bitmap.h> |
21 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
22 | 22 | ||
23 | #ifdef CONFIG_PM_RUNTIME | 23 | #ifdef CONFIG_PM |
24 | static int sh_pm_runtime_suspend(struct device *dev) | 24 | static int sh_pm_runtime_suspend(struct device *dev) |
25 | { | 25 | { |
26 | int ret; | 26 | int ret; |
@@ -68,7 +68,7 @@ static struct dev_pm_domain default_pm_domain = { | |||
68 | 68 | ||
69 | #define DEFAULT_PM_DOMAIN_PTR NULL | 69 | #define DEFAULT_PM_DOMAIN_PTR NULL |
70 | 70 | ||
71 | #endif /* CONFIG_PM_RUNTIME */ | 71 | #endif /* CONFIG_PM */ |
72 | 72 | ||
73 | static struct pm_clk_notifier_block platform_bus_notifier = { | 73 | static struct pm_clk_notifier_block platform_bus_notifier = { |
74 | .pm_domain = DEFAULT_PM_DOMAIN_PTR, | 74 | .pm_domain = DEFAULT_PM_DOMAIN_PTR, |
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index fc2dd8441608..89ca162801da 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c | |||
@@ -2377,7 +2377,7 @@ static int pl022_runtime_resume(struct device *dev) | |||
2377 | 2377 | ||
2378 | static const struct dev_pm_ops pl022_dev_pm_ops = { | 2378 | static const struct dev_pm_ops pl022_dev_pm_ops = { |
2379 | SET_SYSTEM_SLEEP_PM_OPS(pl022_suspend, pl022_resume) | 2379 | SET_SYSTEM_SLEEP_PM_OPS(pl022_suspend, pl022_resume) |
2380 | SET_PM_RUNTIME_PM_OPS(pl022_runtime_suspend, pl022_runtime_resume, NULL) | 2380 | SET_RUNTIME_PM_OPS(pl022_runtime_suspend, pl022_runtime_resume, NULL) |
2381 | }; | 2381 | }; |
2382 | 2382 | ||
2383 | static struct vendor_data vendor_arm = { | 2383 | static struct vendor_data vendor_arm = { |
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 9bffd26cea05..874dec31a111 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
@@ -1493,10 +1493,6 @@ int usb_resume(struct device *dev, pm_message_t msg) | |||
1493 | return status; | 1493 | return status; |
1494 | } | 1494 | } |
1495 | 1495 | ||
1496 | #endif /* CONFIG_PM */ | ||
1497 | |||
1498 | #ifdef CONFIG_PM_RUNTIME | ||
1499 | |||
1500 | /** | 1496 | /** |
1501 | * usb_enable_autosuspend - allow a USB device to be autosuspended | 1497 | * usb_enable_autosuspend - allow a USB device to be autosuspended |
1502 | * @udev: the USB device which may be autosuspended | 1498 | * @udev: the USB device which may be autosuspended |
@@ -1876,7 +1872,7 @@ int usb_set_usb2_hardware_lpm(struct usb_device *udev, int enable) | |||
1876 | return ret; | 1872 | return ret; |
1877 | } | 1873 | } |
1878 | 1874 | ||
1879 | #endif /* CONFIG_PM_RUNTIME */ | 1875 | #endif /* CONFIG_PM */ |
1880 | 1876 | ||
1881 | struct bus_type usb_bus_type = { | 1877 | struct bus_type usb_bus_type = { |
1882 | .name = "usb", | 1878 | .name = "usb", |
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index efc953119ce2..9eb1cff28bd4 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c | |||
@@ -429,7 +429,6 @@ static int check_root_hub_suspended(struct device *dev) | |||
429 | return 0; | 429 | return 0; |
430 | } | 430 | } |
431 | 431 | ||
432 | #if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME) | ||
433 | static int suspend_common(struct device *dev, bool do_wakeup) | 432 | static int suspend_common(struct device *dev, bool do_wakeup) |
434 | { | 433 | { |
435 | struct pci_dev *pci_dev = to_pci_dev(dev); | 434 | struct pci_dev *pci_dev = to_pci_dev(dev); |
@@ -528,7 +527,6 @@ static int resume_common(struct device *dev, int event) | |||
528 | } | 527 | } |
529 | return retval; | 528 | return retval; |
530 | } | 529 | } |
531 | #endif /* SLEEP || RUNTIME */ | ||
532 | 530 | ||
533 | #ifdef CONFIG_PM_SLEEP | 531 | #ifdef CONFIG_PM_SLEEP |
534 | 532 | ||
@@ -607,8 +605,6 @@ static int hcd_pci_restore(struct device *dev) | |||
607 | 605 | ||
608 | #endif /* CONFIG_PM_SLEEP */ | 606 | #endif /* CONFIG_PM_SLEEP */ |
609 | 607 | ||
610 | #ifdef CONFIG_PM_RUNTIME | ||
611 | |||
612 | static int hcd_pci_runtime_suspend(struct device *dev) | 608 | static int hcd_pci_runtime_suspend(struct device *dev) |
613 | { | 609 | { |
614 | int retval; | 610 | int retval; |
@@ -630,13 +626,6 @@ static int hcd_pci_runtime_resume(struct device *dev) | |||
630 | return retval; | 626 | return retval; |
631 | } | 627 | } |
632 | 628 | ||
633 | #else | ||
634 | |||
635 | #define hcd_pci_runtime_suspend NULL | ||
636 | #define hcd_pci_runtime_resume NULL | ||
637 | |||
638 | #endif /* CONFIG_PM_RUNTIME */ | ||
639 | |||
640 | const struct dev_pm_ops usb_hcd_pci_pm_ops = { | 629 | const struct dev_pm_ops usb_hcd_pci_pm_ops = { |
641 | .suspend = hcd_pci_suspend, | 630 | .suspend = hcd_pci_suspend, |
642 | .suspend_noirq = hcd_pci_suspend_noirq, | 631 | .suspend_noirq = hcd_pci_suspend_noirq, |
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index a6efb4184f2b..278be0515e8e 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -2258,10 +2258,6 @@ int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg) | |||
2258 | return status; | 2258 | return status; |
2259 | } | 2259 | } |
2260 | 2260 | ||
2261 | #endif /* CONFIG_PM */ | ||
2262 | |||
2263 | #ifdef CONFIG_PM_RUNTIME | ||
2264 | |||
2265 | /* Workqueue routine for root-hub remote wakeup */ | 2261 | /* Workqueue routine for root-hub remote wakeup */ |
2266 | static void hcd_resume_work(struct work_struct *work) | 2262 | static void hcd_resume_work(struct work_struct *work) |
2267 | { | 2263 | { |
@@ -2293,7 +2289,7 @@ void usb_hcd_resume_root_hub (struct usb_hcd *hcd) | |||
2293 | } | 2289 | } |
2294 | EXPORT_SYMBOL_GPL(usb_hcd_resume_root_hub); | 2290 | EXPORT_SYMBOL_GPL(usb_hcd_resume_root_hub); |
2295 | 2291 | ||
2296 | #endif /* CONFIG_PM_RUNTIME */ | 2292 | #endif /* CONFIG_PM */ |
2297 | 2293 | ||
2298 | /*-------------------------------------------------------------------------*/ | 2294 | /*-------------------------------------------------------------------------*/ |
2299 | 2295 | ||
@@ -2476,7 +2472,7 @@ struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver, | |||
2476 | init_timer(&hcd->rh_timer); | 2472 | init_timer(&hcd->rh_timer); |
2477 | hcd->rh_timer.function = rh_timer_func; | 2473 | hcd->rh_timer.function = rh_timer_func; |
2478 | hcd->rh_timer.data = (unsigned long) hcd; | 2474 | hcd->rh_timer.data = (unsigned long) hcd; |
2479 | #ifdef CONFIG_PM_RUNTIME | 2475 | #ifdef CONFIG_PM |
2480 | INIT_WORK(&hcd->wakeup_work, hcd_resume_work); | 2476 | INIT_WORK(&hcd->wakeup_work, hcd_resume_work); |
2481 | #endif | 2477 | #endif |
2482 | 2478 | ||
@@ -2790,7 +2786,7 @@ error_create_attr_group: | |||
2790 | hcd->rh_registered = 0; | 2786 | hcd->rh_registered = 0; |
2791 | spin_unlock_irq(&hcd_root_hub_lock); | 2787 | spin_unlock_irq(&hcd_root_hub_lock); |
2792 | 2788 | ||
2793 | #ifdef CONFIG_PM_RUNTIME | 2789 | #ifdef CONFIG_PM |
2794 | cancel_work_sync(&hcd->wakeup_work); | 2790 | cancel_work_sync(&hcd->wakeup_work); |
2795 | #endif | 2791 | #endif |
2796 | mutex_lock(&usb_bus_list_lock); | 2792 | mutex_lock(&usb_bus_list_lock); |
@@ -2858,7 +2854,7 @@ void usb_remove_hcd(struct usb_hcd *hcd) | |||
2858 | hcd->rh_registered = 0; | 2854 | hcd->rh_registered = 0; |
2859 | spin_unlock_irq (&hcd_root_hub_lock); | 2855 | spin_unlock_irq (&hcd_root_hub_lock); |
2860 | 2856 | ||
2861 | #ifdef CONFIG_PM_RUNTIME | 2857 | #ifdef CONFIG_PM |
2862 | cancel_work_sync(&hcd->wakeup_work); | 2858 | cancel_work_sync(&hcd->wakeup_work); |
2863 | #endif | 2859 | #endif |
2864 | 2860 | ||
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index b649fef2e35d..c9596525ba8c 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1737,7 +1737,7 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1737 | * - If user has indicated to prevent autosuspend by passing | 1737 | * - If user has indicated to prevent autosuspend by passing |
1738 | * usbcore.autosuspend = -1 then keep autosuspend disabled. | 1738 | * usbcore.autosuspend = -1 then keep autosuspend disabled. |
1739 | */ | 1739 | */ |
1740 | #ifdef CONFIG_PM_RUNTIME | 1740 | #ifdef CONFIG_PM |
1741 | if (hdev->dev.power.autosuspend_delay >= 0) | 1741 | if (hdev->dev.power.autosuspend_delay >= 0) |
1742 | pm_runtime_set_autosuspend_delay(&hdev->dev, 0); | 1742 | pm_runtime_set_autosuspend_delay(&hdev->dev, 0); |
1743 | #endif | 1743 | #endif |
@@ -3449,7 +3449,7 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg) | |||
3449 | return status; | 3449 | return status; |
3450 | } | 3450 | } |
3451 | 3451 | ||
3452 | #ifdef CONFIG_PM_RUNTIME | 3452 | #ifdef CONFIG_PM |
3453 | 3453 | ||
3454 | int usb_remote_wakeup(struct usb_device *udev) | 3454 | int usb_remote_wakeup(struct usb_device *udev) |
3455 | { | 3455 | { |
@@ -4856,7 +4856,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, | |||
4856 | udev->state != USB_STATE_NOTATTACHED) { | 4856 | udev->state != USB_STATE_NOTATTACHED) { |
4857 | if (portstatus & USB_PORT_STAT_ENABLE) { | 4857 | if (portstatus & USB_PORT_STAT_ENABLE) { |
4858 | status = 0; /* Nothing to do */ | 4858 | status = 0; /* Nothing to do */ |
4859 | #ifdef CONFIG_PM_RUNTIME | 4859 | #ifdef CONFIG_PM |
4860 | } else if (udev->state == USB_STATE_SUSPENDED && | 4860 | } else if (udev->state == USB_STATE_SUSPENDED && |
4861 | udev->persist_enabled) { | 4861 | udev->persist_enabled) { |
4862 | /* For a suspended device, treat this as a | 4862 | /* For a suspended device, treat this as a |
diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c index cd3f9dc24a06..210618319f10 100644 --- a/drivers/usb/core/port.c +++ b/drivers/usb/core/port.c | |||
@@ -72,7 +72,7 @@ static void usb_port_device_release(struct device *dev) | |||
72 | kfree(port_dev); | 72 | kfree(port_dev); |
73 | } | 73 | } |
74 | 74 | ||
75 | #ifdef CONFIG_PM_RUNTIME | 75 | #ifdef CONFIG_PM |
76 | static int usb_port_runtime_resume(struct device *dev) | 76 | static int usb_port_runtime_resume(struct device *dev) |
77 | { | 77 | { |
78 | struct usb_port *port_dev = to_usb_port(dev); | 78 | struct usb_port *port_dev = to_usb_port(dev); |
@@ -171,7 +171,7 @@ static int usb_port_runtime_suspend(struct device *dev) | |||
171 | #endif | 171 | #endif |
172 | 172 | ||
173 | static const struct dev_pm_ops usb_port_pm_ops = { | 173 | static const struct dev_pm_ops usb_port_pm_ops = { |
174 | #ifdef CONFIG_PM_RUNTIME | 174 | #ifdef CONFIG_PM |
175 | .runtime_suspend = usb_port_runtime_suspend, | 175 | .runtime_suspend = usb_port_runtime_suspend, |
176 | .runtime_resume = usb_port_runtime_resume, | 176 | .runtime_resume = usb_port_runtime_resume, |
177 | #endif | 177 | #endif |
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index 1236c6011c70..d26973844a4d 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c | |||
@@ -334,14 +334,6 @@ static void remove_persist_attributes(struct device *dev) | |||
334 | &dev_attr_persist.attr, | 334 | &dev_attr_persist.attr, |
335 | power_group_name); | 335 | power_group_name); |
336 | } | 336 | } |
337 | #else | ||
338 | |||
339 | #define add_persist_attributes(dev) 0 | ||
340 | #define remove_persist_attributes(dev) do {} while (0) | ||
341 | |||
342 | #endif /* CONFIG_PM */ | ||
343 | |||
344 | #ifdef CONFIG_PM_RUNTIME | ||
345 | 337 | ||
346 | static ssize_t connected_duration_show(struct device *dev, | 338 | static ssize_t connected_duration_show(struct device *dev, |
347 | struct device_attribute *attr, char *buf) | 339 | struct device_attribute *attr, char *buf) |
@@ -585,10 +577,13 @@ static void remove_power_attributes(struct device *dev) | |||
585 | 577 | ||
586 | #else | 578 | #else |
587 | 579 | ||
580 | #define add_persist_attributes(dev) 0 | ||
581 | #define remove_persist_attributes(dev) do {} while (0) | ||
582 | |||
588 | #define add_power_attributes(dev) 0 | 583 | #define add_power_attributes(dev) 0 |
589 | #define remove_power_attributes(dev) do {} while (0) | 584 | #define remove_power_attributes(dev) do {} while (0) |
590 | 585 | ||
591 | #endif /* CONFIG_PM_RUNTIME */ | 586 | #endif /* CONFIG_PM */ |
592 | 587 | ||
593 | 588 | ||
594 | /* Descriptor fields */ | 589 | /* Descriptor fields */ |
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 2dd2362198d2..2a92b97f0144 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -49,7 +49,7 @@ const char *usbcore_name = "usbcore"; | |||
49 | 49 | ||
50 | static bool nousb; /* Disable USB when built into kernel image */ | 50 | static bool nousb; /* Disable USB when built into kernel image */ |
51 | 51 | ||
52 | #ifdef CONFIG_PM_RUNTIME | 52 | #ifdef CONFIG_PM |
53 | static int usb_autosuspend_delay = 2; /* Default delay value, | 53 | static int usb_autosuspend_delay = 2; /* Default delay value, |
54 | * in seconds */ | 54 | * in seconds */ |
55 | module_param_named(autosuspend, usb_autosuspend_delay, int, 0644); | 55 | module_param_named(autosuspend, usb_autosuspend_delay, int, 0644); |
@@ -348,11 +348,9 @@ static const struct dev_pm_ops usb_device_pm_ops = { | |||
348 | .thaw = usb_dev_thaw, | 348 | .thaw = usb_dev_thaw, |
349 | .poweroff = usb_dev_poweroff, | 349 | .poweroff = usb_dev_poweroff, |
350 | .restore = usb_dev_restore, | 350 | .restore = usb_dev_restore, |
351 | #ifdef CONFIG_PM_RUNTIME | ||
352 | .runtime_suspend = usb_runtime_suspend, | 351 | .runtime_suspend = usb_runtime_suspend, |
353 | .runtime_resume = usb_runtime_resume, | 352 | .runtime_resume = usb_runtime_resume, |
354 | .runtime_idle = usb_runtime_idle, | 353 | .runtime_idle = usb_runtime_idle, |
355 | #endif | ||
356 | }; | 354 | }; |
357 | 355 | ||
358 | #endif /* CONFIG_PM */ | 356 | #endif /* CONFIG_PM */ |
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h index b1b34d0557c9..7eb1e26798e5 100644 --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h | |||
@@ -75,6 +75,14 @@ extern int usb_resume_complete(struct device *dev); | |||
75 | extern int usb_port_suspend(struct usb_device *dev, pm_message_t msg); | 75 | extern int usb_port_suspend(struct usb_device *dev, pm_message_t msg); |
76 | extern int usb_port_resume(struct usb_device *dev, pm_message_t msg); | 76 | extern int usb_port_resume(struct usb_device *dev, pm_message_t msg); |
77 | 77 | ||
78 | extern void usb_autosuspend_device(struct usb_device *udev); | ||
79 | extern int usb_autoresume_device(struct usb_device *udev); | ||
80 | extern int usb_remote_wakeup(struct usb_device *dev); | ||
81 | extern int usb_runtime_suspend(struct device *dev); | ||
82 | extern int usb_runtime_resume(struct device *dev); | ||
83 | extern int usb_runtime_idle(struct device *dev); | ||
84 | extern int usb_set_usb2_hardware_lpm(struct usb_device *udev, int enable); | ||
85 | |||
78 | #else | 86 | #else |
79 | 87 | ||
80 | static inline int usb_port_suspend(struct usb_device *udev, pm_message_t msg) | 88 | static inline int usb_port_suspend(struct usb_device *udev, pm_message_t msg) |
@@ -87,20 +95,6 @@ static inline int usb_port_resume(struct usb_device *udev, pm_message_t msg) | |||
87 | return 0; | 95 | return 0; |
88 | } | 96 | } |
89 | 97 | ||
90 | #endif | ||
91 | |||
92 | #ifdef CONFIG_PM_RUNTIME | ||
93 | |||
94 | extern void usb_autosuspend_device(struct usb_device *udev); | ||
95 | extern int usb_autoresume_device(struct usb_device *udev); | ||
96 | extern int usb_remote_wakeup(struct usb_device *dev); | ||
97 | extern int usb_runtime_suspend(struct device *dev); | ||
98 | extern int usb_runtime_resume(struct device *dev); | ||
99 | extern int usb_runtime_idle(struct device *dev); | ||
100 | extern int usb_set_usb2_hardware_lpm(struct usb_device *udev, int enable); | ||
101 | |||
102 | #else | ||
103 | |||
104 | #define usb_autosuspend_device(udev) do {} while (0) | 98 | #define usb_autosuspend_device(udev) do {} while (0) |
105 | static inline int usb_autoresume_device(struct usb_device *udev) | 99 | static inline int usb_autoresume_device(struct usb_device *udev) |
106 | { | 100 | { |
@@ -111,6 +105,7 @@ static inline int usb_set_usb2_hardware_lpm(struct usb_device *udev, int enable) | |||
111 | { | 105 | { |
112 | return 0; | 106 | return 0; |
113 | } | 107 | } |
108 | |||
114 | #endif | 109 | #endif |
115 | 110 | ||
116 | extern struct bus_type usb_bus_type; | 111 | extern struct bus_type usb_bus_type; |
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index ca7b964124af..851006a0d97b 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c | |||
@@ -305,7 +305,7 @@ static int ehci_pci_setup(struct usb_hcd *hcd) | |||
305 | } | 305 | } |
306 | } | 306 | } |
307 | 307 | ||
308 | #ifdef CONFIG_PM_RUNTIME | 308 | #ifdef CONFIG_PM |
309 | if (ehci->no_selective_suspend && device_can_wakeup(&pdev->dev)) | 309 | if (ehci->no_selective_suspend && device_can_wakeup(&pdev->dev)) |
310 | ehci_warn(ehci, "selective suspend/wakeup unavailable\n"); | 310 | ehci_warn(ehci, "selective suspend/wakeup unavailable\n"); |
311 | #endif | 311 | #endif |
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index ad0c348e68e9..25fb1da8d3d7 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c | |||
@@ -22,7 +22,7 @@ | |||
22 | * and usb-storage. | 22 | * and usb-storage. |
23 | * | 23 | * |
24 | * TODO: | 24 | * TODO: |
25 | * - usb suspend/resume triggered by sl811 (with PM_RUNTIME) | 25 | * - usb suspend/resume triggered by sl811 |
26 | * - various issues noted in the code | 26 | * - various issues noted in the code |
27 | * - performance work; use both register banks; ... | 27 | * - performance work; use both register banks; ... |
28 | * - use urb->iso_frame_desc[] with ISO transfers | 28 | * - use urb->iso_frame_desc[] with ISO transfers |
@@ -1752,8 +1752,7 @@ sl811h_probe(struct platform_device *dev) | |||
1752 | #ifdef CONFIG_PM | 1752 | #ifdef CONFIG_PM |
1753 | 1753 | ||
1754 | /* for this device there's no useful distinction between the controller | 1754 | /* for this device there's no useful distinction between the controller |
1755 | * and its root hub, except that the root hub only gets direct PM calls | 1755 | * and its root hub. |
1756 | * when CONFIG_PM_RUNTIME is enabled. | ||
1757 | */ | 1756 | */ |
1758 | 1757 | ||
1759 | static int | 1758 | static int |
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c index c0671750671f..bf86630b3cea 100644 --- a/drivers/usb/host/u132-hcd.c +++ b/drivers/usb/host/u132-hcd.c | |||
@@ -3144,8 +3144,7 @@ static int u132_probe(struct platform_device *pdev) | |||
3144 | #ifdef CONFIG_PM | 3144 | #ifdef CONFIG_PM |
3145 | /* | 3145 | /* |
3146 | * for this device there's no useful distinction between the controller | 3146 | * for this device there's no useful distinction between the controller |
3147 | * and its root hub, except that the root hub only gets direct PM calls | 3147 | * and its root hub. |
3148 | * when CONFIG_PM_RUNTIME is enabled. | ||
3149 | */ | 3148 | */ |
3150 | static int u132_suspend(struct platform_device *pdev, pm_message_t state) | 3149 | static int u132_suspend(struct platform_device *pdev, pm_message_t state) |
3151 | { | 3150 | { |
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index 388cfd83b6b6..a7865c4b0498 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c | |||
@@ -1145,7 +1145,7 @@ int xhci_bus_suspend(struct usb_hcd *hcd) | |||
1145 | set_bit(port_index, &bus_state->bus_suspended); | 1145 | set_bit(port_index, &bus_state->bus_suspended); |
1146 | } | 1146 | } |
1147 | /* USB core sets remote wake mask for USB 3.0 hubs, | 1147 | /* USB core sets remote wake mask for USB 3.0 hubs, |
1148 | * including the USB 3.0 roothub, but only if CONFIG_PM_RUNTIME | 1148 | * including the USB 3.0 roothub, but only if CONFIG_PM |
1149 | * is enabled, so also enable remote wake here. | 1149 | * is enabled, so also enable remote wake here. |
1150 | */ | 1150 | */ |
1151 | if (hcd->self.root_hub->do_remote_wakeup) { | 1151 | if (hcd->self.root_hub->do_remote_wakeup) { |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 033b46c470bd..cf3413116aff 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -4029,7 +4029,7 @@ static int __maybe_unused xhci_change_max_exit_latency(struct xhci_hcd *xhci, | |||
4029 | return ret; | 4029 | return ret; |
4030 | } | 4030 | } |
4031 | 4031 | ||
4032 | #ifdef CONFIG_PM_RUNTIME | 4032 | #ifdef CONFIG_PM |
4033 | 4033 | ||
4034 | /* BESL to HIRD Encoding array for USB2 LPM */ | 4034 | /* BESL to HIRD Encoding array for USB2 LPM */ |
4035 | static int xhci_besl_encoding[16] = {125, 150, 200, 300, 400, 500, 1000, 2000, | 4035 | static int xhci_besl_encoding[16] = {125, 150, 200, 300, 400, 500, 1000, 2000, |
@@ -4244,24 +4244,8 @@ int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev) | |||
4244 | return 0; | 4244 | return 0; |
4245 | } | 4245 | } |
4246 | 4246 | ||
4247 | #else | ||
4248 | |||
4249 | int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd, | ||
4250 | struct usb_device *udev, int enable) | ||
4251 | { | ||
4252 | return 0; | ||
4253 | } | ||
4254 | |||
4255 | int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev) | ||
4256 | { | ||
4257 | return 0; | ||
4258 | } | ||
4259 | |||
4260 | #endif /* CONFIG_PM_RUNTIME */ | ||
4261 | |||
4262 | /*---------------------- USB 3.0 Link PM functions ------------------------*/ | 4247 | /*---------------------- USB 3.0 Link PM functions ------------------------*/ |
4263 | 4248 | ||
4264 | #ifdef CONFIG_PM | ||
4265 | /* Service interval in nanoseconds = 2^(bInterval - 1) * 125us * 1000ns / 1us */ | 4249 | /* Service interval in nanoseconds = 2^(bInterval - 1) * 125us * 1000ns / 1us */ |
4266 | static unsigned long long xhci_service_interval_to_ns( | 4250 | static unsigned long long xhci_service_interval_to_ns( |
4267 | struct usb_endpoint_descriptor *desc) | 4251 | struct usb_endpoint_descriptor *desc) |
@@ -4692,6 +4676,17 @@ int xhci_disable_usb3_lpm_timeout(struct usb_hcd *hcd, | |||
4692 | } | 4676 | } |
4693 | #else /* CONFIG_PM */ | 4677 | #else /* CONFIG_PM */ |
4694 | 4678 | ||
4679 | int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd, | ||
4680 | struct usb_device *udev, int enable) | ||
4681 | { | ||
4682 | return 0; | ||
4683 | } | ||
4684 | |||
4685 | int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev) | ||
4686 | { | ||
4687 | return 0; | ||
4688 | } | ||
4689 | |||
4695 | int xhci_enable_usb3_lpm_timeout(struct usb_hcd *hcd, | 4690 | int xhci_enable_usb3_lpm_timeout(struct usb_hcd *hcd, |
4696 | struct usb_device *udev, enum usb3_link_state state) | 4691 | struct usb_device *udev, enum usb3_link_state state) |
4697 | { | 4692 | { |
diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c index 7843ef7dd0ff..29be0e654ecc 100644 --- a/drivers/usb/phy/phy-msm-usb.c +++ b/drivers/usb/phy/phy-msm-usb.c | |||
@@ -1761,7 +1761,7 @@ static int msm_otg_remove(struct platform_device *pdev) | |||
1761 | return 0; | 1761 | return 0; |
1762 | } | 1762 | } |
1763 | 1763 | ||
1764 | #ifdef CONFIG_PM_RUNTIME | 1764 | #ifdef CONFIG_PM |
1765 | static int msm_otg_runtime_idle(struct device *dev) | 1765 | static int msm_otg_runtime_idle(struct device *dev) |
1766 | { | 1766 | { |
1767 | struct msm_otg *motg = dev_get_drvdata(dev); | 1767 | struct msm_otg *motg = dev_get_drvdata(dev); |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index d53908438e95..7581518e3eff 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -545,6 +545,7 @@ acpi_status acpi_add_pm_notifier(struct acpi_device *adev, struct device *dev, | |||
545 | void (*work_func)(struct work_struct *work)); | 545 | void (*work_func)(struct work_struct *work)); |
546 | acpi_status acpi_remove_pm_notifier(struct acpi_device *adev); | 546 | acpi_status acpi_remove_pm_notifier(struct acpi_device *adev); |
547 | int acpi_pm_device_sleep_state(struct device *, int *, int); | 547 | int acpi_pm_device_sleep_state(struct device *, int *, int); |
548 | int acpi_pm_device_run_wake(struct device *, bool); | ||
548 | #else | 549 | #else |
549 | static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, | 550 | static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, |
550 | struct device *dev, | 551 | struct device *dev, |
@@ -564,11 +565,6 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) | |||
564 | return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3_COLD) ? | 565 | return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3_COLD) ? |
565 | m : ACPI_STATE_D0; | 566 | m : ACPI_STATE_D0; |
566 | } | 567 | } |
567 | #endif | ||
568 | |||
569 | #ifdef CONFIG_PM_RUNTIME | ||
570 | int acpi_pm_device_run_wake(struct device *, bool); | ||
571 | #else | ||
572 | static inline int acpi_pm_device_run_wake(struct device *dev, bool enable) | 568 | static inline int acpi_pm_device_run_wake(struct device *dev, bool enable) |
573 | { | 569 | { |
574 | return -ENODEV; | 570 | return -ENODEV; |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index d7a5fcf9ef0f..6bff83b1f298 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -572,16 +572,26 @@ static inline void arch_reserve_mem_area(acpi_physical_address addr, | |||
572 | #define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0) | 572 | #define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0) |
573 | #endif | 573 | #endif |
574 | 574 | ||
575 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM_RUNTIME) | 575 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM) |
576 | int acpi_dev_runtime_suspend(struct device *dev); | 576 | int acpi_dev_runtime_suspend(struct device *dev); |
577 | int acpi_dev_runtime_resume(struct device *dev); | 577 | int acpi_dev_runtime_resume(struct device *dev); |
578 | int acpi_subsys_runtime_suspend(struct device *dev); | 578 | int acpi_subsys_runtime_suspend(struct device *dev); |
579 | int acpi_subsys_runtime_resume(struct device *dev); | 579 | int acpi_subsys_runtime_resume(struct device *dev); |
580 | struct acpi_device *acpi_dev_pm_get_node(struct device *dev); | ||
581 | int acpi_dev_pm_attach(struct device *dev, bool power_on); | ||
580 | #else | 582 | #else |
581 | static inline int acpi_dev_runtime_suspend(struct device *dev) { return 0; } | 583 | static inline int acpi_dev_runtime_suspend(struct device *dev) { return 0; } |
582 | static inline int acpi_dev_runtime_resume(struct device *dev) { return 0; } | 584 | static inline int acpi_dev_runtime_resume(struct device *dev) { return 0; } |
583 | static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; } | 585 | static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; } |
584 | static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; } | 586 | static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; } |
587 | static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev) | ||
588 | { | ||
589 | return NULL; | ||
590 | } | ||
591 | static inline int acpi_dev_pm_attach(struct device *dev, bool power_on) | ||
592 | { | ||
593 | return -ENODEV; | ||
594 | } | ||
585 | #endif | 595 | #endif |
586 | 596 | ||
587 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP) | 597 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP) |
@@ -604,20 +614,6 @@ static inline int acpi_subsys_suspend(struct device *dev) { return 0; } | |||
604 | static inline int acpi_subsys_freeze(struct device *dev) { return 0; } | 614 | static inline int acpi_subsys_freeze(struct device *dev) { return 0; } |
605 | #endif | 615 | #endif |
606 | 616 | ||
607 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM) | ||
608 | struct acpi_device *acpi_dev_pm_get_node(struct device *dev); | ||
609 | int acpi_dev_pm_attach(struct device *dev, bool power_on); | ||
610 | #else | ||
611 | static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev) | ||
612 | { | ||
613 | return NULL; | ||
614 | } | ||
615 | static inline int acpi_dev_pm_attach(struct device *dev, bool power_on) | ||
616 | { | ||
617 | return -ENODEV; | ||
618 | } | ||
619 | #endif | ||
620 | |||
621 | #ifdef CONFIG_ACPI | 617 | #ifdef CONFIG_ACPI |
622 | __printf(3, 4) | 618 | __printf(3, 4) |
623 | void acpi_handle_printk(const char *level, acpi_handle handle, | 619 | void acpi_handle_printk(const char *level, acpi_handle handle, |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index aac0f9ea952a..534dc402c54f 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -398,7 +398,7 @@ struct request_queue { | |||
398 | */ | 398 | */ |
399 | struct kobject mq_kobj; | 399 | struct kobject mq_kobj; |
400 | 400 | ||
401 | #ifdef CONFIG_PM_RUNTIME | 401 | #ifdef CONFIG_PM |
402 | struct device *dev; | 402 | struct device *dev; |
403 | int rpm_status; | 403 | int rpm_status; |
404 | unsigned int nr_pending; | 404 | unsigned int nr_pending; |
@@ -1057,7 +1057,7 @@ extern void blk_put_queue(struct request_queue *); | |||
1057 | /* | 1057 | /* |
1058 | * block layer runtime pm functions | 1058 | * block layer runtime pm functions |
1059 | */ | 1059 | */ |
1060 | #ifdef CONFIG_PM_RUNTIME | 1060 | #ifdef CONFIG_PM |
1061 | extern void blk_pm_runtime_init(struct request_queue *q, struct device *dev); | 1061 | extern void blk_pm_runtime_init(struct request_queue *q, struct device *dev); |
1062 | extern int blk_pre_runtime_suspend(struct request_queue *q); | 1062 | extern int blk_pre_runtime_suspend(struct request_queue *q); |
1063 | extern void blk_post_runtime_suspend(struct request_queue *q, int err); | 1063 | extern void blk_post_runtime_suspend(struct request_queue *q, int err); |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 45e3e78c1e3a..66a656eb335b 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -342,7 +342,7 @@ struct dev_pm_ops { | |||
342 | #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) | 342 | #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) |
343 | #endif | 343 | #endif |
344 | 344 | ||
345 | #ifdef CONFIG_PM_RUNTIME | 345 | #ifdef CONFIG_PM |
346 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ | 346 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ |
347 | .runtime_suspend = suspend_fn, \ | 347 | .runtime_suspend = suspend_fn, \ |
348 | .runtime_resume = resume_fn, \ | 348 | .runtime_resume = resume_fn, \ |
@@ -351,14 +351,7 @@ struct dev_pm_ops { | |||
351 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) | 351 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) |
352 | #endif | 352 | #endif |
353 | 353 | ||
354 | #ifdef CONFIG_PM | 354 | #define SET_PM_RUNTIME_PM_OPS SET_RUNTIME_PM_OPS |
355 | #define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ | ||
356 | .runtime_suspend = suspend_fn, \ | ||
357 | .runtime_resume = resume_fn, \ | ||
358 | .runtime_idle = idle_fn, | ||
359 | #else | ||
360 | #define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) | ||
361 | #endif | ||
362 | 355 | ||
363 | /* | 356 | /* |
364 | * Use this if you want to use the same suspend and resume callbacks for suspend | 357 | * Use this if you want to use the same suspend and resume callbacks for suspend |
@@ -572,7 +565,7 @@ struct dev_pm_info { | |||
572 | #else | 565 | #else |
573 | unsigned int should_wakeup:1; | 566 | unsigned int should_wakeup:1; |
574 | #endif | 567 | #endif |
575 | #ifdef CONFIG_PM_RUNTIME | 568 | #ifdef CONFIG_PM |
576 | struct timer_list suspend_timer; | 569 | struct timer_list suspend_timer; |
577 | unsigned long timer_expires; | 570 | unsigned long timer_expires; |
578 | struct work_struct work; | 571 | struct work_struct work; |
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 1dd6c7f64166..6cd20d5e651b 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h | |||
@@ -156,6 +156,7 @@ extern void pm_genpd_init(struct generic_pm_domain *genpd, | |||
156 | 156 | ||
157 | extern int pm_genpd_poweron(struct generic_pm_domain *genpd); | 157 | extern int pm_genpd_poweron(struct generic_pm_domain *genpd); |
158 | extern int pm_genpd_name_poweron(const char *domain_name); | 158 | extern int pm_genpd_name_poweron(const char *domain_name); |
159 | extern void pm_genpd_poweroff_unused(void); | ||
159 | 160 | ||
160 | extern struct dev_power_governor simple_qos_governor; | 161 | extern struct dev_power_governor simple_qos_governor; |
161 | extern struct dev_power_governor pm_domain_always_on_gov; | 162 | extern struct dev_power_governor pm_domain_always_on_gov; |
@@ -230,6 +231,7 @@ static inline int pm_genpd_name_poweron(const char *domain_name) | |||
230 | { | 231 | { |
231 | return -ENOSYS; | 232 | return -ENOSYS; |
232 | } | 233 | } |
234 | static inline void pm_genpd_poweroff_unused(void) {} | ||
233 | #define simple_qos_governor NULL | 235 | #define simple_qos_governor NULL |
234 | #define pm_domain_always_on_gov NULL | 236 | #define pm_domain_always_on_gov NULL |
235 | #endif | 237 | #endif |
@@ -246,12 +248,6 @@ static inline int pm_genpd_name_add_device(const char *domain_name, | |||
246 | return __pm_genpd_name_add_device(domain_name, dev, NULL); | 248 | return __pm_genpd_name_add_device(domain_name, dev, NULL); |
247 | } | 249 | } |
248 | 250 | ||
249 | #ifdef CONFIG_PM_GENERIC_DOMAINS_RUNTIME | ||
250 | extern void pm_genpd_poweroff_unused(void); | ||
251 | #else | ||
252 | static inline void pm_genpd_poweroff_unused(void) {} | ||
253 | #endif | ||
254 | |||
255 | #ifdef CONFIG_PM_GENERIC_DOMAINS_SLEEP | 251 | #ifdef CONFIG_PM_GENERIC_DOMAINS_SLEEP |
256 | extern void pm_genpd_syscore_poweroff(struct device *dev); | 252 | extern void pm_genpd_syscore_poweroff(struct device *dev); |
257 | extern void pm_genpd_syscore_poweron(struct device *dev); | 253 | extern void pm_genpd_syscore_poweron(struct device *dev); |
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index 636e82834506..7b3ae0cffc05 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h | |||
@@ -154,6 +154,23 @@ void dev_pm_qos_constraints_destroy(struct device *dev); | |||
154 | int dev_pm_qos_add_ancestor_request(struct device *dev, | 154 | int dev_pm_qos_add_ancestor_request(struct device *dev, |
155 | struct dev_pm_qos_request *req, | 155 | struct dev_pm_qos_request *req, |
156 | enum dev_pm_qos_req_type type, s32 value); | 156 | enum dev_pm_qos_req_type type, s32 value); |
157 | int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value); | ||
158 | void dev_pm_qos_hide_latency_limit(struct device *dev); | ||
159 | int dev_pm_qos_expose_flags(struct device *dev, s32 value); | ||
160 | void dev_pm_qos_hide_flags(struct device *dev); | ||
161 | int dev_pm_qos_update_flags(struct device *dev, s32 mask, bool set); | ||
162 | s32 dev_pm_qos_get_user_latency_tolerance(struct device *dev); | ||
163 | int dev_pm_qos_update_user_latency_tolerance(struct device *dev, s32 val); | ||
164 | |||
165 | static inline s32 dev_pm_qos_requested_resume_latency(struct device *dev) | ||
166 | { | ||
167 | return dev->power.qos->resume_latency_req->data.pnode.prio; | ||
168 | } | ||
169 | |||
170 | static inline s32 dev_pm_qos_requested_flags(struct device *dev) | ||
171 | { | ||
172 | return dev->power.qos->flags_req->data.flr.flags; | ||
173 | } | ||
157 | #else | 174 | #else |
158 | static inline enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, | 175 | static inline enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, |
159 | s32 mask) | 176 | s32 mask) |
@@ -200,27 +217,6 @@ static inline int dev_pm_qos_add_ancestor_request(struct device *dev, | |||
200 | enum dev_pm_qos_req_type type, | 217 | enum dev_pm_qos_req_type type, |
201 | s32 value) | 218 | s32 value) |
202 | { return 0; } | 219 | { return 0; } |
203 | #endif | ||
204 | |||
205 | #ifdef CONFIG_PM_RUNTIME | ||
206 | int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value); | ||
207 | void dev_pm_qos_hide_latency_limit(struct device *dev); | ||
208 | int dev_pm_qos_expose_flags(struct device *dev, s32 value); | ||
209 | void dev_pm_qos_hide_flags(struct device *dev); | ||
210 | int dev_pm_qos_update_flags(struct device *dev, s32 mask, bool set); | ||
211 | s32 dev_pm_qos_get_user_latency_tolerance(struct device *dev); | ||
212 | int dev_pm_qos_update_user_latency_tolerance(struct device *dev, s32 val); | ||
213 | |||
214 | static inline s32 dev_pm_qos_requested_resume_latency(struct device *dev) | ||
215 | { | ||
216 | return dev->power.qos->resume_latency_req->data.pnode.prio; | ||
217 | } | ||
218 | |||
219 | static inline s32 dev_pm_qos_requested_flags(struct device *dev) | ||
220 | { | ||
221 | return dev->power.qos->flags_req->data.flr.flags; | ||
222 | } | ||
223 | #else | ||
224 | static inline int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value) | 220 | static inline int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value) |
225 | { return 0; } | 221 | { return 0; } |
226 | static inline void dev_pm_qos_hide_latency_limit(struct device *dev) {} | 222 | static inline void dev_pm_qos_hide_latency_limit(struct device *dev) {} |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 367f49b9a1c9..eda4feede048 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
@@ -35,16 +35,6 @@ extern int pm_generic_runtime_suspend(struct device *dev); | |||
35 | extern int pm_generic_runtime_resume(struct device *dev); | 35 | extern int pm_generic_runtime_resume(struct device *dev); |
36 | extern int pm_runtime_force_suspend(struct device *dev); | 36 | extern int pm_runtime_force_suspend(struct device *dev); |
37 | extern int pm_runtime_force_resume(struct device *dev); | 37 | extern int pm_runtime_force_resume(struct device *dev); |
38 | #else | ||
39 | static inline bool queue_pm_work(struct work_struct *work) { return false; } | ||
40 | |||
41 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } | ||
42 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } | ||
43 | static inline int pm_runtime_force_suspend(struct device *dev) { return 0; } | ||
44 | static inline int pm_runtime_force_resume(struct device *dev) { return 0; } | ||
45 | #endif | ||
46 | |||
47 | #ifdef CONFIG_PM_RUNTIME | ||
48 | 38 | ||
49 | extern int __pm_runtime_idle(struct device *dev, int rpmflags); | 39 | extern int __pm_runtime_idle(struct device *dev, int rpmflags); |
50 | extern int __pm_runtime_suspend(struct device *dev, int rpmflags); | 40 | extern int __pm_runtime_suspend(struct device *dev, int rpmflags); |
@@ -128,7 +118,14 @@ static inline void pm_runtime_mark_last_busy(struct device *dev) | |||
128 | ACCESS_ONCE(dev->power.last_busy) = jiffies; | 118 | ACCESS_ONCE(dev->power.last_busy) = jiffies; |
129 | } | 119 | } |
130 | 120 | ||
131 | #else /* !CONFIG_PM_RUNTIME */ | 121 | #else /* !CONFIG_PM */ |
122 | |||
123 | static inline bool queue_pm_work(struct work_struct *work) { return false; } | ||
124 | |||
125 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } | ||
126 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } | ||
127 | static inline int pm_runtime_force_suspend(struct device *dev) { return 0; } | ||
128 | static inline int pm_runtime_force_resume(struct device *dev) { return 0; } | ||
132 | 129 | ||
133 | static inline int __pm_runtime_idle(struct device *dev, int rpmflags) | 130 | static inline int __pm_runtime_idle(struct device *dev, int rpmflags) |
134 | { | 131 | { |
@@ -179,7 +176,7 @@ static inline unsigned long pm_runtime_autosuspend_expiration( | |||
179 | static inline void pm_runtime_set_memalloc_noio(struct device *dev, | 176 | static inline void pm_runtime_set_memalloc_noio(struct device *dev, |
180 | bool enable){} | 177 | bool enable){} |
181 | 178 | ||
182 | #endif /* !CONFIG_PM_RUNTIME */ | 179 | #endif /* !CONFIG_PM */ |
183 | 180 | ||
184 | static inline int pm_runtime_idle(struct device *dev) | 181 | static inline int pm_runtime_idle(struct device *dev) |
185 | { | 182 | { |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 447a7e2fc19b..f89c24a03bd9 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -637,7 +637,7 @@ static inline bool usb_acpi_power_manageable(struct usb_device *hdev, int index) | |||
637 | #endif | 637 | #endif |
638 | 638 | ||
639 | /* USB autosuspend and autoresume */ | 639 | /* USB autosuspend and autoresume */ |
640 | #ifdef CONFIG_PM_RUNTIME | 640 | #ifdef CONFIG_PM |
641 | extern void usb_enable_autosuspend(struct usb_device *udev); | 641 | extern void usb_enable_autosuspend(struct usb_device *udev); |
642 | extern void usb_disable_autosuspend(struct usb_device *udev); | 642 | extern void usb_disable_autosuspend(struct usb_device *udev); |
643 | 643 | ||
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index cd96a2bc3388..668898e29d0e 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -93,7 +93,7 @@ struct usb_hcd { | |||
93 | 93 | ||
94 | struct timer_list rh_timer; /* drives root-hub polling */ | 94 | struct timer_list rh_timer; /* drives root-hub polling */ |
95 | struct urb *status_urb; /* the current status urb */ | 95 | struct urb *status_urb; /* the current status urb */ |
96 | #ifdef CONFIG_PM_RUNTIME | 96 | #ifdef CONFIG_PM |
97 | struct work_struct wakeup_work; /* for remote wakeup */ | 97 | struct work_struct wakeup_work; /* for remote wakeup */ |
98 | #endif | 98 | #endif |
99 | 99 | ||
@@ -625,16 +625,13 @@ extern int usb_find_interface_driver(struct usb_device *dev, | |||
625 | extern void usb_root_hub_lost_power(struct usb_device *rhdev); | 625 | extern void usb_root_hub_lost_power(struct usb_device *rhdev); |
626 | extern int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg); | 626 | extern int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg); |
627 | extern int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg); | 627 | extern int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg); |
628 | #endif /* CONFIG_PM */ | ||
629 | |||
630 | #ifdef CONFIG_PM_RUNTIME | ||
631 | extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd); | 628 | extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd); |
632 | #else | 629 | #else |
633 | static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd) | 630 | static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd) |
634 | { | 631 | { |
635 | return; | 632 | return; |
636 | } | 633 | } |
637 | #endif /* CONFIG_PM_RUNTIME */ | 634 | #endif /* CONFIG_PM */ |
638 | 635 | ||
639 | /*-------------------------------------------------------------------------*/ | 636 | /*-------------------------------------------------------------------------*/ |
640 | 637 | ||
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig index 1eb7da7bc8e8..6e7708c2c21f 100644 --- a/kernel/power/Kconfig +++ b/kernel/power/Kconfig | |||
@@ -94,6 +94,7 @@ config PM_STD_PARTITION | |||
94 | config PM_SLEEP | 94 | config PM_SLEEP |
95 | def_bool y | 95 | def_bool y |
96 | depends on SUSPEND || HIBERNATE_CALLBACKS | 96 | depends on SUSPEND || HIBERNATE_CALLBACKS |
97 | select PM_RUNTIME | ||
97 | 98 | ||
98 | config PM_SLEEP_SMP | 99 | config PM_SLEEP_SMP |
99 | def_bool y | 100 | def_bool y |
@@ -131,7 +132,6 @@ config PM_WAKELOCKS_GC | |||
131 | 132 | ||
132 | config PM_RUNTIME | 133 | config PM_RUNTIME |
133 | bool "Run-time PM core functionality" | 134 | bool "Run-time PM core functionality" |
134 | depends on !IA64_HP_SIM | ||
135 | ---help--- | 135 | ---help--- |
136 | Enable functionality allowing I/O devices to be put into energy-saving | 136 | Enable functionality allowing I/O devices to be put into energy-saving |
137 | (low power) states at run time (or autosuspended) after a specified | 137 | (low power) states at run time (or autosuspended) after a specified |
@@ -298,10 +298,6 @@ config PM_GENERIC_DOMAINS_SLEEP | |||
298 | def_bool y | 298 | def_bool y |
299 | depends on PM_SLEEP && PM_GENERIC_DOMAINS | 299 | depends on PM_SLEEP && PM_GENERIC_DOMAINS |
300 | 300 | ||
301 | config PM_GENERIC_DOMAINS_RUNTIME | ||
302 | def_bool y | ||
303 | depends on PM_RUNTIME && PM_GENERIC_DOMAINS | ||
304 | |||
305 | config PM_GENERIC_DOMAINS_OF | 301 | config PM_GENERIC_DOMAINS_OF |
306 | def_bool y | 302 | def_bool y |
307 | depends on PM_GENERIC_DOMAINS && OF | 303 | depends on PM_GENERIC_DOMAINS && OF |