Lines Matching defs:button
3 * button.c - ACPI Button Driver
9 #define pr_fmt(fmt) "ACPI: button: " fmt
22 #include <acpi/button.h>
26 #define ACPI_BUTTON_CLASS "button"
58 ACPI_MODULE_NAME("button");
144 .name = "button",
194 struct acpi_button *button = acpi_driver_data(device);
206 button->last_state != !!state)
211 next_report = ktime_add(button->last_time,
213 if (button->last_state == !!state &&
255 input_report_switch(button->input,
257 input_sync(button->input);
265 input_report_switch(button->input, SW_LID, !state);
266 input_sync(button->input);
267 button->last_state = !!state;
268 button->last_time = ktime_get();
288 struct acpi_button *button = acpi_driver_data(device);
293 if (button->type != ACPI_BUTTON_TYPE_LID)
301 /* create /proc/acpi/button */
306 /* create /proc/acpi/button/lid */
313 /* create /proc/acpi/button/lid/LID/ */
320 /* create /proc/acpi/button/lid/LID/state */
347 struct acpi_button *button = acpi_driver_data(device);
349 if (button->type != ACPI_BUTTON_TYPE_LID)
394 struct acpi_button *button = acpi_driver_data(device);
408 button->lid_state_initialized = true;
413 struct acpi_button *button = acpi_driver_data(device);
421 input = button->input;
422 if (button->type == ACPI_BUTTON_TYPE_LID) {
423 if (button->lid_state_initialized)
429 if (button->suspended)
442 event, ++button->pushed);
456 struct acpi_button *button = acpi_driver_data(device);
458 button->suspended = true;
465 struct acpi_button *button = acpi_driver_data(device);
467 button->suspended = false;
468 if (button->type == ACPI_BUTTON_TYPE_LID) {
469 button->last_state = !!acpi_lid_evaluate_state(device);
470 button->last_time = ktime_get();
480 struct acpi_button *button = acpi_driver_data(device);
482 button->last_state = !!acpi_lid_evaluate_state(device);
483 button->last_time = ktime_get();
491 struct acpi_button *button;
501 button = kzalloc(sizeof(struct acpi_button), GFP_KERNEL);
502 if (!button)
505 device->driver_data = button;
507 button->input = input = input_allocate_device();
518 button->type = ACPI_BUTTON_TYPE_POWER;
524 button->type = ACPI_BUTTON_TYPE_SLEEP;
529 button->type = ACPI_BUTTON_TYPE_LID;
544 snprintf(button->phys, sizeof(button->phys), "%s/button/input0", hid);
547 input->phys = button->phys;
549 input->id.product = button->type;
552 switch (button->type) {
570 if (button->type == ACPI_BUTTON_TYPE_LID) {
587 kfree(button);
593 struct acpi_button *button = acpi_driver_data(device);
596 input_unregister_device(button->input);
597 kfree(button);