Lines Matching +full:button +full:-

1 /*-
49 ACPI_MODULE_NAME("BUTTON")
106 if (acpi_disabled("button")) in acpi_button_probe()
114 device_set_desc(dev, "Power Button"); in acpi_button_probe()
115 sc->button_type = ACPI_POWER_BUTTON; in acpi_button_probe()
117 device_set_desc(dev, "Power Button (fixed)"); in acpi_button_probe()
118 sc->button_type = ACPI_POWER_BUTTON; in acpi_button_probe()
119 sc->fixed = true; in acpi_button_probe()
121 device_set_desc(dev, "Sleep Button"); in acpi_button_probe()
122 sc->button_type = ACPI_SLEEP_BUTTON; in acpi_button_probe()
124 device_set_desc(dev, "Sleep Button (fixed)"); in acpi_button_probe()
125 sc->button_type = ACPI_SLEEP_BUTTON; in acpi_button_probe()
126 sc->fixed = true; in acpi_button_probe()
143 sc->button_dev = dev; in acpi_button_attach()
144 sc->button_handle = acpi_get_handle(dev); in acpi_button_attach()
145 event = (sc->button_type == ACPI_SLEEP_BUTTON) ? in acpi_button_attach()
149 sc->button_evdev = evdev_alloc(); in acpi_button_attach()
150 evdev_set_name(sc->button_evdev, device_get_desc(dev)); in acpi_button_attach()
151 evdev_set_phys(sc->button_evdev, device_get_nameunit(dev)); in acpi_button_attach()
152 evdev_set_id(sc->button_evdev, BUS_HOST, 0, 0, 1); in acpi_button_attach()
153 evdev_support_event(sc->button_evdev, EV_SYN); in acpi_button_attach()
154 evdev_support_event(sc->button_evdev, EV_KEY); in acpi_button_attach()
155 evdev_support_key(sc->button_evdev, in acpi_button_attach()
156 (sc->button_type == ACPI_SLEEP_BUTTON) ? KEY_SLEEP : KEY_POWER); in acpi_button_attach()
158 if (evdev_register(sc->button_evdev)) in acpi_button_attach()
167 if (sc->fixed) { in acpi_button_attach()
177 status = AcpiInstallNotifyHandler(sc->button_handle, in acpi_button_attach()
181 device_printf(sc->button_dev, "couldn't install notify handler - %s\n", in acpi_button_attach()
188 if (acpi_parse_prw(sc->button_handle, &prw) == 0) in acpi_button_attach()
215 acpi_sc = acpi_device_get_parent_softc(sc->button_dev); in acpi_button_notify_sleep()
219 acpi_UserNotify("Button", sc->button_handle, sc->button_type); in acpi_button_notify_sleep()
221 switch (sc->button_type) { in acpi_button_notify_sleep()
223 ACPI_VPRINT(sc->button_dev, acpi_sc, "power button pressed\n"); in acpi_button_notify_sleep()
227 ACPI_VPRINT(sc->button_dev, acpi_sc, "sleep button pressed\n"); in acpi_button_notify_sleep()
231 break; /* unknown button type */ in acpi_button_notify_sleep()
244 acpi_sc = acpi_device_get_parent_softc(sc->button_dev); in acpi_button_notify_wakeup()
248 acpi_UserNotify("Button", sc->button_handle, sc->button_type); in acpi_button_notify_wakeup()
250 switch (sc->button_type) { in acpi_button_notify_wakeup()
252 ACPI_VPRINT(sc->button_dev, acpi_sc, "wakeup by power button\n"); in acpi_button_notify_wakeup()
256 ACPI_VPRINT(sc->button_dev, acpi_sc, "wakeup by sleep button\n"); in acpi_button_notify_wakeup()
260 break; /* unknown button type */ in acpi_button_notify_wakeup()
283 device_printf(sc->button_dev, "unknown notify %#x\n", notify); in acpi_button_notify_handler()
288 key = (sc->button_type == ACPI_SLEEP_BUTTON) ? KEY_SLEEP : KEY_POWER; in acpi_button_notify_handler()
289 evdev_push_key(sc->button_evdev, key, 1); in acpi_button_notify_handler()
290 evdev_sync(sc->button_evdev); in acpi_button_notify_handler()
291 evdev_push_key(sc->button_evdev, key, 0); in acpi_button_notify_handler()
292 evdev_sync(sc->button_evdev); in acpi_button_notify_handler()
306 acpi_button_notify_handler(sc->button_handle, in acpi_button_fixed_handler()