Lines Matching refs:button
34 const struct gpio_keys_button *button;
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)
237 * @type: button type (%EV_KEY, %EV_SW)
266 if (bdata->button->type != type)
270 !bdata->button->can_disable) {
280 if (bdata->button->type != type)
362 const struct gpio_keys_button *button = bdata->button;
364 unsigned int type = button->type ?: EV_KEY;
378 input_event(input, type, button->code, button->value);
389 if (bdata->button->wakeup)
417 if (bdata->button->wakeup) {
418 const struct gpio_keys_button *button = bdata->button;
422 (button->type == 0 || button->type == EV_KEY)) {
428 input_report_key(bdata->input, button->code, 1);
473 if (bdata->button->wakeup)
499 const struct gpio_keys_button *button,
503 const char *desc = button->desc ? button->desc : "gpio_keys";
513 bdata->button = button;
531 } else if (gpio_is_valid(button->gpio)) {
536 error = devm_gpio_request_one(dev, button->gpio, GPIOF_IN, desc);
539 button->gpio, error);
543 bdata->gpiod = gpio_to_desc(button->gpio);
547 if (button->active_low ^ gpiod_is_active_low(bdata->gpiod))
554 if (button->debounce_interval) {
556 button->debounce_interval * 1000);
560 button->debounce_interval;
574 * interrupt may be used as the main button interrupt for
579 if (button->irq) {
580 bdata->irq = button->irq;
587 button->gpio);
601 switch (button->wakeup_event_action) {
619 if (!button->irq) {
620 dev_err(dev, "Found button without gpio or irq\n");
624 bdata->irq = button->irq;
626 if (button->type && button->type != EV_KEY) {
631 bdata->release_delay = button->debounce_interval;
645 *bdata->code = button->code;
646 input_set_capability(input, button->type ?: EV_KEY, *bdata->code);
660 * If platform has specified that the button can be disabled,
663 if (!button->can_disable)
674 if (!button->wakeirq)
682 bdata->wakeirq = button->wakeirq;
700 * IRQF_SHARED was set based on !button->can_disable.
758 struct gpio_keys_button *button;
766 sizeof(*pdata) + nbuttons * sizeof(*button),
771 button = (struct gpio_keys_button *)(pdata + 1);
773 pdata->buttons = button;
784 button->irq = irq;
788 button->wakeirq = irq;
790 if (!button->irq && !button->wakeirq)
791 button->irq =
796 &button->code)) {
801 fwnode_property_read_string(child, "label", &button->desc);
804 &button->type))
805 button->type = EV_KEY;
808 (u32 *)&button->value);
810 button->wakeup =
816 &button->wakeup_event_action);
818 button->can_disable =
822 &button->debounce_interval))
823 button->debounce_interval = 5;
825 button++;
899 const struct gpio_keys_button *button = &pdata->buttons[i];
912 button, i, child);
918 if (button->wakeup)
1007 if (bdata->button->wakeup) {
1020 if (bdata->button->wakeup)