From 0f7a0b08d26030ca0a44e3943e107d5ca1f361c4 Mon Sep 17 00:00:00 2001 From: Dima Zavin Date: Tue, 8 Nov 2011 13:03:11 -0800 Subject: [PATCH] input: gpio_input: don't print debounce message unless flag is set Change-Id: I29ccb32e795c5c3e4c51c3d3a209f5b55dfd7d94 Signed-off-by: Dima Zavin --- drivers/input/misc/gpio_input.c | 9 +++++---- include/linux/gpio_event.h | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/gpio_input.c b/drivers/input/misc/gpio_input.c index 904bd68..6a0c315 100644 --- a/drivers/input/misc/gpio_input.c +++ b/drivers/input/misc/gpio_input.c @@ -82,10 +82,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; diff --git a/include/linux/gpio_event.h b/include/linux/gpio_event.h index 360b4dd..2613fc5 100644 --- a/include/linux/gpio_event.h +++ b/include/linux/gpio_event.h @@ -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 { -- 2.7.4