From 9ce76a347a36dac482c79fc76a26dc7bbac22e4f Mon Sep 17 00:00:00 2001 From: Steven Toth Date: Thu, 4 Sep 2008 00:17:33 -0400 Subject: cx88: Add support for the Hauppauge HVR4000 and HVR4000-LITE (S2) boards From: Steven Toth Adding support for Hauppauge's cx88 S2 based products, based on the cx24116 DVB-S2 demodulator. Priority: normal Signed-off-by: Steven Toth --- linux/drivers/media/video/cx88/cx88-input.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'linux/drivers/media/video/cx88/cx88-input.c') diff --git a/linux/drivers/media/video/cx88/cx88-input.c b/linux/drivers/media/video/cx88/cx88-input.c index 7d174382e..b1e31adb1 100644 --- a/linux/drivers/media/video/cx88/cx88-input.c +++ b/linux/drivers/media/video/cx88/cx88-input.c @@ -237,6 +237,8 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: case CX88_BOARD_HAUPPAUGE_HVR1100: case CX88_BOARD_HAUPPAUGE_HVR3000: + case CX88_BOARD_HAUPPAUGE_HVR4000: + case CX88_BOARD_HAUPPAUGE_HVR4000LITE: ir_codes = ir_codes_hauppauge_new; ir_type = IR_TYPE_RC5; ir->sampling = 1; @@ -479,6 +481,8 @@ void cx88_ir_irq(struct cx88_core *core) case CX88_BOARD_HAUPPAUGE_HVR1100: case CX88_BOARD_HAUPPAUGE_HVR3000: case CX88_BOARD_PINNACLE_PCTV_HD_800i: + case CX88_BOARD_HAUPPAUGE_HVR4000: + case CX88_BOARD_HAUPPAUGE_HVR4000LITE: ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7); ir_dprintk("biphase decoded: %x\n", ircode); if ((ircode & 0xfffff000) != 0x3000) -- cgit v1.2.3 From b1122ac876ec86fd21396d56d215e63543398c2d Mon Sep 17 00:00:00 2001 From: Steven Toth Date: Sun, 21 Sep 2008 23:54:59 -0400 Subject: HVR3000/4000 Hauppauge related IR cleanups From: Darron Broad From the author: This patch-set fixes remote control issues I have experienced with hauppauge drivers in Linux since the PVR-350 and now with both a NOVA-S+ and HVR-4000. It has also been confirmed to work with an HVR-1300 user who had exactly the same issue. Hauppage remote controls use RC5. RC5 has a bit-field which represents the target device. The hauppauge windows drivers have a registry key which can enable filtering, but the linux drivers will accept any target device in this bit field for internal processing. This causes problems with setups such as mythtv where remote control key presses destined for the TV (target = 0) are interpreted by the kernel and subsequenctly LIRC then mythtv. Of the remote controls I have to hand (wintv black, pvr/hvr silver) the hauppauge remotes send one of two device targets ids, these are interpreted by the patch which then filters out any non hauppauge addresses. Priority: normal Signed-off-by: Steven Toth Signed-off-by: Darron Broad --- linux/drivers/media/video/cx88/cx88-input.c | 30 +++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'linux/drivers/media/video/cx88/cx88-input.c') diff --git a/linux/drivers/media/video/cx88/cx88-input.c b/linux/drivers/media/video/cx88/cx88-input.c index b1e31adb1..3cdc473de 100644 --- a/linux/drivers/media/video/cx88/cx88-input.c +++ b/linux/drivers/media/video/cx88/cx88-input.c @@ -411,7 +411,7 @@ void cx88_ir_irq(struct cx88_core *core) { struct cx88_IR *ir = core->ir; u32 samples, ircode; - int i; + int i, start, range, toggle, dev, code; if (NULL == ir) return; @@ -480,9 +480,35 @@ void cx88_ir_irq(struct cx88_core *core) case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: case CX88_BOARD_HAUPPAUGE_HVR1100: case CX88_BOARD_HAUPPAUGE_HVR3000: - case CX88_BOARD_PINNACLE_PCTV_HD_800i: case CX88_BOARD_HAUPPAUGE_HVR4000: case CX88_BOARD_HAUPPAUGE_HVR4000LITE: + ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7); + ir_dprintk("biphase decoded: %x\n", ircode); + /* + * RC5 has an extension bit which adds a new range + * of available codes, this is detected here. Also + * hauppauge remotes (black/silver) always use + * specific device ids. If we do not filter the + * device ids then messages destined for devices + * such as TVs (id=0) will get through to the + * device causing mis-fired events. + */ + /* split rc5 data block ... */ + start = (ircode & 0x2000) >> 13; + range = (ircode & 0x1000) >> 12; + toggle= (ircode & 0x0800) >> 11; + dev = (ircode & 0x07c0) >> 6; + code = (ircode & 0x003f) | ((range << 6) ^ 0x0040); + if( start != 1) + /* no key pressed */ + break; + if ( dev != 0x1e && dev != 0x1f ) + /* not a hauppauge remote */ + break; + ir_input_keydown(ir->input, &ir->ir, code, ircode); + ir->release = jiffies + msecs_to_jiffies(120); + break; + case CX88_BOARD_PINNACLE_PCTV_HD_800i: ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7); ir_dprintk("biphase decoded: %x\n", ircode); if ((ircode & 0xfffff000) != 0x3000) -- cgit v1.2.3