Version:  2.0.40 2.2.26 2.4.37 3.9 3.10 3.11 3.12 3.13 3.14 3.15 3.16 3.17 3.18 3.19 4.0 4.1 4.2 4.3 4.4 4.5 4.6

Linux/arch/x86/platform/olpc/olpc-xo15-sci.c

  1 /*
  2  * Support for OLPC XO-1.5 System Control Interrupts (SCI)
  3  *
  4  * Copyright (C) 2009-2010 One Laptop per Child
  5  *
  6  * This program is free software; you can redistribute it and/or modify
  7  * it under the terms of the GNU General Public License as published by
  8  * the Free Software Foundation; either version 2 of the License, or
  9  * (at your option) any later version.
 10  */
 11 
 12 #include <linux/device.h>
 13 #include <linux/slab.h>
 14 #include <linux/workqueue.h>
 15 #include <linux/power_supply.h>
 16 #include <linux/olpc-ec.h>
 17 
 18 #include <linux/acpi.h>
 19 #include <asm/olpc.h>
 20 
 21 #define DRV_NAME                        "olpc-xo15-sci"
 22 #define PFX                             DRV_NAME ": "
 23 #define XO15_SCI_CLASS                  DRV_NAME
 24 #define XO15_SCI_DEVICE_NAME            "OLPC XO-1.5 SCI"
 25 
 26 static unsigned long                    xo15_sci_gpe;
 27 static bool                             lid_wake_on_close;
 28 
 29 /*
 30  * The normal ACPI LID wakeup behavior is wake-on-open, but not
 31  * wake-on-close. This is implemented as standard by the XO-1.5 DSDT.
 32  *
 33  * We provide here a sysfs attribute that will additionally enable
 34  * wake-on-close behavior. This is useful (e.g.) when we oportunistically
 35  * suspend with the display running; if the lid is then closed, we want to
 36  * wake up to turn the display off.
 37  *
 38  * This is controlled through a custom method in the XO-1.5 DSDT.
 39  */