summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorXinyu Chen <xinyu.chen@freescale.com>2012-08-15 13:32:06 +0800
committerXinyu Chen <xinyu.chen@freescale.com>2012-08-15 14:37:56 +0800
commitd43f4bd6adb597afc069fd69cf5d785f8dae5e36 (patch)
treec65ca06a043b24fabb04f915880e588ddb835376 /arch
parentaa1803d2a8ba09bab77d0f9231c69cc8ef112392 (diff)
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 <xinyu.chen@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-mx6/board-mx6q_sabresd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/arm/mach-mx6/board-mx6q_sabresd.c b/arch/arm/mach-mx6/board-mx6q_sabresd.c
index f9b72c777cf5..d2b35f44179a 100644
--- a/arch/arm/mach-mx6/board-mx6q_sabresd.c
+++ b/arch/arm/mach-mx6/board-mx6q_sabresd.c
@@ -1545,7 +1545,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, \
@@ -1553,11 +1553,12 @@ 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_POWER, 1, "volume-down", 1),
+ GPIO_BUTTON(SABRESD_VOLUME_UP, KEY_VOLUMEUP, 1, "volume-up", 0, 1),
+ GPIO_BUTTON(SABRESD_VOLUME_DN, KEY_POWER, 1, "volume-down", 1, 1),
};
static struct gpio_keys_platform_data imx6q_button_data = {