12 #include <linux/device.h>
13 #include <linux/slab.h>
22 #define DRV_NAME "olpc-xo15-sci"
23 #define PFX DRV_NAME ": "
24 #define XO15_SCI_CLASS DRV_NAME
25 #define XO15_SCI_DEVICE_NAME "OLPC XO-1.5 SCI"
27 static unsigned long xo15_sci_gpe;
28 static bool lid_wake_on_close;
41 static int set_lid_wake_behavior(
bool wake_on_close)
50 arg.
integer.value = wake_on_close;
58 lid_wake_on_close = wake_on_close;
66 return sprintf(buf,
"%u\n", lid_wake_on_close);
71 const char *
buf,
size_t n)
75 if (
sscanf(buf,
"%u", &val) != 1)
78 set_lid_wake_behavior(!!val);
84 __ATTR(lid_wake_on_close, 0644,
85 lid_wake_on_close_show,
86 lid_wake_on_close_store);
88 static void battery_status_changed(
void)
98 static void ac_status_changed(
void)
108 static void process_sci_queue(
void)
125 battery_status_changed();
150 static int xo15_sci_add(
struct acpi_device *
device)
152 unsigned long long tmp;
170 xo15_sci_gpe_handler, device);
174 dev_info(&device->dev,
"Initialized, GPE = 0x%lx\n", xo15_sci_gpe);
187 if (device->wakeup.flags.valid)
198 static int xo15_sci_remove(
struct acpi_device *device,
int type)
207 static int xo15_sci_resume(
struct device *
dev)
213 battery_status_changed();
226 static struct acpi_driver xo15_sci_drv = {
229 .ids = xo15_sci_device_ids,
232 .remove = xo15_sci_remove,
234 .drv.pm = &xo15_sci_pm,
237 static int __init xo15_sci_init(
void)