Lines Matching +full:button +full:-
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * OLPC XO-1.5 ebook switch driver
4 * (based on generic ACPI button driver)
19 #define MODULE_NAME "xo15-ebook"
29 MODULE_DESCRIPTION("OLPC XO-1.5 ebook switch driver");
45 struct ebook_switch *button = acpi_driver_data(device); in ebook_send_state() local
49 status = acpi_evaluate_integer(device->handle, "EBK", NULL, &state); in ebook_send_state()
51 return -EIO; 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()
85 struct ebook_switch *button; in ebook_switch_add() local
90 button = kzalloc(sizeof(struct ebook_switch), GFP_KERNEL); in ebook_switch_add()
91 if (!button) in ebook_switch_add()
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()
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()
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()
143 kfree(button); in ebook_switch_add()
149 struct ebook_switch *button = acpi_driver_data(device); in ebook_switch_remove() local
151 input_unregister_device(button->input); in ebook_switch_remove()
152 kfree(button); in ebook_switch_remove()