Lines Matching full:button

34 	const struct gpio_keys_button *button;  member
102 * @type: type of button (%EV_KEY, %EV_SW)
117 * @type: type of button (%EV_KEY, %EV_SW)
143 * gpio_keys_disable_button() - disables given GPIO button
144 * @bdata: button data for button to be disabled
146 * Disables button pointed by @bdata. This is done by masking
147 * IRQ line. After this function is called, button won't generate
168 * gpio_keys_enable_button() - enables given GPIO button
169 * @bdata: button data for button to be disabled
171 * Enables given button pointed by @bdata.
175 * to enable the same button at the same time.
189 * @type: button type (%EV_KEY, %EV_SW)
215 if (bdata->button->type != type) in gpio_keys_attr_show_helper()
237 * @type: button type (%EV_KEY, %EV_SW)
266 if (bdata->button->type != type) in gpio_keys_attr_store_helper()
270 !bdata->button->can_disable) { in gpio_keys_attr_store_helper()
280 if (bdata->button->type != type) in gpio_keys_attr_store_helper()
362 const struct gpio_keys_button *button = bdata->button; in gpio_keys_gpio_report_event() local
364 unsigned int type = button->type ?: EV_KEY; in gpio_keys_gpio_report_event()
378 input_event(input, type, button->code, button->value); in gpio_keys_gpio_report_event()
389 if (bdata->button->wakeup) in gpio_keys_debounce_event()
417 if (bdata->button->wakeup) { in gpio_keys_gpio_isr()
418 const struct gpio_keys_button *button = bdata->button; in gpio_keys_gpio_isr() local
422 (button->type == 0 || button->type == EV_KEY)) { in gpio_keys_gpio_isr()
428 input_report_key(bdata->input, button->code, 1); in gpio_keys_gpio_isr()
471 if (bdata->button->wakeup) in gpio_keys_irq_isr()
497 const struct gpio_keys_button *button, in gpio_keys_setup_key() argument
501 const char *desc = button->desc ? button->desc : "gpio_keys"; in gpio_keys_setup_key()
511 bdata->button = button; in gpio_keys_setup_key()
529 } else if (gpio_is_valid(button->gpio)) { in gpio_keys_setup_key()
536 if (button->active_low) in gpio_keys_setup_key()
539 error = devm_gpio_request_one(dev, button->gpio, flags, desc); in gpio_keys_setup_key()
542 button->gpio, error); in gpio_keys_setup_key()
546 bdata->gpiod = gpio_to_desc(button->gpio); in gpio_keys_setup_key()
554 if (button->debounce_interval) { in gpio_keys_setup_key()
556 button->debounce_interval * 1000); in gpio_keys_setup_key()
560 button->debounce_interval; in gpio_keys_setup_key()
574 * interrupt may be used as the main button interrupt for in gpio_keys_setup_key()
579 if (button->irq) { in gpio_keys_setup_key()
580 bdata->irq = button->irq; in gpio_keys_setup_key()
587 button->gpio); in gpio_keys_setup_key()
602 switch (button->wakeup_event_action) { in gpio_keys_setup_key()
620 if (!button->irq) { in gpio_keys_setup_key()
621 dev_err(dev, "Found button without gpio or irq\n"); in gpio_keys_setup_key()
625 bdata->irq = button->irq; in gpio_keys_setup_key()
627 if (button->type && button->type != EV_KEY) { in gpio_keys_setup_key()
632 bdata->release_delay = button->debounce_interval; in gpio_keys_setup_key()
647 *bdata->code = button->code; in gpio_keys_setup_key()
648 input_set_capability(input, button->type ?: EV_KEY, *bdata->code); in gpio_keys_setup_key()
662 * If platform has specified that the button can be disabled, in gpio_keys_setup_key()
665 if (!button->can_disable) in gpio_keys_setup_key()
676 if (!button->wakeirq) in gpio_keys_setup_key()
684 bdata->wakeirq = button->wakeirq; in gpio_keys_setup_key()
702 * IRQF_SHARED was set based on !button->can_disable. in gpio_keys_setup_key()
760 struct gpio_keys_button *button; in gpio_keys_get_devtree_pdata() local
768 sizeof(*pdata) + nbuttons * sizeof(*button), in gpio_keys_get_devtree_pdata()
773 button = (struct gpio_keys_button *)(pdata + 1); in gpio_keys_get_devtree_pdata()
775 pdata->buttons = button; in gpio_keys_get_devtree_pdata()
786 button->irq = irq; in gpio_keys_get_devtree_pdata()
790 button->wakeirq = irq; in gpio_keys_get_devtree_pdata()
792 if (!button->irq && !button->wakeirq) in gpio_keys_get_devtree_pdata()
793 button->irq = in gpio_keys_get_devtree_pdata()
798 &button->code)) { in gpio_keys_get_devtree_pdata()
799 dev_err(dev, "Button without keycode\n"); in gpio_keys_get_devtree_pdata()
803 fwnode_property_read_string(child, "label", &button->desc); in gpio_keys_get_devtree_pdata()
806 &button->type)) in gpio_keys_get_devtree_pdata()
807 button->type = EV_KEY; in gpio_keys_get_devtree_pdata()
810 (u32 *)&button->value); in gpio_keys_get_devtree_pdata()
812 button->wakeup = in gpio_keys_get_devtree_pdata()
818 &button->wakeup_event_action); in gpio_keys_get_devtree_pdata()
820 button->can_disable = in gpio_keys_get_devtree_pdata()
824 &button->debounce_interval)) in gpio_keys_get_devtree_pdata()
825 button->debounce_interval = 5; in gpio_keys_get_devtree_pdata()
827 button++; in gpio_keys_get_devtree_pdata()
901 const struct gpio_keys_button *button = &pdata->buttons[i]; in gpio_keys_probe() local
914 button, i, child); in gpio_keys_probe()
920 if (button->wakeup) in gpio_keys_probe()
1009 if (bdata->button->wakeup) { in gpio_keys_enable_wakeup()
1022 if (bdata->button->wakeup) in gpio_keys_enable_wakeup()