aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/bt8xx/bttv-input.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/media/video/bt8xx/bttv-input.c b/drivers/media/video/bt8xx/bttv-input.c
index 825161b9cb3f..6f74c8042bc3 100644
--- a/drivers/media/video/bt8xx/bttv-input.c
+++ b/drivers/media/video/bt8xx/bttv-input.c
@@ -87,11 +87,9 @@ static void bttv_input_timer(unsigned long data)
87{ 87{
88 struct bttv *btv = (struct bttv*)data; 88 struct bttv *btv = (struct bttv*)data;
89 struct card_ir *ir = btv->remote; 89 struct card_ir *ir = btv->remote;
90 unsigned long timeout;
91 90
92 ir_handle_key(btv); 91 ir_handle_key(btv);
93 timeout = jiffies + (ir->polling * HZ / 1000); 92 mod_timer(&ir->timer, jiffies + msecs_to_jiffies(ir->polling));
94 mod_timer(&ir->timer, timeout);
95} 93}
96 94
97/* ---------------------------------------------------------------*/ 95/* ---------------------------------------------------------------*/
@@ -102,7 +100,7 @@ static int bttv_rc5_irq(struct bttv *btv)
102 struct timeval tv; 100 struct timeval tv;
103 u32 gpio; 101 u32 gpio;
104 u32 gap; 102 u32 gap;
105 unsigned long current_jiffies, timeout; 103 unsigned long current_jiffies;
106 104
107 /* read gpio port */ 105 /* read gpio port */
108 gpio = bttv_gpio_read(&btv->c); 106 gpio = bttv_gpio_read(&btv->c);
@@ -139,8 +137,8 @@ static int bttv_rc5_irq(struct bttv *btv)
139 ir->base_time = tv; 137 ir->base_time = tv;
140 ir->last_bit = 0; 138 ir->last_bit = 0;
141 139
142 timeout = current_jiffies + (500 + 30 * HZ) / 1000; 140 mod_timer(&ir->timer_end,
143 mod_timer(&ir->timer_end, timeout); 141 current_jiffies + msecs_to_jiffies(30));
144 } 142 }
145 143
146 /* toggle GPIO pin 4 to reset the irq */ 144 /* toggle GPIO pin 4 to reset the irq */
@@ -154,9 +152,7 @@ static int bttv_rc5_irq(struct bttv *btv)
154static void bttv_ir_start(struct bttv *btv, struct card_ir *ir) 152static void bttv_ir_start(struct bttv *btv, struct card_ir *ir)
155{ 153{
156 if (ir->polling) { 154 if (ir->polling) {
157 init_timer(&ir->timer); 155 setup_timer(&ir->timer, bttv_input_timer, (unsigned long)btv);
158 ir->timer.function = bttv_input_timer;
159 ir->timer.data = (unsigned long)btv;
160 ir->timer.expires = jiffies + HZ; 156 ir->timer.expires = jiffies + HZ;
161 add_timer(&ir->timer); 157 add_timer(&ir->timer);
162 } else if (ir->rc5_gpio) { 158 } else if (ir->rc5_gpio) {