aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx/bttv-input.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2007-01-02 01:29:48 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-02-21 10:34:18 -0500
commitc19049568117848a209185a61d18971e3a856bd8 (patch)
treeffdb6f8e6fa30c70f717785f25001c734bfc0e1d /drivers/media/video/bt8xx/bttv-input.c
parentcededbfcbc31230c1717a7ed27ff6cf82734e568 (diff)
V4L/DVB (5025): Cleanup: switch to using msecs_to_jiffies() on bttv
PS.: Part of the changes at the original patch were removed due to the changes done at commit 52c14e794f6ce345343a6b8fc98ea4e0ba2dfce4 Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/bt8xx/bttv-input.c')
-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) {