diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-11-27 16:38:23 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-12-03 18:50:19 -0500 |
commit | 5de21bb998b8e816e6a1df1f2c04d95fb6e27a5d (patch) | |
tree | 836c77264fd2f659d6c32572b8c5ae4629152c84 | |
parent | 4bea2b4cd93600e4c3aed6059a095209d3fc91b9 (diff) |
ACPI / PM: Drop CONFIG_PM_RUNTIME from the ACPI core
After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
selected) PM_RUNTIME is always set if PM is set, so quite a few
depend on CONFIG_PM.
Replace CONFIG_PM_RUNTIME with CONFIG_PM in the ACPI core code.
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/acpi/acpi_lpss.c | 4 | ||||
-rw-r--r-- | drivers/acpi/device_pm.c | 8 | ||||
-rw-r--r-- | drivers/acpi/pci_irq.c | 2 | ||||
-rw-r--r-- | include/acpi/acpi_bus.h | 6 | ||||
-rw-r--r-- | include/linux/acpi.h | 26 |
5 files changed, 16 insertions, 30 deletions
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 7db193160766..20c0a670c75a 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/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index f34a0835aa4f..78f7521417e3 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -516,6 +516,7 @@ acpi_status acpi_add_pm_notifier(struct acpi_device *adev, struct device *dev, | |||
516 | void (*work_func)(struct work_struct *work)); | 516 | void (*work_func)(struct work_struct *work)); |
517 | acpi_status acpi_remove_pm_notifier(struct acpi_device *adev); | 517 | acpi_status acpi_remove_pm_notifier(struct acpi_device *adev); |
518 | int acpi_pm_device_sleep_state(struct device *, int *, int); | 518 | int acpi_pm_device_sleep_state(struct device *, int *, int); |
519 | int acpi_pm_device_run_wake(struct device *, bool); | ||
519 | #else | 520 | #else |
520 | static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, | 521 | static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, |
521 | struct device *dev, | 522 | struct device *dev, |
@@ -535,11 +536,6 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) | |||
535 | return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3_COLD) ? | 536 | return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3_COLD) ? |
536 | m : ACPI_STATE_D0; | 537 | m : ACPI_STATE_D0; |
537 | } | 538 | } |
538 | #endif | ||
539 | |||
540 | #ifdef CONFIG_PM_RUNTIME | ||
541 | int acpi_pm_device_run_wake(struct device *, bool); | ||
542 | #else | ||
543 | static inline int acpi_pm_device_run_wake(struct device *dev, bool enable) | 539 | static inline int acpi_pm_device_run_wake(struct device *dev, bool enable) |
544 | { | 540 | { |
545 | return -ENODEV; | 541 | return -ENODEV; |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 407a12f663eb..77329be250b2 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -553,16 +553,26 @@ static inline void arch_reserve_mem_area(acpi_physical_address addr, | |||
553 | #define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0) | 553 | #define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0) |
554 | #endif | 554 | #endif |
555 | 555 | ||
556 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM_RUNTIME) | 556 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM) |
557 | int acpi_dev_runtime_suspend(struct device *dev); | 557 | int acpi_dev_runtime_suspend(struct device *dev); |
558 | int acpi_dev_runtime_resume(struct device *dev); | 558 | int acpi_dev_runtime_resume(struct device *dev); |
559 | int acpi_subsys_runtime_suspend(struct device *dev); | 559 | int acpi_subsys_runtime_suspend(struct device *dev); |
560 | int acpi_subsys_runtime_resume(struct device *dev); | 560 | int acpi_subsys_runtime_resume(struct device *dev); |
561 | struct acpi_device *acpi_dev_pm_get_node(struct device *dev); | ||
562 | int acpi_dev_pm_attach(struct device *dev, bool power_on); | ||
561 | #else | 563 | #else |
562 | static inline int acpi_dev_runtime_suspend(struct device *dev) { return 0; } | 564 | static inline int acpi_dev_runtime_suspend(struct device *dev) { return 0; } |
563 | static inline int acpi_dev_runtime_resume(struct device *dev) { return 0; } | 565 | static inline int acpi_dev_runtime_resume(struct device *dev) { return 0; } |
564 | static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; } | 566 | static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; } |
565 | static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; } | 567 | static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; } |
568 | static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev) | ||
569 | { | ||
570 | return NULL; | ||
571 | } | ||
572 | static inline int acpi_dev_pm_attach(struct device *dev, bool power_on) | ||
573 | { | ||
574 | return -ENODEV; | ||
575 | } | ||
566 | #endif | 576 | #endif |
567 | 577 | ||
568 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP) | 578 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP) |
@@ -585,20 +595,6 @@ static inline int acpi_subsys_suspend(struct device *dev) { return 0; } | |||
585 | static inline int acpi_subsys_freeze(struct device *dev) { return 0; } | 595 | static inline int acpi_subsys_freeze(struct device *dev) { return 0; } |
586 | #endif | 596 | #endif |
587 | 597 | ||
588 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM) | ||
589 | struct acpi_device *acpi_dev_pm_get_node(struct device *dev); | ||
590 | int acpi_dev_pm_attach(struct device *dev, bool power_on); | ||
591 | #else | ||
592 | static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev) | ||
593 | { | ||
594 | return NULL; | ||
595 | } | ||
596 | static inline int acpi_dev_pm_attach(struct device *dev, bool power_on) | ||
597 | { | ||
598 | return -ENODEV; | ||
599 | } | ||
600 | #endif | ||
601 | |||
602 | #ifdef CONFIG_ACPI | 598 | #ifdef CONFIG_ACPI |
603 | __printf(3, 4) | 599 | __printf(3, 4) |
604 | void acpi_handle_printk(const char *level, acpi_handle handle, | 600 | void acpi_handle_printk(const char *level, acpi_handle handle, |