Lines Matching +full:input +full:- +full:wakeup

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * OLPC XO-1.5 ebook switch driver
16 #include <linux/input.h>
19 #define MODULE_NAME "xo15-ebook"
29 MODULE_DESCRIPTION("OLPC XO-1.5 ebook switch driver");
39 struct input_dev *input; member
40 char phys[32]; /* for input device */
49 status = acpi_evaluate_integer(device->handle, "EBK", NULL, &state); in ebook_send_state()
51 return -EIO; in ebook_send_state()
53 /* input layer checks if event is redundant */ in ebook_send_state()
54 input_report_switch(button->input, SW_TABLET_MODE, !state); in ebook_send_state()
55 input_sync(button->input); in ebook_send_state()
67 acpi_handle_debug(device->handle, in ebook_switch_notify()
86 struct input_dev *input; in ebook_switch_add() local
92 return -ENOMEM; in ebook_switch_add()
94 device->driver_data = button; in ebook_switch_add()
96 button->input = input = input_allocate_device(); in ebook_switch_add()
97 if (!input) { in ebook_switch_add()
98 error = -ENOMEM; in ebook_switch_add()
107 dev_err(&device->dev, "Unsupported hid\n"); in ebook_switch_add()
108 error = -ENODEV; in ebook_switch_add()
115 snprintf(button->phys, sizeof(button->phys), "%s/button/input0", id->id); in ebook_switch_add()
117 input->name = name; in ebook_switch_add()
118 input->phys = button->phys; in ebook_switch_add()
119 input->id.bustype = BUS_HOST; in ebook_switch_add()
120 input->dev.parent = &device->dev; in ebook_switch_add()
122 input->evbit[0] = BIT_MASK(EV_SW); in ebook_switch_add()
123 set_bit(SW_TABLET_MODE, input->swbit); in ebook_switch_add()
125 error = input_register_device(input); in ebook_switch_add()
131 if (device->wakeup.flags.valid) { in ebook_switch_add()
132 /* Button's GPE is run-wake GPE */ in ebook_switch_add()
133 acpi_enable_gpe(device->wakeup.gpe_device, in ebook_switch_add()
134 device->wakeup.gpe_number); in ebook_switch_add()
135 device_set_wakeup_enable(&device->dev, true); in ebook_switch_add()
141 input_free_device(input); in ebook_switch_add()
151 input_unregister_device(button->input); in ebook_switch_remove()