Lines Matching +full:wake +full:- +full:device
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Support for OLPC XO-1.5 System Control Interrupts (SCI)
5 * Copyright (C) 2009-2010 One Laptop per Child
8 #include <linux/device.h>
12 #include <linux/olpc-ec.h>
17 #define DRV_NAME "olpc-xo15-sci"
20 #define XO15_SCI_DEVICE_NAME "OLPC XO-1.5 SCI"
26 * The normal ACPI LID wakeup behavior is wake-on-open, but not
27 * wake-on-close. This is implemented as standard by the XO-1.5 DSDT.
30 * wake-on-close behavior. This is useful (e.g.) when we opportunistically
32 * wake up to turn the display off.
34 * This is controlled through a custom method in the XO-1.5 DSDT.
64 return -EINVAL; in lid_wake_on_close_store()
138 static int xo15_sci_add(struct acpi_device *device) in xo15_sci_add() argument
144 if (!device) in xo15_sci_add()
145 return -EINVAL; in xo15_sci_add()
147 strcpy(acpi_device_name(device), XO15_SCI_DEVICE_NAME); in xo15_sci_add()
148 strcpy(acpi_device_class(device), XO15_SCI_CLASS); in xo15_sci_add()
151 status = acpi_evaluate_integer(device->handle, "_GPE", NULL, &tmp); in xo15_sci_add()
153 return -EINVAL; in xo15_sci_add()
158 xo15_sci_gpe_handler, device); in xo15_sci_add()
160 return -ENODEV; in xo15_sci_add()
162 dev_info(&device->dev, "Initialized, GPE = 0x%lx\n", xo15_sci_gpe); in xo15_sci_add()
164 r = sysfs_create_file(&device->dev.kobj, &lid_wake_on_close_attr.attr); in xo15_sci_add()
174 /* Enable wake-on-EC */ in xo15_sci_add()
175 if (device->wakeup.flags.valid) in xo15_sci_add()
176 device_init_wakeup(&device->dev, true); in xo15_sci_add()
186 static void xo15_sci_remove(struct acpi_device *device) in xo15_sci_remove() argument
191 sysfs_remove_file(&device->dev.kobj, &lid_wake_on_close_attr.attr); in xo15_sci_remove()
195 static int xo15_sci_resume(struct device *dev) in xo15_sci_resume()