Commit 83ec5558 authored by Xinyu Chen's avatar Xinyu Chen

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: default avatarXinyu Chen <xinyu.chen@freescale.com>
parent d324cc15
......@@ -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 = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment