[PATCH 29/56] DVB (2390) Adds a time-delay to IR remote button presses for av7110 ir input,

[PATCH 29/56] DVB (2390) Adds a time-delay to IR remote button presses for av7110 ir input,

Post by Mauro Carv » Sat, 10 Dec 2005 23:40:24


From: Noone Important <nxhxzi702 at sneakemail.com>

- Adds a time-delay to IR remote button presses for av7110_ir input,
such that it acts more like a keyboard. A short press will be treated
as a single button press. Holding down a button on the remote will
respond like holding down a key on the keyboard, and result in a
key-repeat. This just introduces a delay between the 1st press, and
going into key-repeat so that it is possible to get a single 'up'.

Signed-off-by: Noone Important <nxhxzi702 at sneakemail.com>
Signed-off-by: Oliver Endriss < XXXX@XXXXX.COM >
Signed-off-by: Mauro Carvalho Chehab < XXXX@XXXXX.COM >

---

drivers/media/dvb/ttpci/av7110_ir.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)

--- git.orig/drivers/media/dvb/ttpci/av7110_ir.c
+++ git/drivers/media/dvb/ttpci/av7110_ir.c
@@ -17,6 +17,8 @@ static int av_cnt;
static struct av7110 *av_list[4];
static struct input_dev *input_dev;

+static u8 delay_timer_finished;
+
static u16 key_map [256] = {
KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7,
KEY_8, KEY_9, KEY_BACK, 0, KEY_POWER, KEY_MUTE, 0, KEY_INFO,
@@ -112,13 +114,16 @@ static void av7110_emit_key(unsigned lon
if (timer_pending(&keyup_timer)) {
del_timer(&keyup_timer);
if (keyup_timer.data != keycode || new_toggle != old_toggle) {
+ delay_timer_finished = 0;
input_event(input_dev, EV_KEY, keyup_timer.data, !!0);
input_event(input_dev, EV_KEY, keycode, !0);
} else
- input_event(input_dev, EV_KEY, keycode, 2);
-
- } else
+ if (delay_timer_finished)
+ input_event(input_dev, EV_KEY, keycode, 2);
+ } else {
+ delay_timer_finished = 0;
input_event(input_dev, EV_KEY, keycode, !0);
+ }

keyup_timer.expires = jiffies + UP_TIMEOUT;
keyup_timer.data = keycode;
@@ -145,7 +150,8 @@ static void input_register_keys(void)

static void input_repeat_key(unsigned long data)
{
- /* dummy routine to disable autorepeat in the input driver */
+ /* called by the input driver after rep[REP_DELAY] ms */
+ delay_timer_finished = 1;
}



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

1. [IR-RFC PATCH v4 2/6] Core IR module

2. [PATCH] drivers/media/IR/ir-keytable.c: fix binary search

The input-large-scancode patches changed the binary search in
drivers/media/IR/ir-keytable.c to use unsigned integers, but
signed integers are actually necessary for the algorithm to work.

Signed-off-by: David Hrdeman < XXXX@XXXXX.COM >
Cc: Dmitry Torokhov < XXXX@XXXXX.COM >
---
drivers/media/IR/ir-keytable.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c
index 9186b45..647d52b 100644
--- a/drivers/media/IR/ir-keytable.c
+++ b/drivers/media/IR/ir-keytable.c
@@ -325,9 +325,9 @@ static int ir_setkeytable(struct ir_input_dev *ir_dev,
static unsigned int ir_lookup_by_scancode(const struct ir_scancode_table *rc_tab,
unsigned int scancode)
{
- unsigned int start = 0;
- unsigned int end = rc_tab->len - 1;
- unsigned int mid;
+ int start = 0;
+ int end = rc_tab->len - 1;
+ int mid;

while (start <= end) {
mid = (start + end) / 2;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/

3. [PATCH 33/56] V4L/DVB (3081) added offset parameter for adjusting tuner offset by hand

4. [patch] v4l-08 add bttv IR input support.

5. [patch] v4l: add support for pv951 remote to ir-kbd-i2c

6. [PATCH 29/56] irda: Remove void casts

7. [OOPS] [PATCH] Avoid race when deregistering the IR control for dvb-usb

8. [DVB patch 31/48] ttusb_dec: IR support

9. [DVB patch 50/51] usb: vp7045 IR map fix

10. [patch-mm 5/6] V4L/DVB (3161): ir-kbd-gpio is now part of bttv

11. [PATCH 00/56] V4L/DVB Patch series for -mm kernel

12. [PATCH 6/9] DVB: AV7110 DVB driver updates

13. [PATCH 113/141] V4L/DVB (3385): Dvb: fix __init/__exit section references in av7110 driver

14. [DVB patch 51/54] ttpci: av7110: RC5+ remote control support

15. [DVB patch 29/37] DST: add support for Twinhan 200103A