diff options
author | David Härdeman <david@hardeman.nu> | 2010-11-19 18:43:17 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-12-29 05:16:54 -0500 |
commit | 3938e0cfeb812e7b66f4e1cb6e34eb2e6864c6a2 (patch) | |
tree | 893f95970f5892889f29f21b2cc2d553fa659c96 /drivers | |
parent | edb4c25ca3a7997660500692eca3510eac9726e5 (diff) |
[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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/bt8xx/bttv-input.c | 8 | ||||
-rw-r--r-- | drivers/media/video/bt8xx/bttvp.h | 3 |
2 files changed, 4 insertions, 7 deletions
diff --git a/drivers/media/video/bt8xx/bttv-input.c b/drivers/media/video/bt8xx/bttv-input.c index c344b626e11..989c0481e3b 100644 --- a/drivers/media/video/bt8xx/bttv-input.c +++ b/drivers/media/video/bt8xx/bttv-input.c | |||
@@ -283,8 +283,7 @@ static int bttv_rc5_irq(struct bttv *btv) | |||
283 | ir->base_time = tv; | 283 | ir->base_time = tv; |
284 | ir->last_bit = 0; | 284 | ir->last_bit = 0; |
285 | 285 | ||
286 | mod_timer(&ir->timer_end, | 286 | mod_timer(&ir->timer, current_jiffies + msecs_to_jiffies(30)); |
287 | current_jiffies + msecs_to_jiffies(30)); | ||
288 | } | 287 | } |
289 | 288 | ||
290 | /* toggle GPIO pin 4 to reset the irq */ | 289 | /* toggle GPIO pin 4 to reset the irq */ |
@@ -303,8 +302,7 @@ static void bttv_ir_start(struct bttv *btv, struct bttv_ir *ir) | |||
303 | add_timer(&ir->timer); | 302 | add_timer(&ir->timer); |
304 | } else if (ir->rc5_gpio) { | 303 | } else if (ir->rc5_gpio) { |
305 | /* set timer_end for code completion */ | 304 | /* set timer_end for code completion */ |
306 | setup_timer(&ir->timer_end, bttv_rc5_timer_end, | 305 | setup_timer(&ir->timer, bttv_rc5_timer_end, (unsigned long)ir); |
307 | (unsigned long)ir); | ||
308 | ir->shift_by = 1; | 306 | ir->shift_by = 1; |
309 | ir->start = 3; | 307 | ir->start = 3; |
310 | ir->addr = 0x0; | 308 | ir->addr = 0x0; |
@@ -322,7 +320,7 @@ static void bttv_ir_stop(struct bttv *btv) | |||
322 | if (btv->remote->rc5_gpio) { | 320 | if (btv->remote->rc5_gpio) { |
323 | u32 gpio; | 321 | u32 gpio; |
324 | 322 | ||
325 | del_timer_sync(&btv->remote->timer_end); | 323 | del_timer_sync(&btv->remote->timer); |
326 | flush_scheduled_work(); | 324 | flush_scheduled_work(); |
327 | 325 | ||
328 | gpio = bttv_gpio_read(&btv->c); | 326 | gpio = bttv_gpio_read(&btv->c); |
diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h index 3d5b2bc1d37..07123204560 100644 --- a/drivers/media/video/bt8xx/bttvp.h +++ b/drivers/media/video/bt8xx/bttvp.h | |||
@@ -122,6 +122,7 @@ struct bttv_format { | |||
122 | 122 | ||
123 | struct bttv_ir { | 123 | struct bttv_ir { |
124 | struct rc_dev *dev; | 124 | struct rc_dev *dev; |
125 | struct timer_list timer; | ||
125 | 126 | ||
126 | char name[32]; | 127 | char name[32]; |
127 | char phys[32]; | 128 | char phys[32]; |
@@ -136,11 +137,9 @@ struct bttv_ir { | |||
136 | int start; // What should RC5_START() be | 137 | int start; // What should RC5_START() be |
137 | int addr; // What RC5_ADDR() should be. | 138 | int addr; // What RC5_ADDR() should be. |
138 | int rc5_remote_gap; | 139 | int rc5_remote_gap; |
139 | struct timer_list timer; | ||
140 | 140 | ||
141 | /* RC5 gpio */ | 141 | /* RC5 gpio */ |
142 | u32 rc5_gpio; | 142 | u32 rc5_gpio; |
143 | struct timer_list timer_end; /* timer_end for code completion */ | ||
144 | u32 last_bit; /* last raw bit seen */ | 143 | u32 last_bit; /* last raw bit seen */ |
145 | u32 code; /* raw code under construction */ | 144 | u32 code; /* raw code under construction */ |
146 | struct timeval base_time; /* time of last seen code */ | 145 | struct timeval base_time; /* time of last seen code */ |