Lines Matching refs:button
33 const struct gpio_keys_button *button;
97 * @type: type of button (%EV_KEY, %EV_SW)
112 * @type: type of button (%EV_KEY, %EV_SW)
126 * gpio_keys_disable_button() - disables given GPIO button
127 * @bdata: button data for button to be disabled
129 * Disables button pointed by @bdata. This is done by masking
130 * IRQ line. After this function is called, button won't generate
156 * gpio_keys_enable_button() - enables given GPIO button
157 * @bdata: button data for button to be disabled
159 * Enables given button pointed by @bdata.
163 * to enable the same button at the same time.
177 * @type: button type (%EV_KEY, %EV_SW)
203 if (bdata->button->type != type)
225 * @type: button type (%EV_KEY, %EV_SW)
257 if (bdata->button->type != type)
261 !bdata->button->can_disable) {
272 if (bdata->button->type != type)
358 const struct gpio_keys_button *button = bdata->button;
360 unsigned int type = button->type ?: EV_KEY;
372 input_event(input, type, button->code, button->value);
386 if (bdata->button->wakeup)
396 if (bdata->button->wakeup) {
397 const struct gpio_keys_button *button = bdata->button;
401 (button->type == 0 || button->type == EV_KEY)) {
407 input_report_key(bdata->input, button->code, 1);
444 if (bdata->button->wakeup)
480 const struct gpio_keys_button *button,
484 const char *desc = button->desc ? button->desc : "gpio_keys";
493 bdata->button = button;
514 } else if (gpio_is_valid(button->gpio)) {
521 if (button->active_low)
524 error = devm_gpio_request_one(dev, button->gpio, flags, desc);
527 button->gpio, error);
531 bdata->gpiod = gpio_to_desc(button->gpio);
539 if (button->debounce_interval) {
541 button->debounce_interval * 1000);
545 button->debounce_interval;
548 if (button->irq) {
549 bdata->irq = button->irq;
556 button->gpio, error);
567 switch (button->wakeup_event_action) {
585 if (!button->irq) {
586 dev_err(dev, "Found button without gpio or irq\n");
590 bdata->irq = button->irq;
592 if (button->type && button->type != EV_KEY) {
597 bdata->release_delay = button->debounce_interval;
610 *bdata->code = button->code;
611 input_set_capability(input, button->type ?: EV_KEY, *bdata->code);
625 * If platform has specified that the button can be disabled,
628 if (!button->can_disable)
693 struct gpio_keys_button *button;
702 sizeof(*pdata) + nbuttons * sizeof(*button),
707 button = (struct gpio_keys_button *)(pdata + 1);
709 pdata->buttons = button;
718 button->irq =
722 &button->code)) {
728 fwnode_property_read_string(child, "label", &button->desc);
731 &button->type))
732 button->type = EV_KEY;
734 button->wakeup =
740 &button->wakeup_event_action);
742 button->can_disable =
746 &button->debounce_interval))
747 button->debounce_interval = 5;
749 button++;
823 const struct gpio_keys_button *button = &pdata->buttons[i];
836 button, i, child);
842 if (button->wakeup)
921 if (bdata->button->wakeup) {
934 if (bdata->button->wakeup)