Commit 5de21bb9 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

ACPI / PM: Drop CONFIG_PM_RUNTIME from the ACPI core

After commit b2b49ccb (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: default avatarUlf Hansson <ulf.hansson@linaro.org>
Acked-by: default avatarKevin Hilman <khilman@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 4bea2b4c
...@@ -588,7 +588,6 @@ static int acpi_lpss_resume_early(struct device *dev) ...@@ -588,7 +588,6 @@ static int acpi_lpss_resume_early(struct device *dev)
} }
#endif /* CONFIG_PM_SLEEP */ #endif /* CONFIG_PM_SLEEP */
#ifdef CONFIG_PM_RUNTIME
static int acpi_lpss_runtime_suspend(struct device *dev) static int acpi_lpss_runtime_suspend(struct device *dev)
{ {
struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); 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,11 +630,11 @@ static int acpi_lpss_runtime_resume(struct device *dev)
return pm_generic_runtime_resume(dev); return pm_generic_runtime_resume(dev);
} }
#endif /* CONFIG_PM_RUNTIME */
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
static struct dev_pm_domain acpi_lpss_pm_domain = { static struct dev_pm_domain acpi_lpss_pm_domain = {
.ops = { .ops = {
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
.prepare = acpi_subsys_prepare, .prepare = acpi_subsys_prepare,
.complete = acpi_subsys_complete, .complete = acpi_subsys_complete,
...@@ -647,7 +646,6 @@ static struct dev_pm_domain acpi_lpss_pm_domain = { ...@@ -647,7 +646,6 @@ static struct dev_pm_domain acpi_lpss_pm_domain = {
.poweroff_late = acpi_lpss_suspend_late, .poweroff_late = acpi_lpss_suspend_late,
.restore_early = acpi_lpss_resume_early, .restore_early = acpi_lpss_resume_early,
#endif #endif
#ifdef CONFIG_PM_RUNTIME
.runtime_suspend = acpi_lpss_runtime_suspend, .runtime_suspend = acpi_lpss_runtime_suspend,
.runtime_resume = acpi_lpss_runtime_resume, .runtime_resume = acpi_lpss_runtime_resume,
#endif #endif
......
...@@ -692,7 +692,6 @@ static int acpi_device_wakeup(struct acpi_device *adev, u32 target_state, ...@@ -692,7 +692,6 @@ static int acpi_device_wakeup(struct acpi_device *adev, u32 target_state,
return 0; return 0;
} }
#ifdef CONFIG_PM_RUNTIME
/** /**
* acpi_pm_device_run_wake - Enable/disable remote wakeup for given device. * acpi_pm_device_run_wake - Enable/disable remote wakeup for given device.
* @dev: Device to enable/disable the platform to wake up. * @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,7 +713,6 @@ int acpi_pm_device_run_wake(struct device *phys_dev, bool enable)
return acpi_device_wakeup(adev, ACPI_STATE_S0, enable); return acpi_device_wakeup(adev, ACPI_STATE_S0, enable);
} }
EXPORT_SYMBOL(acpi_pm_device_run_wake); EXPORT_SYMBOL(acpi_pm_device_run_wake);
#endif /* CONFIG_PM_RUNTIME */
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
/** /**
...@@ -773,7 +771,6 @@ static int acpi_dev_pm_full_power(struct acpi_device *adev) ...@@ -773,7 +771,6 @@ static int acpi_dev_pm_full_power(struct acpi_device *adev)
acpi_device_set_power(adev, ACPI_STATE_D0) : 0; acpi_device_set_power(adev, ACPI_STATE_D0) : 0;
} }
#ifdef CONFIG_PM_RUNTIME
/** /**
* acpi_dev_runtime_suspend - Put device into a low-power state using ACPI. * acpi_dev_runtime_suspend - Put device into a low-power state using ACPI.
* @dev: Device to put into a low-power state. * @dev: Device to put into a low-power state.
...@@ -855,7 +852,6 @@ int acpi_subsys_runtime_resume(struct device *dev) ...@@ -855,7 +852,6 @@ int acpi_subsys_runtime_resume(struct device *dev)
return ret ? ret : pm_generic_runtime_resume(dev); return ret ? ret : pm_generic_runtime_resume(dev);
} }
EXPORT_SYMBOL_GPL(acpi_subsys_runtime_resume); EXPORT_SYMBOL_GPL(acpi_subsys_runtime_resume);
#endif /* CONFIG_PM_RUNTIME */
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
/** /**
...@@ -1023,10 +1019,9 @@ EXPORT_SYMBOL_GPL(acpi_subsys_freeze); ...@@ -1023,10 +1019,9 @@ EXPORT_SYMBOL_GPL(acpi_subsys_freeze);
static struct dev_pm_domain acpi_general_pm_domain = { static struct dev_pm_domain acpi_general_pm_domain = {
.ops = { .ops = {
#ifdef CONFIG_PM_RUNTIME #ifdef CONFIG_PM
.runtime_suspend = acpi_subsys_runtime_suspend, .runtime_suspend = acpi_subsys_runtime_suspend,
.runtime_resume = acpi_subsys_runtime_resume, .runtime_resume = acpi_subsys_runtime_resume,
#endif
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
.prepare = acpi_subsys_prepare, .prepare = acpi_subsys_prepare,
.complete = acpi_subsys_complete, .complete = acpi_subsys_complete,
...@@ -1037,6 +1032,7 @@ static struct dev_pm_domain acpi_general_pm_domain = { ...@@ -1037,6 +1032,7 @@ static struct dev_pm_domain acpi_general_pm_domain = {
.poweroff = acpi_subsys_suspend, .poweroff = acpi_subsys_suspend,
.poweroff_late = acpi_subsys_suspend_late, .poweroff_late = acpi_subsys_suspend_late,
.restore_early = acpi_subsys_resume_early, .restore_early = acpi_subsys_resume_early,
#endif
#endif #endif
}, },
}; };
......
...@@ -484,7 +484,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev) ...@@ -484,7 +484,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
/* Keep IOAPIC pin configuration when suspending */ /* Keep IOAPIC pin configuration when suspending */
if (dev->dev.power.is_prepared) if (dev->dev.power.is_prepared)
return; return;
#ifdef CONFIG_PM_RUNTIME #ifdef CONFIG_PM
if (dev->dev.power.runtime_status == RPM_SUSPENDING) if (dev->dev.power.runtime_status == RPM_SUSPENDING)
return; return;
#endif #endif
......
...@@ -516,6 +516,7 @@ acpi_status acpi_add_pm_notifier(struct acpi_device *adev, struct device *dev, ...@@ -516,6 +516,7 @@ acpi_status acpi_add_pm_notifier(struct acpi_device *adev, struct device *dev,
void (*work_func)(struct work_struct *work)); void (*work_func)(struct work_struct *work));
acpi_status acpi_remove_pm_notifier(struct acpi_device *adev); acpi_status acpi_remove_pm_notifier(struct acpi_device *adev);
int acpi_pm_device_sleep_state(struct device *, int *, int); int acpi_pm_device_sleep_state(struct device *, int *, int);
int acpi_pm_device_run_wake(struct device *, bool);
#else #else
static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
struct device *dev, struct device *dev,
...@@ -535,11 +536,6 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) ...@@ -535,11 +536,6 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3_COLD) ? return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3_COLD) ?
m : ACPI_STATE_D0; m : ACPI_STATE_D0;
} }
#endif
#ifdef CONFIG_PM_RUNTIME
int acpi_pm_device_run_wake(struct device *, bool);
#else
static inline int acpi_pm_device_run_wake(struct device *dev, bool enable) static inline int acpi_pm_device_run_wake(struct device *dev, bool enable)
{ {
return -ENODEV; return -ENODEV;
......
...@@ -553,16 +553,26 @@ static inline void arch_reserve_mem_area(acpi_physical_address addr, ...@@ -553,16 +553,26 @@ static inline void arch_reserve_mem_area(acpi_physical_address addr,
#define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0) #define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0)
#endif #endif
#if defined(CONFIG_ACPI) && defined(CONFIG_PM_RUNTIME) #if defined(CONFIG_ACPI) && defined(CONFIG_PM)
int acpi_dev_runtime_suspend(struct device *dev); int acpi_dev_runtime_suspend(struct device *dev);
int acpi_dev_runtime_resume(struct device *dev); int acpi_dev_runtime_resume(struct device *dev);
int acpi_subsys_runtime_suspend(struct device *dev); int acpi_subsys_runtime_suspend(struct device *dev);
int acpi_subsys_runtime_resume(struct device *dev); int acpi_subsys_runtime_resume(struct device *dev);
struct acpi_device *acpi_dev_pm_get_node(struct device *dev);
int acpi_dev_pm_attach(struct device *dev, bool power_on);
#else #else
static inline int acpi_dev_runtime_suspend(struct device *dev) { return 0; } static inline int acpi_dev_runtime_suspend(struct device *dev) { return 0; }
static inline int acpi_dev_runtime_resume(struct device *dev) { return 0; } static inline int acpi_dev_runtime_resume(struct device *dev) { return 0; }
static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; } static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; }
static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; } static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; }
static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
{
return NULL;
}
static inline int acpi_dev_pm_attach(struct device *dev, bool power_on)
{
return -ENODEV;
}
#endif #endif
#if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP) #if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP)
...@@ -585,20 +595,6 @@ static inline int acpi_subsys_suspend(struct device *dev) { return 0; } ...@@ -585,20 +595,6 @@ static inline int acpi_subsys_suspend(struct device *dev) { return 0; }
static inline int acpi_subsys_freeze(struct device *dev) { return 0; } static inline int acpi_subsys_freeze(struct device *dev) { return 0; }
#endif #endif
#if defined(CONFIG_ACPI) && defined(CONFIG_PM)
struct acpi_device *acpi_dev_pm_get_node(struct device *dev);
int acpi_dev_pm_attach(struct device *dev, bool power_on);
#else
static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
{
return NULL;
}
static inline int acpi_dev_pm_attach(struct device *dev, bool power_on)
{
return -ENODEV;
}
#endif
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
__printf(3, 4) __printf(3, 4)
void acpi_handle_printk(const char *level, acpi_handle handle, void acpi_handle_printk(const char *level, acpi_handle handle,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment