Commit b7c7a4be authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[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: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 5ae094ce
...@@ -4041,9 +4041,6 @@ static irqreturn_t bttv_irq(int irq, void *dev_id) ...@@ -4041,9 +4041,6 @@ static irqreturn_t bttv_irq(int irq, void *dev_id)
btv=(struct bttv *)dev_id; btv=(struct bttv *)dev_id;
if (btv->custom_irq)
handled = btv->custom_irq(btv);
count=0; count=0;
while (1) { while (1) {
/* get/clear interrupt status bits */ /* get/clear interrupt status bits */
...@@ -4079,7 +4076,6 @@ static irqreturn_t bttv_irq(int irq, void *dev_id) ...@@ -4079,7 +4076,6 @@ static irqreturn_t bttv_irq(int irq, void *dev_id)
btv->field_count++; btv->field_count++;
if ((astat & BT848_INT_GPINT) && btv->remote) { if ((astat & BT848_INT_GPINT) && btv->remote) {
wake_up(&btv->gpioq);
bttv_input_irq(btv); bttv_input_irq(btv);
} }
...@@ -4284,7 +4280,6 @@ static int __devinit bttv_probe(struct pci_dev *dev, ...@@ -4284,7 +4280,6 @@ static int __devinit bttv_probe(struct pci_dev *dev,
mutex_init(&btv->lock); mutex_init(&btv->lock);
spin_lock_init(&btv->s_lock); spin_lock_init(&btv->s_lock);
spin_lock_init(&btv->gpio_lock); spin_lock_init(&btv->gpio_lock);
init_waitqueue_head(&btv->gpioq);
init_waitqueue_head(&btv->i2c_queue); init_waitqueue_head(&btv->i2c_queue);
INIT_LIST_HEAD(&btv->c.subs); INIT_LIST_HEAD(&btv->c.subs);
INIT_LIST_HEAD(&btv->capture); INIT_LIST_HEAD(&btv->capture);
...@@ -4472,7 +4467,6 @@ static void __devexit bttv_remove(struct pci_dev *pci_dev) ...@@ -4472,7 +4467,6 @@ static void __devexit bttv_remove(struct pci_dev *pci_dev)
/* tell gpio modules we are leaving ... */ /* tell gpio modules we are leaving ... */
btv->shutdown=1; btv->shutdown=1;
wake_up(&btv->gpioq);
bttv_input_fini(btv); bttv_input_fini(btv);
bttv_sub_del_devices(&btv->c); bttv_sub_del_devices(&btv->c);
......
...@@ -120,11 +120,15 @@ static void ir_enltv_handle_key(struct bttv *btv) ...@@ -120,11 +120,15 @@ static void ir_enltv_handle_key(struct bttv *btv)
ir->last_gpio = data | keyup; ir->last_gpio = data | keyup;
} }
static int bttv_rc5_irq(struct bttv *btv);
void bttv_input_irq(struct bttv *btv) void bttv_input_irq(struct bttv *btv)
{ {
struct bttv_ir *ir = btv->remote; 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); ir_handle_key(btv);
} }
...@@ -251,10 +255,6 @@ static int bttv_rc5_irq(struct bttv *btv) ...@@ -251,10 +255,6 @@ static int bttv_rc5_irq(struct bttv *btv)
/* read gpio port */ /* read gpio port */
gpio = bttv_gpio_read(&btv->c); gpio = bttv_gpio_read(&btv->c);
/* remote IRQ? */
if (!(gpio & 0x20))
return 0;
/* get time of bit */ /* get time of bit */
current_jiffies = jiffies; current_jiffies = jiffies;
do_gettimeofday(&tv); do_gettimeofday(&tv);
...@@ -267,6 +267,13 @@ static int bttv_rc5_irq(struct bttv *btv) ...@@ -267,6 +267,13 @@ static int bttv_rc5_irq(struct bttv *btv)
tv.tv_usec - ir->base_time.tv_usec; 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 */ /* active code => add bit */
if (ir->active) { if (ir->active) {
/* only if in the code (otherwise spurious IRQ or timer /* only if in the code (otherwise spurious IRQ or timer
...@@ -479,8 +486,7 @@ int bttv_input_init(struct bttv *btv) ...@@ -479,8 +486,7 @@ int bttv_input_init(struct bttv *btv)
break; break;
case BTTV_BOARD_NEBULA_DIGITV: case BTTV_BOARD_NEBULA_DIGITV:
ir_codes = RC_MAP_NEBULA; ir_codes = RC_MAP_NEBULA;
btv->custom_irq = bttv_rc5_irq; ir->rc5_gpio = true;
ir->rc5_gpio = 1;
break; break;
case BTTV_BOARD_MACHTV_MAGICTV: case BTTV_BOARD_MACHTV_MAGICTV:
ir_codes = RC_MAP_APAC_VIEWCOMP; ir_codes = RC_MAP_APAC_VIEWCOMP;
......
...@@ -139,7 +139,7 @@ struct bttv_ir { ...@@ -139,7 +139,7 @@ struct bttv_ir {
int rc5_remote_gap; int rc5_remote_gap;
/* RC5 gpio */ /* RC5 gpio */
u32 rc5_gpio; bool rc5_gpio; /* Is RC5 legacy GPIO enabled? */
u32 last_bit; /* last raw bit seen */ u32 last_bit; /* last raw bit seen */
u32 code; /* raw code under construction */ u32 code; /* raw code under construction */
struct timeval base_time; /* time of last seen code */ struct timeval base_time; /* time of last seen code */
...@@ -364,12 +364,10 @@ struct bttv { ...@@ -364,12 +364,10 @@ struct bttv {
struct bttv_pll_info pll; struct bttv_pll_info pll;
int triton1; int triton1;
int gpioirq; int gpioirq;
int (*custom_irq)(struct bttv *btv);
int use_i2c_hw; int use_i2c_hw;
/* old gpio interface */ /* old gpio interface */
wait_queue_head_t gpioq;
int shutdown; int shutdown;
void (*volume_gpio)(struct bttv *btv, __u16 volume); void (*volume_gpio)(struct bttv *btv, __u16 volume);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment