[media] bttv: merge ir decoding timers
Similarly to saa7134, bttv_ir has two timers, only one of which is used at a time and which serve the same purpose. Merge them. Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
edb4c25ca3
commit
3938e0cfeb
@@ -283,8 +283,7 @@ static int bttv_rc5_irq(struct bttv *btv)
|
|||||||
ir->base_time = tv;
|
ir->base_time = tv;
|
||||||
ir->last_bit = 0;
|
ir->last_bit = 0;
|
||||||
|
|
||||||
mod_timer(&ir->timer_end,
|
mod_timer(&ir->timer, current_jiffies + msecs_to_jiffies(30));
|
||||||
current_jiffies + msecs_to_jiffies(30));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* toggle GPIO pin 4 to reset the irq */
|
/* toggle GPIO pin 4 to reset the irq */
|
||||||
@@ -303,8 +302,7 @@ static void bttv_ir_start(struct bttv *btv, struct bttv_ir *ir)
|
|||||||
add_timer(&ir->timer);
|
add_timer(&ir->timer);
|
||||||
} else if (ir->rc5_gpio) {
|
} else if (ir->rc5_gpio) {
|
||||||
/* set timer_end for code completion */
|
/* set timer_end for code completion */
|
||||||
setup_timer(&ir->timer_end, bttv_rc5_timer_end,
|
setup_timer(&ir->timer, bttv_rc5_timer_end, (unsigned long)ir);
|
||||||
(unsigned long)ir);
|
|
||||||
ir->shift_by = 1;
|
ir->shift_by = 1;
|
||||||
ir->start = 3;
|
ir->start = 3;
|
||||||
ir->addr = 0x0;
|
ir->addr = 0x0;
|
||||||
@@ -322,7 +320,7 @@ static void bttv_ir_stop(struct bttv *btv)
|
|||||||
if (btv->remote->rc5_gpio) {
|
if (btv->remote->rc5_gpio) {
|
||||||
u32 gpio;
|
u32 gpio;
|
||||||
|
|
||||||
del_timer_sync(&btv->remote->timer_end);
|
del_timer_sync(&btv->remote->timer);
|
||||||
flush_scheduled_work();
|
flush_scheduled_work();
|
||||||
|
|
||||||
gpio = bttv_gpio_read(&btv->c);
|
gpio = bttv_gpio_read(&btv->c);
|
||||||
|
@@ -122,6 +122,7 @@ struct bttv_format {
|
|||||||
|
|
||||||
struct bttv_ir {
|
struct bttv_ir {
|
||||||
struct rc_dev *dev;
|
struct rc_dev *dev;
|
||||||
|
struct timer_list timer;
|
||||||
|
|
||||||
char name[32];
|
char name[32];
|
||||||
char phys[32];
|
char phys[32];
|
||||||
@@ -136,11 +137,9 @@ struct bttv_ir {
|
|||||||
int start; // What should RC5_START() be
|
int start; // What should RC5_START() be
|
||||||
int addr; // What RC5_ADDR() should be.
|
int addr; // What RC5_ADDR() should be.
|
||||||
int rc5_remote_gap;
|
int rc5_remote_gap;
|
||||||
struct timer_list timer;
|
|
||||||
|
|
||||||
/* RC5 gpio */
|
/* RC5 gpio */
|
||||||
u32 rc5_gpio;
|
u32 rc5_gpio;
|
||||||
struct timer_list timer_end; /* timer_end for code completion */
|
|
||||||
u32 last_bit; /* last raw bit seen */
|
u32 last_bit; /* last raw bit seen */
|
||||||
u32 code; /* raw code under construction */
|
u32 code; /* raw code under construction */
|
||||||
struct timeval base_time; /* time of last seen code */
|
struct timeval base_time; /* time of last seen code */
|
||||||
|
Reference in New Issue
Block a user