Skip to contentSkip to conversation

INPUT: Give more precise auto repeat control for gpio_keys driver

PATCH Superseded Alek Du 1 participant 2 messages Jun 11, 2009 – Jun 24, 2009

Subsystems (2)
lore
Share & tools
lore

Alek Du

author
#0 lore raw

PATCH 1/1 INPUT: Give more precise auto repeat control for gpio_keys driver

Quoted 1 line

From 99fbdefb4d9e74e5641e892bb9fbe7cae1c1e39a Mon 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
index 5e9fb79..bfde124 100644
@@ -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
index 1289fa7..ffda87c 100644
@@ -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
author
#1 lore raw

PATCH RESEND 1/1 INPUT: Give more precise auto repeat control for gpio_keys driver

Quoted 1 line

From 99fbdefb4d9e74e5641e892bb9fbe7cae1c1e39a Mon 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
index 5e9fb79..bfde124 100644
@@ -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
index 1289fa7..ffda87c 100644
@@ -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