Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174204
b: refs/heads/master
c: 4e89217
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Dec 5, 2009
1 parent ca4a1d3 commit 4aa59ee
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 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: fa3c39bd17449581eedaa1a0b7c8b67ec20c796e
refs/heads/master: 4e89217b943cfb26f88f04920d44f2077931f0e7
23 changes: 10 additions & 13 deletions trunk/drivers/media/common/ir-functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@ static int repeat = 1;
module_param(repeat, int, 0444);
MODULE_PARM_DESC(repeat,"auto-repeat for IR keys (default: on)");

static int debug; /* debug level (0,1,2) */
module_param(debug, int, 0644);

#define dprintk(level, fmt, arg...) if (debug >= level) \
printk(KERN_DEBUG fmt , ## arg)
int media_ir_debug; /* media_ir_debug level (0,1,2) */
module_param_named(debug, media_ir_debug, int, 0644);

/* -------------------------------------------------------------------------- */

Expand All @@ -49,7 +46,7 @@ static void ir_input_key_event(struct input_dev *dev, struct ir_input_state *ir)
dev->name,ir->ir_key,ir->ir_raw,ir->keypressed);
return;
}
dprintk(1,"%s: key event code=%d down=%d\n",
IR_dprintk(1,"%s: key event code=%d down=%d\n",
dev->name,ir->keycode,ir->keypressed);
input_report_key(dev,ir->keycode,ir->keypressed);
input_sync(dev);
Expand Down Expand Up @@ -295,11 +292,11 @@ u32 ir_rc5_decode(unsigned int code)
rc5 |= 1;
break;
case 3:
dprintk(1, "ir-common: ir_rc5_decode(%x) bad code\n", org_code);
IR_dprintk(1, "ir-common: ir_rc5_decode(%x) bad code\n", org_code);
return 0;
}
}
dprintk(1, "ir-common: code=%x, rc5=%x, start=%x, toggle=%x, address=%x, "
IR_dprintk(1, "ir-common: code=%x, rc5=%x, start=%x, toggle=%x, address=%x, "
"instr=%x\n", rc5, org_code, RC5_START(rc5),
RC5_TOGGLE(rc5), RC5_ADDR(rc5), RC5_INSTR(rc5));
return rc5;
Expand Down Expand Up @@ -331,20 +328,20 @@ void ir_rc5_timer_end(unsigned long data)

/* Allow some timer jitter (RC5 is ~24ms anyway so this is ok) */
if (gap < 28000) {
dprintk(1, "ir-common: spurious timer_end\n");
IR_dprintk(1, "ir-common: spurious timer_end\n");
return;
}

if (ir->last_bit < 20) {
/* ignore spurious codes (caused by light/other remotes) */
dprintk(1, "ir-common: short code: %x\n", ir->code);
IR_dprintk(1, "ir-common: short code: %x\n", ir->code);
} else {
ir->code = (ir->code << ir->shift_by) | 1;
rc5 = ir_rc5_decode(ir->code);

/* two start bits? */
if (RC5_START(rc5) != ir->start) {
dprintk(1, "ir-common: rc5 start bits invalid: %u\n", RC5_START(rc5));
IR_dprintk(1, "ir-common: rc5 start bits invalid: %u\n", RC5_START(rc5));

/* right address? */
} else if (RC5_ADDR(rc5) == ir->addr) {
Expand All @@ -354,7 +351,7 @@ void ir_rc5_timer_end(unsigned long data)
/* Good code, decide if repeat/repress */
if (toggle != RC5_TOGGLE(ir->last_rc5) ||
instr != RC5_INSTR(ir->last_rc5)) {
dprintk(1, "ir-common: instruction %x, toggle %x\n", instr,
IR_dprintk(1, "ir-common: instruction %x, toggle %x\n", instr,
toggle);
ir_input_nokey(ir->dev, &ir->ir);
ir_input_keydown(ir->dev, &ir->ir, instr,
Expand All @@ -377,7 +374,7 @@ void ir_rc5_timer_keyup(unsigned long data)
{
struct card_ir *ir = (struct card_ir *)data;

dprintk(1, "ir-common: key released\n");
IR_dprintk(1, "ir-common: key released\n");
ir_input_nokey(ir->dev, &ir->ir);
}
EXPORT_SYMBOL_GPL(ir_rc5_timer_keyup);
4 changes: 4 additions & 0 deletions trunk/include/media/ir-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#include <linux/workqueue.h>
#include <linux/interrupt.h>

extern int media_ir_debug; /* media_ir_debug level (0,1,2) */
#define IR_dprintk(level, fmt, arg...) if (media_ir_debug >= level) \
printk(KERN_DEBUG fmt , ## arg)

#define IR_TYPE_RC5 1
#define IR_TYPE_PD 2 /* Pulse distance encoded IR */
#define IR_TYPE_OTHER 99
Expand Down

0 comments on commit 4aa59ee

Please sign in to comment.