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"
31 MODULE_DESCRIPTION("OLPC XO-1.5 ebook switch driver");
47 struct ebook_switch *button = acpi_driver_data(device); in ebook_send_state() local
51 status = acpi_evaluate_integer(device->handle, "EBK", NULL, &state); in ebook_send_state()
53 return -EIO; in ebook_send_state()
56 input_report_switch(button->input, SW_TABLET_MODE, !state); in ebook_send_state()
57 input_sync(button->input); in ebook_send_state()
86 struct ebook_switch *button; in ebook_switch_add() local
92 button = kzalloc(sizeof(struct ebook_switch), GFP_KERNEL); in ebook_switch_add()
93 if (!button) in ebook_switch_add()
94 return -ENOMEM; in ebook_switch_add()
96 device->driver_data = button; in ebook_switch_add()
98 button->input = input = input_allocate_device(); in ebook_switch_add()
100 error = -ENOMEM; in ebook_switch_add()
109 error = -ENODEV; in ebook_switch_add()
116 snprintf(button->phys, sizeof(button->phys), "%s/button/input0", hid); in ebook_switch_add()
118 input->name = name; in ebook_switch_add()
119 input->phys = button->phys; in ebook_switch_add()
120 input->id.bustype = BUS_HOST; in ebook_switch_add()
121 input->dev.parent = &device->dev; in ebook_switch_add()
123 input->evbit[0] = BIT_MASK(EV_SW); in ebook_switch_add()
124 set_bit(SW_TABLET_MODE, input->swbit); in ebook_switch_add()
132 if (device->wakeup.flags.valid) { in ebook_switch_add()
133 /* Button's GPE is run-wake GPE */ in ebook_switch_add()
134 acpi_enable_gpe(device->wakeup.gpe_device, in ebook_switch_add()
135 device->wakeup.gpe_number); in ebook_switch_add()
136 device_set_wakeup_enable(&device->dev, true); in ebook_switch_add()
144 kfree(button); in ebook_switch_add()
150 struct ebook_switch *button = acpi_driver_data(device); in ebook_switch_remove() local
152 input_unregister_device(button->input); in ebook_switch_remove()
153 kfree(button); in ebook_switch_remove()