Skip to content

Commit

Permalink
[PATCH] v4l: (939) Support for nebula rc5 based gpio remote
Browse files Browse the repository at this point in the history
Support for Nebula rc5-based gpio remote.

Signed-off-by: Mark Weaver <mark-clist@npsl.co.uk>
Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Mark Weaver authored and Linus Torvalds committed Nov 14, 2005
1 parent 871242b commit 6c6c0b2
Show file tree
Hide file tree
Showing 6 changed files with 317 additions and 6 deletions.
5 changes: 5 additions & 0 deletions drivers/media/video/bttv-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -2133,7 +2133,10 @@ struct tvcard bttv_tvcards[] = {
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
.has_dvb = 1,
.has_remote = 1,
.gpiomask = 0x1b,
.no_gpioirq = 1,
.any_irq = 1,
},
[BTTV_BOARD_PV143] = {
/* Jorge Boncompte - DTI2 <jorge@dti2.net> */
Expand Down Expand Up @@ -3384,6 +3387,8 @@ void __devinit bttv_init_card2(struct bttv *btv)
btv->has_remote=1;
if (!bttv_tvcards[btv->c.type].no_gpioirq)
btv->gpioirq=1;
if (bttv_tvcards[btv->c.type].any_irq)
btv->any_irq = 1;
if (bttv_tvcards[btv->c.type].audio_hook)
btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook;

Expand Down
4 changes: 4 additions & 0 deletions drivers/media/video/bttv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3667,6 +3667,10 @@ static irqreturn_t bttv_irq(int irq, void *dev_id, struct pt_regs * regs)
int handled = 0;

btv=(struct bttv *)dev_id;

if (btv->any_irq)
handled = bttv_any_irq(&btv->c);

count=0;
while (1) {
/* get/clear interrupt status bits */
Expand Down
18 changes: 18 additions & 0 deletions drivers/media/video/bttv-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,24 @@ void bttv_gpio_irq(struct bttv_core *core)
}
}

int bttv_any_irq(struct bttv_core *core)
{
struct bttv_sub_driver *drv;
struct bttv_sub_device *dev;
struct list_head *item;
int handled = 0;

list_for_each(item,&core->subs) {
dev = list_entry(item,struct bttv_sub_device,list);
drv = to_bttv_sub_drv(dev->dev.driver);
if (drv && drv->any_irq) {
if (drv->any_irq(dev))
handled = 1;
}
}
return handled;
}

/* ----------------------------------------------------------------------- */
/* external: sub-driver register/unregister */

Expand Down
2 changes: 2 additions & 0 deletions drivers/media/video/bttv.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ struct tvcard
unsigned int has_dvb:1;
unsigned int has_remote:1;
unsigned int no_gpioirq:1;
unsigned int any_irq:1;

/* other settings */
unsigned int pll;
Expand Down Expand Up @@ -334,6 +335,7 @@ struct bttv_sub_driver {
struct device_driver drv;
char wanted[BUS_ID_SIZE];
void (*gpio_irq)(struct bttv_sub_device *sub);
int (*any_irq)(struct bttv_sub_device *sub);
};
#define to_bttv_sub_drv(x) container_of((x), struct bttv_sub_driver, drv)

Expand Down
2 changes: 2 additions & 0 deletions drivers/media/video/bttvp.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ extern struct bus_type bttv_sub_bus_type;
int bttv_sub_add_device(struct bttv_core *core, char *name);
int bttv_sub_del_devices(struct bttv_core *core);
void bttv_gpio_irq(struct bttv_core *core);
int bttv_any_irq(struct bttv_core *core);


/* ---------------------------------------------------------- */
Expand Down Expand Up @@ -273,6 +274,7 @@ struct bttv {
struct bttv_pll_info pll;
int triton1;
int gpioirq;
int any_irq;
int use_i2c_hw;

/* old gpio interface */
Expand Down
Loading

0 comments on commit 6c6c0b2

Please sign in to comment.