Skip to content

Commit

Permalink
input: gpio_input: don't print debounce message unless flag is set
Browse files Browse the repository at this point in the history
Change-Id: I29ccb32e795c5c3e4c51c3d3a209f5b55dfd7d94
Signed-off-by: Dima Zavin <dima@android.com>
  • Loading branch information
Dima Zavin authored and renaudallard committed Nov 16, 2011
1 parent 6af5a02 commit 607ff42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/input/misc/gpio_input.c
Expand Up @@ -80,10 +80,11 @@ static enum hrtimer_restart gpio_event_input_timer_func(struct hrtimer *timer)
if (key_state->debounce & DEBOUNCE_UNSTABLE) {
debounce = key_state->debounce = DEBOUNCE_UNKNOWN;
enable_irq(gpio_to_irq(key_entry->gpio));
pr_info("gpio_keys_scan_keys: key %x-%x, %d "
"(%d) continue debounce\n",
ds->info->type, key_entry->code,
i, key_entry->gpio);
if (gpio_flags & GPIOEDF_PRINT_KEY_UNSTABLE)
pr_info("gpio_keys_scan_keys: key %x-%x, %d "
"(%d) continue debounce\n",
ds->info->type, key_entry->code,
i, key_entry->gpio);
}
npolarity = !(gpio_flags & GPIOEDF_ACTIVE_HIGH);
pressed = gpio_get_value(key_entry->gpio) ^ npolarity;
Expand Down
1 change: 1 addition & 0 deletions include/linux/gpio_event.h
Expand Up @@ -98,6 +98,7 @@ enum gpio_event_direct_flags {
/* GPIOEDF_USE_IRQ = (1U << 2) | GPIOIDF_USE_DOWN_IRQ, */
GPIOEDF_PRINT_KEYS = 1U << 8,
GPIOEDF_PRINT_KEY_DEBOUNCE = 1U << 9,
GPIOEDF_PRINT_KEY_UNSTABLE = 1U << 10,
};

struct gpio_event_direct_entry {
Expand Down

0 comments on commit 607ff42

Please sign in to comment.