// SPDX-License-Identifier: GPL-2.0-or-later /* * Support for OLPC XO-1.5 System Control Interrupts (SCI) * * Copyright (C) 2009-2010 One Laptop per Child
*/
/* * 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 opportunistically * 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.
*/ staticint set_lid_wake_behavior(bool wake_on_close)
{
acpi_status status;
status = acpi_execute_simple_method(NULL, "\\_SB.PCI0.LID.LIDW", wake_on_close); if (ACPI_FAILURE(status)) {
pr_warn(PFX "failed to set lid behavior\n"); return 1;
}
if (psy) {
power_supply_changed(psy);
power_supply_put(psy);
}
}
staticvoid process_sci_queue(void)
{
u16 data; int r;
do {
r = olpc_ec_sci_query(&data); if (r || !data) break;
pr_debug(PFX "SCI 0x%x received\n", data);
switch (data) { case EC_SCI_SRC_BATERR: case EC_SCI_SRC_BATSOC: case EC_SCI_SRC_BATTERY: case EC_SCI_SRC_BATCRIT:
battery_status_changed(); break; case EC_SCI_SRC_ACPWR:
ac_status_changed(); break;
}
} while (data);
/* Get GPE bit assignment (EC events). */
status = acpi_evaluate_integer(device->handle, "_GPE", NULL, &tmp); if (ACPI_FAILURE(status)) return -EINVAL;
xo15_sci_gpe = tmp;
status = acpi_install_gpe_handler(NULL, xo15_sci_gpe,
ACPI_GPE_EDGE_TRIGGERED,
xo15_sci_gpe_handler, device); if (ACPI_FAILURE(status)) return -ENODEV;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.