Merge branches 'acpi-pm', 'acpi-sleep' and 'acpi-button'
* acpi-pm: ACPI / PM: Use ACPI_COMPANION() instead of ACPI_HANDLE() ACPI / PM: Always enable wakeup GPEs when enabling device wakeup ACPI / PM: Revork the handling of ACPI device wakeup notifications PM: Create PM workqueue if runtime PM is not configured too * acpi-sleep: ACPI / sleep: Do not save NVS for new machines to accelerate S3 * acpi-button: ACPI / button: Do not propagate wakeup-from-suspend events
This commit is contained in:
+13
-19
@@ -315,12 +315,19 @@ struct acpi_device_wakeup_flags {
|
||||
u8 notifier_present:1; /* Wake-up notify handler has been installed */
|
||||
};
|
||||
|
||||
struct acpi_device_wakeup_context {
|
||||
struct work_struct work;
|
||||
struct device *dev;
|
||||
};
|
||||
|
||||
struct acpi_device_wakeup {
|
||||
acpi_handle gpe_device;
|
||||
u64 gpe_number;
|
||||
u64 sleep_state;
|
||||
struct list_head resources;
|
||||
struct acpi_device_wakeup_flags flags;
|
||||
struct acpi_device_wakeup_context context;
|
||||
struct wakeup_source *ws;
|
||||
int prepare_count;
|
||||
};
|
||||
|
||||
@@ -510,20 +517,18 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state);
|
||||
int acpi_disable_wakeup_device_power(struct acpi_device *dev);
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
|
||||
acpi_notify_handler handler, void *context);
|
||||
acpi_status acpi_remove_pm_notifier(struct acpi_device *adev,
|
||||
acpi_notify_handler handler);
|
||||
acpi_status acpi_add_pm_notifier(struct acpi_device *adev, struct device *dev,
|
||||
void (*work_func)(struct work_struct *work));
|
||||
acpi_status acpi_remove_pm_notifier(struct acpi_device *adev);
|
||||
int acpi_pm_device_sleep_state(struct device *, int *, int);
|
||||
#else
|
||||
static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
|
||||
acpi_notify_handler handler,
|
||||
void *context)
|
||||
struct device *dev,
|
||||
void (*work_func)(struct work_struct *work))
|
||||
{
|
||||
return AE_SUPPORT;
|
||||
}
|
||||
static inline acpi_status acpi_remove_pm_notifier(struct acpi_device *adev,
|
||||
acpi_notify_handler handler)
|
||||
static inline acpi_status acpi_remove_pm_notifier(struct acpi_device *adev)
|
||||
{
|
||||
return AE_SUPPORT;
|
||||
}
|
||||
@@ -538,13 +543,8 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM_RUNTIME
|
||||
int __acpi_device_run_wake(struct acpi_device *, bool);
|
||||
int acpi_pm_device_run_wake(struct device *, bool);
|
||||
#else
|
||||
static inline int __acpi_device_run_wake(struct acpi_device *adev, bool en)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int acpi_pm_device_run_wake(struct device *dev, bool enable)
|
||||
{
|
||||
return -ENODEV;
|
||||
@@ -552,14 +552,8 @@ static inline int acpi_pm_device_run_wake(struct device *dev, bool enable)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
int __acpi_device_sleep_wake(struct acpi_device *, u32, bool);
|
||||
int acpi_pm_device_sleep_wake(struct device *, bool);
|
||||
#else
|
||||
static inline int __acpi_device_sleep_wake(struct acpi_device *adev,
|
||||
u32 target_state, bool enable)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
|
||||
{
|
||||
return -ENODEV;
|
||||
|
||||
@@ -11,12 +11,17 @@
|
||||
#include <linux/acpi.h>
|
||||
|
||||
#ifdef CONFIG_ACPI
|
||||
extern acpi_status pci_acpi_add_bus_pm_notifier(struct acpi_device *dev,
|
||||
struct pci_bus *pci_bus);
|
||||
extern acpi_status pci_acpi_remove_bus_pm_notifier(struct acpi_device *dev);
|
||||
extern acpi_status pci_acpi_add_bus_pm_notifier(struct acpi_device *dev);
|
||||
static inline acpi_status pci_acpi_remove_bus_pm_notifier(struct acpi_device *dev)
|
||||
{
|
||||
return acpi_remove_pm_notifier(dev);
|
||||
}
|
||||
extern acpi_status pci_acpi_add_pm_notifier(struct acpi_device *dev,
|
||||
struct pci_dev *pci_dev);
|
||||
extern acpi_status pci_acpi_remove_pm_notifier(struct acpi_device *dev);
|
||||
static inline acpi_status pci_acpi_remove_pm_notifier(struct acpi_device *dev)
|
||||
{
|
||||
return acpi_remove_pm_notifier(dev);
|
||||
}
|
||||
extern phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle);
|
||||
|
||||
static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev)
|
||||
|
||||
@@ -24,11 +24,20 @@
|
||||
#define RPM_AUTO 0x08 /* Use autosuspend_delay */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
extern struct workqueue_struct *pm_wq;
|
||||
|
||||
static inline bool queue_pm_work(struct work_struct *work)
|
||||
{
|
||||
return queue_work(pm_wq, work);
|
||||
}
|
||||
|
||||
extern int pm_generic_runtime_suspend(struct device *dev);
|
||||
extern int pm_generic_runtime_resume(struct device *dev);
|
||||
extern int pm_runtime_force_suspend(struct device *dev);
|
||||
extern int pm_runtime_force_resume(struct device *dev);
|
||||
#else
|
||||
static inline bool queue_pm_work(struct work_struct *work) { return false; }
|
||||
|
||||
static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }
|
||||
static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
|
||||
static inline int pm_runtime_force_suspend(struct device *dev) { return 0; }
|
||||
@@ -37,8 +46,6 @@ static inline int pm_runtime_force_resume(struct device *dev) { return 0; }
|
||||
|
||||
#ifdef CONFIG_PM_RUNTIME
|
||||
|
||||
extern struct workqueue_struct *pm_wq;
|
||||
|
||||
extern int __pm_runtime_idle(struct device *dev, int rpmflags);
|
||||
extern int __pm_runtime_suspend(struct device *dev, int rpmflags);
|
||||
extern int __pm_runtime_resume(struct device *dev, int rpmflags);
|
||||
|
||||
Reference in New Issue
Block a user