Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113977
b: refs/heads/master
c: 34c0802
h: refs/heads/master
i:
  113975: 2138c95
v: v3
  • Loading branch information
Darron Broad authored and Mauro Carvalho Chehab committed Oct 12, 2008
1 parent 2b56db2 commit 4064eec
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 681faa0b7a1d67576df07e0ad55ca42b2eab174a
refs/heads/master: 34c080295af9b3ed9f704a881e07eb5ac128e1ed
30 changes: 28 additions & 2 deletions trunk/drivers/media/video/cx88/cx88-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,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;
Expand Down Expand Up @@ -463,9 +463,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)
Expand Down
22 changes: 20 additions & 2 deletions trunk/drivers/media/video/ir-kbd-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static int get_key_haup_common(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw,
int size, int offset)
{
unsigned char buf[6];
int start, range, toggle, dev, code;
int start, range, toggle, dev, code, ircode;

/* poll IR chip */
if (size != i2c_master_recv(&ir->c,buf,size))
Expand All @@ -85,6 +85,24 @@ static int get_key_haup_common(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw,
if (!start)
/* no key pressed */
return 0;
/*
* 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 causing
* mis-fired events.
*
* We also filter out invalid key presses which
* produce annoying debug log entries.
*/
ircode= (start << 12) | (toggle << 11) | (dev << 6) | code;
if ((ircode & 0x1fff)==0x1fff)
/* invalid key press */
return 0;

if (dev!=0x1e && dev!=0x1f)
/* not a hauppauge remote */
return 0;

if (!range)
code += 64;
Expand All @@ -94,7 +112,7 @@ static int get_key_haup_common(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw,

/* return key */
*ir_key = code;
*ir_raw = (start << 12) | (toggle << 11) | (dev << 6) | code;
*ir_raw = ircode;
return 1;
}

Expand Down

0 comments on commit 4064eec

Please sign in to comment.