Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235143
b: refs/heads/master
c: cd51e61
h: refs/heads/master
i:
  235141: f05a3ee
  235139: 11956b3
  235135: 3b2a09b
v: v3
  • Loading branch information
Rafael J. Wysocki committed Mar 14, 2011
1 parent df141c0 commit e27f889
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cb8f51bdadb7969139c2e39c2defd4cde98c1ea8
refs/heads/master: cd51e61cf4e8b220da37dc35e9c2dc2dc258b4de
1 change: 0 additions & 1 deletion trunk/drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ menuconfig ACPI
depends on !IA64_HP_SIM
depends on IA64 || X86
depends on PCI
depends on PM
select PNP
default y
help
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <linux/dmi.h>
#include <linux/suspend.h>

#include "internal.h"

Expand Down Expand Up @@ -1025,13 +1026,13 @@ static int __init acpi_init(void)

if (!result) {
pci_mmcfg_late_init();
if (!(pm_flags & PM_APM))
pm_flags |= PM_ACPI;
else {
if (pm_apm_enabled()) {
printk(KERN_INFO PREFIX
"APM is already active, exiting\n");
disable_acpi();
result = -ENODEV;
} else {
pm_set_acpi_flag();
}
} else
disable_acpi();
Expand Down
6 changes: 6 additions & 0 deletions trunk/include/linux/suspend.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ extern int unregister_pm_notifier(struct notifier_block *nb);
register_pm_notifier(&fn##_nb); \
}

extern bool pm_apm_enabled(void);
extern void pm_set_acpi_flag(void);

/* drivers/base/power/wakeup.c */
extern bool events_check_enabled;

Expand All @@ -292,6 +295,9 @@ static inline int unregister_pm_notifier(struct notifier_block *nb)

#define pm_notifier(fn, pri) do { (void)(fn); } while (0)

static inline bool pm_apm_enabled(void) { return false; }
static inline void pm_set_acpi_flag(void) {}

static inline bool pm_wakeup_pending(void) { return false; }
#endif /* !CONFIG_PM_SLEEP */

Expand Down
12 changes: 11 additions & 1 deletion trunk/kernel/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,20 @@

DEFINE_MUTEX(pm_mutex);

#ifdef CONFIG_PM_SLEEP

unsigned int pm_flags;
EXPORT_SYMBOL(pm_flags);

#ifdef CONFIG_PM_SLEEP
bool pm_apm_enabled(void)
{
return !!(pm_flags & PM_APM);
}

void pm_set_acpi_flag(void)
{
pm_flags |= PM_ACPI;
}

/* Routines for PM-transition notifications */

Expand Down

0 comments on commit e27f889

Please sign in to comment.