Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/acpica/acpi_button.c
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
/* Hooks for the ACPI CA debugging infrastructure */ | /* Hooks for the ACPI CA debugging infrastructure */ | ||||
#define _COMPONENT ACPI_BUTTON | #define _COMPONENT ACPI_BUTTON | ||||
ACPI_MODULE_NAME("BUTTON") | ACPI_MODULE_NAME("BUTTON") | ||||
struct acpi_button_softc { | struct acpi_button_softc { | ||||
device_t button_dev; | device_t button_dev; | ||||
ACPI_HANDLE button_handle; | ACPI_HANDLE button_handle; | ||||
boolean_t button_type; | enum { ACPI_POWER_BUTTON, ACPI_SLEEP_BUTTON } button_type; | ||||
#define ACPI_POWER_BUTTON 0 | bool fixed; | ||||
#define ACPI_SLEEP_BUTTON 1 | |||||
boolean_t fixed; | |||||
#ifdef EVDEV_SUPPORT | #ifdef EVDEV_SUPPORT | ||||
struct evdev_dev *button_evdev; | struct evdev_dev *button_evdev; | ||||
#endif | #endif | ||||
}; | }; | ||||
#define ACPI_NOTIFY_BUTTON_PRESSED_FOR_SLEEP 0x80 | #define ACPI_NOTIFY_BUTTON_PRESSED_FOR_SLEEP 0x80 | ||||
#define ACPI_NOTIFY_BUTTON_PRESSED_FOR_WAKEUP 0x02 | #define ACPI_NOTIFY_BUTTON_PRESSED_FOR_WAKEUP 0x02 | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | return (ENXIO); | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
if (strcmp(str, "PNP0C0C") == 0) { | if (strcmp(str, "PNP0C0C") == 0) { | ||||
device_set_desc(dev, "Power Button"); | device_set_desc(dev, "Power Button"); | ||||
sc->button_type = ACPI_POWER_BUTTON; | sc->button_type = ACPI_POWER_BUTTON; | ||||
} else if (strcmp(str, "ACPI_FPB") == 0) { | } else if (strcmp(str, "ACPI_FPB") == 0) { | ||||
device_set_desc(dev, "Power Button (fixed)"); | device_set_desc(dev, "Power Button (fixed)"); | ||||
sc->button_type = ACPI_POWER_BUTTON; | sc->button_type = ACPI_POWER_BUTTON; | ||||
sc->fixed = 1; | sc->fixed = true; | ||||
} else if (strcmp(str, "PNP0C0E") == 0) { | } else if (strcmp(str, "PNP0C0E") == 0) { | ||||
device_set_desc(dev, "Sleep Button"); | device_set_desc(dev, "Sleep Button"); | ||||
sc->button_type = ACPI_SLEEP_BUTTON; | sc->button_type = ACPI_SLEEP_BUTTON; | ||||
} else if (strcmp(str, "ACPI_FSB") == 0) { | } else if (strcmp(str, "ACPI_FSB") == 0) { | ||||
device_set_desc(dev, "Sleep Button (fixed)"); | device_set_desc(dev, "Sleep Button (fixed)"); | ||||
sc->button_type = ACPI_SLEEP_BUTTON; | sc->button_type = ACPI_SLEEP_BUTTON; | ||||
sc->fixed = 1; | sc->fixed = true; | ||||
} | } | ||||
return (rv); | return (rv); | ||||
} | } | ||||
static int | static int | ||||
acpi_button_attach(device_t dev) | acpi_button_attach(device_t dev) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 175 Lines • Show Last 20 Lines |