Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44098
b: refs/heads/master
c: 59236d4
h: refs/heads/master
v: v3
  • Loading branch information
David Hardeman authored and Mauro Carvalho Chehab committed Dec 10, 2006
1 parent 9ef2328 commit 01c4409
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 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: b5471a27b48801507c5bd0eadd83730230515016
refs/heads/master: 59236d46dab429646b023026ac92d9e8c732c18a
37 changes: 20 additions & 17 deletions trunk/drivers/media/dvb/ttpci/budget-ci.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,27 +159,32 @@ static void msp430_ir_interrupt(unsigned long data)
if (budget_ci->ir.rc5_device != IR_DEVICE_ANY && budget_ci->ir.rc5_device != device)
return;

/* Are we still waiting for a keyup event while this is a new key? */
if ((ir_key != dev->repeat_key || toggle != prev_toggle) && del_timer(&dev->timer))
ir_input_nokey(dev, &budget_ci->ir.state);

prev_toggle = toggle;

/* Ignore repeated key sequences if requested */
if (ir_key == dev->repeat_key && bounces > 0 && timer_pending(&dev->timer)) {
if (toggle == prev_toggle && ir_key == dev->repeat_key &&
bounces > 0 && timer_pending(&dev->timer)) {
if (ir_debug)
printk("budget_ci: debounce logic ignored IR command\n");
bounces--;
return;
}
prev_toggle = toggle;

/* New keypress? */
if (!timer_pending(&dev->timer))
bounces = debounce;
/* Are we still waiting for a keyup event? */
if (del_timer(&dev->timer))
ir_input_nokey(dev, &budget_ci->ir.state);

/* Prepare a keyup event sometime in the future */
mod_timer(&dev->timer, jiffies + msecs_to_jiffies(IR_REPEAT_TIMEOUT));
/* Generate keypress */
if (ir_debug)
printk("budget_ci: generating keypress 0x%02x\n", ir_key);
ir_input_keydown(dev, &budget_ci->ir.state, ir_key, (ir_key & (command << 8)));

/* Generate a new or repeated keypress */
ir_input_keydown(dev, &budget_ci->ir.state, ir_key, ((device << 8) | command));
/* Do we want to delay the keyup event? */
if (debounce) {
bounces = debounce;
mod_timer(&dev->timer, jiffies + msecs_to_jiffies(IR_REPEAT_TIMEOUT));
} else {
ir_input_nokey(dev, &budget_ci->ir.state);
}
}

static void msp430_ir_debounce(unsigned long data)
Expand Down Expand Up @@ -297,11 +302,9 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
break;
}

/* initialise the key-up timeout handler */
/* initialise the key-up debounce timeout handler */
input_dev->timer.function = msp430_ir_keyup;
input_dev->timer.data = (unsigned long) &budget_ci->ir;
input_dev->rep[REP_DELAY] = 1;
input_dev->rep[REP_PERIOD] = 1;

error = input_register_device(input_dev);
if (error) {
Expand Down

0 comments on commit 01c4409

Please sign in to comment.