diff options
-rw-r--r-- | drivers/media/video/bt8xx/bttv-driver.c | 6 | ||||
-rw-r--r-- | drivers/media/video/bt8xx/bttv-input.c | 20 | ||||
-rw-r--r-- | drivers/media/video/bt8xx/bttvp.h | 4 |
3 files changed, 14 insertions, 16 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index 0902ec041c7a..54fbab95b88c 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c | |||
@@ -4041,9 +4041,6 @@ static irqreturn_t bttv_irq(int irq, void *dev_id) | |||
4041 | 4041 | ||
4042 | btv=(struct bttv *)dev_id; | 4042 | btv=(struct bttv *)dev_id; |
4043 | 4043 | ||
4044 | if (btv->custom_irq) | ||
4045 | handled = btv->custom_irq(btv); | ||
4046 | |||
4047 | count=0; | 4044 | count=0; |
4048 | while (1) { | 4045 | while (1) { |
4049 | /* get/clear interrupt status bits */ | 4046 | /* get/clear interrupt status bits */ |
@@ -4079,7 +4076,6 @@ static irqreturn_t bttv_irq(int irq, void *dev_id) | |||
4079 | btv->field_count++; | 4076 | btv->field_count++; |
4080 | 4077 | ||
4081 | if ((astat & BT848_INT_GPINT) && btv->remote) { | 4078 | if ((astat & BT848_INT_GPINT) && btv->remote) { |
4082 | wake_up(&btv->gpioq); | ||
4083 | bttv_input_irq(btv); | 4079 | bttv_input_irq(btv); |
4084 | } | 4080 | } |
4085 | 4081 | ||
@@ -4284,7 +4280,6 @@ static int __devinit bttv_probe(struct pci_dev *dev, | |||
4284 | mutex_init(&btv->lock); | 4280 | mutex_init(&btv->lock); |
4285 | spin_lock_init(&btv->s_lock); | 4281 | spin_lock_init(&btv->s_lock); |
4286 | spin_lock_init(&btv->gpio_lock); | 4282 | spin_lock_init(&btv->gpio_lock); |
4287 | init_waitqueue_head(&btv->gpioq); | ||
4288 | init_waitqueue_head(&btv->i2c_queue); | 4283 | init_waitqueue_head(&btv->i2c_queue); |
4289 | INIT_LIST_HEAD(&btv->c.subs); | 4284 | INIT_LIST_HEAD(&btv->c.subs); |
4290 | INIT_LIST_HEAD(&btv->capture); | 4285 | INIT_LIST_HEAD(&btv->capture); |
@@ -4472,7 +4467,6 @@ static void __devexit bttv_remove(struct pci_dev *pci_dev) | |||
4472 | 4467 | ||
4473 | /* tell gpio modules we are leaving ... */ | 4468 | /* tell gpio modules we are leaving ... */ |
4474 | btv->shutdown=1; | 4469 | btv->shutdown=1; |
4475 | wake_up(&btv->gpioq); | ||
4476 | bttv_input_fini(btv); | 4470 | bttv_input_fini(btv); |
4477 | bttv_sub_del_devices(&btv->c); | 4471 | bttv_sub_del_devices(&btv->c); |
4478 | 4472 | ||
diff --git a/drivers/media/video/bt8xx/bttv-input.c b/drivers/media/video/bt8xx/bttv-input.c index 989c0481e3b1..7f48306133be 100644 --- a/drivers/media/video/bt8xx/bttv-input.c +++ b/drivers/media/video/bt8xx/bttv-input.c | |||
@@ -120,11 +120,15 @@ static void ir_enltv_handle_key(struct bttv *btv) | |||
120 | ir->last_gpio = data | keyup; | 120 | ir->last_gpio = data | keyup; |
121 | } | 121 | } |
122 | 122 | ||
123 | static int bttv_rc5_irq(struct bttv *btv); | ||
124 | |||
123 | void bttv_input_irq(struct bttv *btv) | 125 | void bttv_input_irq(struct bttv *btv) |
124 | { | 126 | { |
125 | struct bttv_ir *ir = btv->remote; | 127 | struct bttv_ir *ir = btv->remote; |
126 | 128 | ||
127 | if (!ir->polling) | 129 | if (ir->rc5_gpio) |
130 | bttv_rc5_irq(btv); | ||
131 | else if (!ir->polling) | ||
128 | ir_handle_key(btv); | 132 | ir_handle_key(btv); |
129 | } | 133 | } |
130 | 134 | ||
@@ -251,10 +255,6 @@ static int bttv_rc5_irq(struct bttv *btv) | |||
251 | /* read gpio port */ | 255 | /* read gpio port */ |
252 | gpio = bttv_gpio_read(&btv->c); | 256 | gpio = bttv_gpio_read(&btv->c); |
253 | 257 | ||
254 | /* remote IRQ? */ | ||
255 | if (!(gpio & 0x20)) | ||
256 | return 0; | ||
257 | |||
258 | /* get time of bit */ | 258 | /* get time of bit */ |
259 | current_jiffies = jiffies; | 259 | current_jiffies = jiffies; |
260 | do_gettimeofday(&tv); | 260 | do_gettimeofday(&tv); |
@@ -267,6 +267,13 @@ static int bttv_rc5_irq(struct bttv *btv) | |||
267 | tv.tv_usec - ir->base_time.tv_usec; | 267 | tv.tv_usec - ir->base_time.tv_usec; |
268 | } | 268 | } |
269 | 269 | ||
270 | dprintk(KERN_INFO DEVNAME ": RC5 IRQ: gap %d us for %s\n", | ||
271 | gap, (gpio & 0x20) ? "mark" : "space"); | ||
272 | |||
273 | /* remote IRQ? */ | ||
274 | if (!(gpio & 0x20)) | ||
275 | return 0; | ||
276 | |||
270 | /* active code => add bit */ | 277 | /* active code => add bit */ |
271 | if (ir->active) { | 278 | if (ir->active) { |
272 | /* only if in the code (otherwise spurious IRQ or timer | 279 | /* only if in the code (otherwise spurious IRQ or timer |
@@ -479,8 +486,7 @@ int bttv_input_init(struct bttv *btv) | |||
479 | break; | 486 | break; |
480 | case BTTV_BOARD_NEBULA_DIGITV: | 487 | case BTTV_BOARD_NEBULA_DIGITV: |
481 | ir_codes = RC_MAP_NEBULA; | 488 | ir_codes = RC_MAP_NEBULA; |
482 | btv->custom_irq = bttv_rc5_irq; | 489 | ir->rc5_gpio = true; |
483 | ir->rc5_gpio = 1; | ||
484 | break; | 490 | break; |
485 | case BTTV_BOARD_MACHTV_MAGICTV: | 491 | case BTTV_BOARD_MACHTV_MAGICTV: |
486 | ir_codes = RC_MAP_APAC_VIEWCOMP; | 492 | ir_codes = RC_MAP_APAC_VIEWCOMP; |
diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h index 071232045605..9b776faf0741 100644 --- a/drivers/media/video/bt8xx/bttvp.h +++ b/drivers/media/video/bt8xx/bttvp.h | |||
@@ -139,7 +139,7 @@ struct bttv_ir { | |||
139 | int rc5_remote_gap; | 139 | int rc5_remote_gap; |
140 | 140 | ||
141 | /* RC5 gpio */ | 141 | /* RC5 gpio */ |
142 | u32 rc5_gpio; | 142 | bool rc5_gpio; /* Is RC5 legacy GPIO enabled? */ |
143 | u32 last_bit; /* last raw bit seen */ | 143 | u32 last_bit; /* last raw bit seen */ |
144 | u32 code; /* raw code under construction */ | 144 | u32 code; /* raw code under construction */ |
145 | struct timeval base_time; /* time of last seen code */ | 145 | struct timeval base_time; /* time of last seen code */ |
@@ -364,12 +364,10 @@ struct bttv { | |||
364 | struct bttv_pll_info pll; | 364 | struct bttv_pll_info pll; |
365 | int triton1; | 365 | int triton1; |
366 | int gpioirq; | 366 | int gpioirq; |
367 | int (*custom_irq)(struct bttv *btv); | ||
368 | 367 | ||
369 | int use_i2c_hw; | 368 | int use_i2c_hw; |
370 | 369 | ||
371 | /* old gpio interface */ | 370 | /* old gpio interface */ |
372 | wait_queue_head_t gpioq; | ||
373 | int shutdown; | 371 | int shutdown; |
374 | 372 | ||
375 | void (*volume_gpio)(struct bttv *btv, __u16 volume); | 373 | void (*volume_gpio)(struct bttv *btv, __u16 volume); |