Lines Matching refs:button
34 const struct gpio_keys_button *button;
100 * @type: type of button (%EV_KEY, %EV_SW)
115 * @type: type of button (%EV_KEY, %EV_SW)
141 * gpio_keys_disable_button() - disables given GPIO button
142 * @bdata: button data for button to be disabled
144 * Disables button pointed by @bdata. This is done by masking
145 * IRQ line. After this function is called, button won't generate
166 * gpio_keys_enable_button() - enables given GPIO button
167 * @bdata: button data for button to be disabled
169 * Enables given button pointed by @bdata.
173 * to enable the same button at the same time.
187 * @type: button type (%EV_KEY, %EV_SW)
213 if (bdata->button->type != type)
235 * @type: button type (%EV_KEY, %EV_SW)
267 if (bdata->button->type != type)
271 !bdata->button->can_disable) {
282 if (bdata->button->type != type)
368 const struct gpio_keys_button *button = bdata->button;
370 unsigned int type = button->type ?: EV_KEY;
384 input_event(input, type, button->code, button->value);
395 if (bdata->button->wakeup)
423 if (bdata->button->wakeup) {
424 const struct gpio_keys_button *button = bdata->button;
428 (button->type == 0 || button->type == EV_KEY)) {
434 input_report_key(bdata->input, button->code, 1);
478 if (bdata->button->wakeup)
505 const struct gpio_keys_button *button,
509 const char *desc = button->desc ? button->desc : "gpio_keys";
518 bdata->button = button;
536 } else if (gpio_is_valid(button->gpio)) {
543 if (button->active_low)
546 error = devm_gpio_request_one(dev, button->gpio, flags, desc);
549 button->gpio, error);
553 bdata->gpiod = gpio_to_desc(button->gpio);
561 if (button->debounce_interval) {
563 button->debounce_interval * 1000);
567 button->debounce_interval;
578 if (button->irq) {
579 bdata->irq = button->irq;
586 button->gpio, error);
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;
646 *bdata->code = button->code;
647 input_set_capability(input, button->type ?: EV_KEY, *bdata->code);
661 * If platform has specified that the button can be disabled,
664 if (!button->can_disable)
729 struct gpio_keys_button *button;
738 sizeof(*pdata) + nbuttons * sizeof(*button),
743 button = (struct gpio_keys_button *)(pdata + 1);
745 pdata->buttons = button;
754 button->irq =
758 &button->code)) {
764 fwnode_property_read_string(child, "label", &button->desc);
767 &button->type))
768 button->type = EV_KEY;
771 (u32 *)&button->value);
773 button->wakeup =
779 &button->wakeup_event_action);
781 button->can_disable =
785 &button->debounce_interval))
786 button->debounce_interval = 5;
788 button++;
862 const struct gpio_keys_button *button = &pdata->buttons[i];
875 button, i, child);
881 if (button->wakeup)
960 if (bdata->button->wakeup) {
973 if (bdata->button->wakeup)