From: Xinyu Chen Date: Wed, 15 Aug 2012 05:32:06 +0000 (+0800) Subject: ENGR00219856-1 mx6q sabresd: add debounce to gpio key X-Git-Tag: v3.0.35-fsl_4.1.0~764 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=76fb734a528a0b95326b92699aed4429690c2136;p=karo-tx-linux.git ENGR00219856-1 mx6q sabresd: add debounce to gpio key Add a 1ms debounce to the gpio key to avoid unexpected gpio status read from gpio_key driver's workqueue. This issue happens on android's resume stage, sometimes the framework get more than one up key even user press the power key once. Signed-off-by: Xinyu Chen --- diff --git a/arch/arm/mach-mx6/board-mx6q_sabresd.c b/arch/arm/mach-mx6/board-mx6q_sabresd.c index 480ef185c455..429cffc6806a 100644 --- a/arch/arm/mach-mx6/board-mx6q_sabresd.c +++ b/arch/arm/mach-mx6/board-mx6q_sabresd.c @@ -1535,7 +1535,7 @@ static void __init imx6q_add_device_gpio_leds(void) {} #endif #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) -#define GPIO_BUTTON(gpio_num, ev_code, act_low, descr, wake) \ +#define GPIO_BUTTON(gpio_num, ev_code, act_low, descr, wake, debounce) \ { \ .gpio = gpio_num, \ .type = EV_KEY, \ @@ -1543,12 +1543,13 @@ static void __init imx6q_add_device_gpio_leds(void) {} .active_low = act_low, \ .desc = "btn " descr, \ .wakeup = wake, \ + .debounce_interval = debounce, \ } static struct gpio_keys_button imx6q_buttons[] = { - GPIO_BUTTON(SABRESD_VOLUME_UP, KEY_VOLUMEUP, 1, "volume-up", 0), - GPIO_BUTTON(SABRESD_VOLUME_DN, KEY_VOLUMEDOWN, 1, "volume-down", 0), - GPIO_BUTTON(SABRESD_POWER_OFF, KEY_POWER, 1, "power", 1), + GPIO_BUTTON(SABRESD_VOLUME_UP, KEY_VOLUMEUP, 1, "volume-up", 0, 1), + GPIO_BUTTON(SABRESD_VOLUME_DN, KEY_VOLUMEDOWN, 1, "volume-down", 0, 1), + GPIO_BUTTON(SABRESD_POWER_OFF, KEY_POWER, 1, "power", 1, 1), }; static struct gpio_keys_platform_data imx6q_button_data = {