diff -ur a/drivers/media/video/bt8xx/bttv.h b/drivers/media/video/bt8xx/bttv.h --- a/drivers/media/video/bt8xx/bttv.h 2008-01-24 23:58:37.000000000 +0100 +++ b/drivers/media/video/bt8xx/bttv.h 2008-02-03 16:56:56.000000000 +0100 @@ -263,8 +263,12 @@ /* ---------------------------------------------------------- */ /* exported by bttv-if.c */ -/* this obsolete -- please use the sysfs-based - interface below for new code */ +/* returns card type + card ID (for bt878-based ones) for possible + values see lines below beginning with #define BTTV_BOARD_UNKNOWN + returns negative value if error occurred +*/ +extern int bttv_get_cardinfo(unsigned int card, int *type, + unsigned int *cardid); extern struct pci_dev* bttv_get_pcidev(unsigned int card); @@ -287,6 +291,16 @@ extern int bttv_write_gpio(unsigned int card, unsigned long mask, unsigned long data); +/* returns pointer to task queue which can be used as parameter to + interruptible_sleep_on + in interrupt handler if BT848_INT_GPINT bit is set - this queue is activated + (wake_up_interruptible) and following call to the function bttv_read_gpio + should return new value of GPDATA, + returns NULL value if error occurred or queue is not available + WARNING: because there is no buffer for GPIO data, one MUST + process data ASAP +*/ +extern wait_queue_head_t *bttv_get_gpio_queue(unsigned int card); diff -ur a/drivers/media/video/bt8xx/bttv-if.c b/drivers/media/video/bt8xx/bttv-if.c --- a/drivers/media/video/bt8xx/bttv-if.c 2008-01-24 23:58:37.000000000 +0100 +++ b/drivers/media/video/bt8xx/bttv-if.c 2008-02-03 16:56:56.000000000 +0100 @@ -43,6 +43,16 @@ /* gpio ports (IR for example) */ /* see bttv.h for comments */ +int bttv_get_cardinfo(unsigned int card, int *type, unsigned *cardid) +{ + if (card >= bttv_num) + return -1; + *type = bttvs[card].c.type; + *cardid = bttvs[card].cardid; + return 0; +} +EXPORT_SYMBOL(bttv_get_cardinfo); + struct pci_dev* bttv_get_pcidev(unsigned int card) { if (card >= bttv_num) @@ -104,6 +114,20 @@ return 0; } +wait_queue_head_t *bttv_get_gpio_queue(unsigned int card) +{ + struct bttv *btv; + + if (card >= bttv_num) + return NULL; + + btv = &bttvs[card]; + if (bttvs[card].shutdown) + return NULL; + return &btv->gpioq; +} +EXPORT_SYMBOL(bttv_get_gpio_queue); + /* * Local variables: * c-basic-offset: 8