summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb
diff options
context:
space:
mode:
authorOliver Endriss <devnull@localhost>2003-03-30 21:32:27 +0000
committerOliver Endriss <devnull@localhost>2003-03-30 21:32:27 +0000
commitb83c6ef78d690fffe6f4293614d27dfc416bd2e1 (patch)
tree231119b77624dd73cf2d1493fb6b75023b277404 /linux/drivers/media/dvb
parent6d3197dd77c4f3b8e6477e9f0db4c65d66b41d4c (diff)
downloadmediapointer-dvb-s2-b83c6ef78d690fffe6f4293614d27dfc416bd2e1.tar.gz
mediapointer-dvb-s2-b83c6ef78d690fffe6f4293614d27dfc416bd2e1.tar.bz2
check device address of remote control transmitter (optional)
enable autorepeat in the input driver
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_ir.c36
1 files changed, 27 insertions, 9 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110_ir.c b/linux/drivers/media/dvb/ttpci/av7110_ir.c
index f95760afc..2444b724b 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_ir.c
+++ b/linux/drivers/media/dvb/ttpci/av7110_ir.c
@@ -12,7 +12,7 @@
#endif
-#define UP_TIMEOUT (HZ/2)
+#define UP_TIMEOUT (HZ/7)
static int av7110_ir_debug = 0;
@@ -21,6 +21,7 @@ static int av7110_ir_debug = 0;
static struct input_dev input_dev;
+static u32 ir_config;
static
u16 key_map [256] = {
@@ -64,14 +65,34 @@ struct timer_list keyup_timer = { function: av7110_emit_keyup };
static
void av7110_emit_key (u32 ircom)
{
- u16 keycode = key_map[ircom & 0xff];
+ u8 data;
+ u8 addr;
+ u16 keycode;
+
+ /* extract device address and data */
+ if (ir_config & 0x0001) {
+ /* TODO RCMM: ? bits device address, 8 bits data */
+ data = ircom & 0xff;
+ addr = (ircom >> 8) & 0xff;
+ } else {
+ /* RC5: 5 bits device address, 6 bits data */
+ data = ircom & 0x3f;
+ addr = (ircom >> 6) & 0x1f;
+ }
+
+ keycode = key_map[data];
+
+ dprintk ("#########%08x######### addr %i data 0x%02x (keycode %i)\n",
+ ircom, addr, data, keycode);
- dprintk ("#########%08x######### key %02x (keycode %i)\n",
- ircom, ircom, keycode);
+ /* check device address (if selected) */
+ if (ir_config & 0x4000)
+ if (addr != ((ir_config >> 16) & 0xff))
+ return;
if (!keycode) {
printk ("%s: unknown key 0x%02x!!\n",
- __FUNCTION__, ircom & 0xff);
+ __FUNCTION__, data);
return;
}
@@ -81,8 +102,6 @@ void av7110_emit_key (u32 ircom)
input_event (&input_dev, EV_KEY, keyup_timer.data, !!0);
}
- clear_bit (keycode, input_dev.key);
-
input_event (&input_dev, EV_KEY, keycode, !0);
keyup_timer.expires = jiffies + UP_TIMEOUT;
@@ -111,8 +130,6 @@ static
int av7110_ir_write_proc (struct file *file, const char *buffer,
unsigned long count, void *data)
{
- u32 ir_config;
-
if (count < 4 + 256 * sizeof(u16))
return -EINVAL;
@@ -140,6 +157,7 @@ int __init av7110_ir_init (void)
* enable keys
*/
set_bit (EV_KEY, input_dev.evbit);
+ set_bit (EV_REP, input_dev.evbit);
input_register_keys ();