Patch from Richard Purdie
ARM doesn't use ACPI so ARM's apm implementation has no need to depend
on PM_LEGACY. This patch removes that dependency.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
config APM
tristate "Advanced Power Management Emulation"
config APM
tristate "Advanced Power Management Emulation"
---help---
APM is a BIOS specification for saving power using several different
techniques. This is mostly useful for battery powered laptops with
---help---
APM is a BIOS specification for saving power using several different
techniques. This is mostly useful for battery powered laptops with
#include <linux/apm_bios.h>
#include <linux/sched.h>
#include <linux/pm.h>
#include <linux/apm_bios.h>
#include <linux/sched.h>
#include <linux/pm.h>
-#include <linux/pm_legacy.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/list.h>
*/
static int suspends_pending;
static int apm_disabled;
*/
static int suspends_pending;
static int apm_disabled;
+static int arm_apm_active;
static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue);
static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue);
static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
apm_event_t event;
wait_event_interruptible(kapmd_wait,
apm_event_t event;
wait_event_interruptible(kapmd_wait,
- !queue_empty(&kapmd_queue) || !pm_active);
+ !queue_empty(&kapmd_queue) || !arm_apm_active);
break;
spin_lock_irq(&kapmd_queue_lock);
break;
spin_lock_irq(&kapmd_queue_lock);
- if (PM_IS_ACTIVE()) {
- printk(KERN_NOTICE "apm: overridden by ACPI.\n");
- return -EINVAL;
- }
-
- pm_active = 1;
ret = kernel_thread(kapmd, NULL, CLONE_KERNEL);
if (ret < 0) {
ret = kernel_thread(kapmd, NULL, CLONE_KERNEL);
if (ret < 0) {
if (ret != 0) {
remove_proc_entry("apm", NULL);
if (ret != 0) {
remove_proc_entry("apm", NULL);
wake_up(&kapmd_wait);
wait_for_completion(&kapmd_exit);
}
wake_up(&kapmd_wait);
wait_for_completion(&kapmd_exit);
}
misc_deregister(&apm_device);
remove_proc_entry("apm", NULL);
misc_deregister(&apm_device);
remove_proc_entry("apm", NULL);
wake_up(&kapmd_wait);
wait_for_completion(&kapmd_exit);
}
wake_up(&kapmd_wait);
wait_for_completion(&kapmd_exit);
}