Skip to content
Snippets Groups Projects
Commit 6c5bfaac authored by Petr Štetiar's avatar Petr Štetiar
Browse files

gpio-button-hotplug: gpio-keys: fix always missing first event


Commit afc056d7 ("gpio-button-hotplug: support interrupt
properties") changed the gpio-keys interrupt handling logic in a way,
that it always misses first event, which causes issues with rc.button
scripts, so this patch restores the previous behaviour.

Fixes: afc056d7 ("gpio-button-hotplug: support interrupt properties")
Reported-by: default avatarKristian Evensen <kristian.evensen@gmail.com>
Tested-by: default avatarKuan-Yi Li <kyli.tw@gmail.com>
Signed-off-by: default avatarPetr Štetiar <ynezz@true.cz>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [drop state check]
parent 27d234a3
No related branches found
No related tags found
No related merge requests found
......@@ -340,16 +340,9 @@ static void gpio_keys_irq_work_func(struct work_struct *work)
{
struct gpio_keys_button_data *bdata = container_of(work,
struct gpio_keys_button_data, work.work);
int state = gpio_button_get_value(bdata);
if (state != bdata->last_state) {
unsigned int type = bdata->b->type ?: EV_KEY;
if (bdata->last_state != -1 || type == EV_SW)
button_hotplug_event(bdata, type, state);
bdata->last_state = state;
}
button_hotplug_event(bdata, bdata->b->type ?: EV_KEY,
gpio_button_get_value(bdata));
}
static irqreturn_t button_handle_irq(int irq, void *_bdata)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment