]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00219856-1 mx6q sabresd: add debounce to gpio key
authorXinyu Chen <xinyu.chen@freescale.com>
Wed, 15 Aug 2012 05:32:06 +0000 (13:32 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:12:42 +0000 (14:12 +0200)
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 <xinyu.chen@freescale.com>
arch/arm/mach-mx6/board-mx6q_sabresd.c

index 480ef185c455a4bbfa5766d56ef0c0c583e34453..429cffc6806a568d4d7f9eb1651dc4571c7a3f3d 100644 (file)
@@ -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 = {