summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx/bttv-input.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-11-28 11:48:26 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-29 08:16:57 -0200
commitb7c7a4bed8d695933ae172031556de9de30ae598 (patch)
tree397af41932d32c8ea30fbb0f1f2e30717b610911 /drivers/media/video/bt8xx/bttv-input.c
parent5ae094cea1b4f3715ee6ea4f49d0b36d564f90e7 (diff)
downloadblackbird-obmc-linux-b7c7a4bed8d695933ae172031556de9de30ae598.tar.gz
blackbird-obmc-linux-b7c7a4bed8d695933ae172031556de9de30ae598.zip
[media] bttv: remove custom_irq and gpioq from bttv struct
The RC5 old decoder used custom_irq to indicate the need of handling the IRQ on a different way. Instead of doing it, let the core just call the bttv input IRQ handler, and add the code there to call the legacy decoder. While here, remove the gpioq waitqueue, as this is not used anywhere, and add a debug msg to help removing the legacy RC5 code. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/bt8xx/bttv-input.c')
-rw-r--r--drivers/media/video/bt8xx/bttv-input.c20
1 files changed, 13 insertions, 7 deletions
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)
ir->last_gpio = data | keyup;
}
+static int bttv_rc5_irq(struct bttv *btv);
+
void bttv_input_irq(struct bttv *btv)
{
struct bttv_ir *ir = btv->remote;
- if (!ir->polling)
+ if (ir->rc5_gpio)
+ bttv_rc5_irq(btv);
+ else if (!ir->polling)
ir_handle_key(btv);
}
@@ -251,10 +255,6 @@ static int bttv_rc5_irq(struct bttv *btv)
/* read gpio port */
gpio = bttv_gpio_read(&btv->c);
- /* remote IRQ? */
- if (!(gpio & 0x20))
- return 0;
-
/* get time of bit */
current_jiffies = jiffies;
do_gettimeofday(&tv);
@@ -267,6 +267,13 @@ static int bttv_rc5_irq(struct bttv *btv)
tv.tv_usec - ir->base_time.tv_usec;
}
+ dprintk(KERN_INFO DEVNAME ": RC5 IRQ: gap %d us for %s\n",
+ gap, (gpio & 0x20) ? "mark" : "space");
+
+ /* remote IRQ? */
+ if (!(gpio & 0x20))
+ return 0;
+
/* active code => add bit */
if (ir->active) {
/* only if in the code (otherwise spurious IRQ or timer
@@ -479,8 +486,7 @@ int bttv_input_init(struct bttv *btv)
break;
case BTTV_BOARD_NEBULA_DIGITV:
ir_codes = RC_MAP_NEBULA;
- btv->custom_irq = bttv_rc5_irq;
- ir->rc5_gpio = 1;
+ ir->rc5_gpio = true;
break;
case BTTV_BOARD_MACHTV_MAGICTV:
ir_codes = RC_MAP_APAC_VIEWCOMP;
OpenPOWER on IntegriCloud