INPUT: Give more precise auto repeat control for gpio_keys driver
Subsystems (2)
PATCH 1/1 INPUT: Give more precise auto repeat control for gpio_keys driver
Quoted 1 line
From
99fbdefb4d9e74e5641e892bb9fbe7cae1c1e39aMon Sep 17 00:00:00 2001
From: Alek Du <[email protected]>
Date: Fri, 8 May 2009 12:35:48 +0800
Subject: [PATCH] INPUT: Give more precise auto repeat control for gpio_keys driver
We have a situation that for same gpio key driver, some keys can't be auto repeatable while most of other keys are repeatable. By adding a disable repeat flag for each button, we could precisely control that.
--- drivers/input/keyboard/gpio_keys.c | 3 +++ include/linux/gpio_keys.h | 1 + 2 files changed, 4 insertions(+), 0 deletions(-)
drivers/input/keyboard/gpio_keys.c +3 -0
@@ -50,6 +50,9 @@ static void gpio_keys_report_event(struct work_struct *work)int state = (gpio_get_value (button->gpio) ?1 :0 ) ^ button->active_low;input_event (input, type, button->code, !!state); +/* if button disabled auto repeat */ +if (state &&test_bit (EV_REP , input->evbit) && button->norep) +input_event (input, type, button->code,0 );input_sync (input); }
include/linux/gpio_keys.h +1 -0
@@ -10,6 +10,7 @@ struct gpio_keys_button {int type;/* input event type (EV_KEY, EV_SW) */ int wakeup;/* configure the button as a wake-up source */ int debounce_interval;/* debounce ticks interval in msecs */ + unsigned int norep:1; /* more precise auto repeat control */ };struct gpio_keys_platform_data {
Signature · 1 line
1.6.0.4
PATCH RESEND 1/1 INPUT: Give more precise auto repeat control for gpio_keys driver
Quoted 1 line
From
99fbdefb4d9e74e5641e892bb9fbe7cae1c1e39aMon Sep 17 00:00:00 2001
From: Alek Du <[email protected]>
Date: Fri, 8 May 2009 12:35:48 +0800
Subject: [PATCH] INPUT: Give more precise auto repeat control for gpio_keys driver
gpio_keys_platform_data has a rep flag to control auto repeat feature. But
It is not enough, for example, there is a situation that most of buttons are repeatable, while some buttons like poweroff or mute can't be repeatable. By adding another repeat flag for gpio_keys_button, we could precisely control that.
--- drivers/input/keyboard/gpio_keys.c | 3 +++ include/linux/gpio_keys.h | 1 + 2 files changed, 4 insertions(+), 0 deletions(-)
drivers/input/keyboard/gpio_keys.c +3 -0
@@ -50,6 +50,9 @@ static void gpio_keys_report_event(struct work_struct *work)int state = (gpio_get_value (button->gpio) ?1 :0 ) ^ button->active_low;input_event (input, type, button->code, !!state); +/* if button disabled auto repeat */ +if (state &&test_bit (EV_REP , input->evbit) && button->norep) +input_event (input, type, button->code,0 );input_sync (input); }
include/linux/gpio_keys.h +1 -0
@@ -10,6 +10,7 @@ struct gpio_keys_button {int type;/* input event type (EV_KEY, EV_SW) */ int wakeup;/* configure the button as a wake-up source */ int debounce_interval;/* debounce ticks interval in msecs */ + unsigned int norep:1; /* more precise auto repeat control */ };struct gpio_keys_platform_data {
Signature · 5 lines
1.6.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html