]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
x86-olpc-xo15-sci-enable-lid-close-wakeup-control-through-sysfs-v2
authorDaniel Drake <dsd@laptop.org>
Fri, 16 Dec 2011 04:49:28 +0000 (15:49 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 21 Dec 2011 06:00:06 +0000 (17:00 +1100)
v2: Fix sscanf usage error and add an explanatory comment in the code, both pointed out by Andrew Morton. Thanks!

Signed-off-by: Daniel Drake <dsd@laptop.org>
Cc: Andres Salomon <dilinger@queued.net>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/x86/platform/olpc/olpc-xo15-sci.c

index 2dd700351e7a5d4ed913fc382e64440b7108072e..e1869b48e6e98932526ffac12ade2dfcadc6dc8b 100644 (file)
 static unsigned long xo15_sci_gpe;
 static bool lid_wake_on_close;
 
+/*
+ * The normal ACPI LID wakeup behavior is wake-on-open, but not
+ * wake-on-close. This is implemented as standard by the XO-1.5 DSDT.
+ *
+ * We provide here a sysfs attribute that will additionally enable
+ * wake-on-close behavior. This is useful (e.g.) when we oportunistically
+ * suspend with the display running; if the lid is then closed, we want to
+ * wake up to turn the display off.
+ *
+ * This is controlled through a custom method in the XO-1.5 DSDT.
+ */
 static int set_lid_wake_behavior(bool wake_on_close)
 {
        struct acpi_object_list arg_list;
@@ -39,7 +50,7 @@ static int set_lid_wake_behavior(bool wake_on_close)
        status = acpi_evaluate_object(NULL, "\\_SB.PCI0.LID.LIDW", &arg_list,
                                      NULL);
        if (ACPI_FAILURE(status)) {
-               pr_warning(PFX "failed to set lid behaviour\n");
+               pr_warning(PFX "failed to set lid behavior\n");
                return 1;
        }