summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Schirmer <devnull@localhost>2003-02-02 15:07:46 +0000
committerFlorian Schirmer <devnull@localhost>2003-02-02 15:07:46 +0000
commitb512dccd9c99886629b04291b4b391c5c6639a45 (patch)
treed14421878b7e8dd5d8de849605025eebe299b8c9
parent3ba14244f3f271e0eea7e2c87543ba1310db8804 (diff)
downloadmediapointer-dvb-s2-b512dccd9c99886629b04291b4b391c5c6639a45.tar.gz
mediapointer-dvb-s2-b512dccd9c99886629b04291b4b391c5c6639a45.tar.bz2
Support more than one card
-rw-r--r--linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index 4b287a82f..e860b5b45 100644
--- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -38,6 +38,7 @@
extern int bttv_get_cardinfo(unsigned int card, int *type, int *cardid);
extern struct i2c_adapter *bttv_get_i2c_adap(unsigned int card);
+extern struct pci_dev* bttv_get_pcidev(unsigned int card);
static LIST_HEAD(card_list);
static int debug = 0;
@@ -117,6 +118,29 @@ static int dvb_bt8xx_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
}
+static struct bt878 *dvb_bt8xx_get_bt(unsigned int bttv_nr)
+{
+
+ struct pci_dev* bttv_pci_dev;
+ unsigned int card_nr;
+
+ if (!(bttv_pci_dev = bttv_get_pcidev(bttv_nr)))
+ return NULL;
+
+ for (card_nr = 0; card_nr < bt878_num; card_nr++) {
+
+ if ((bt878[card_nr].dev->subsystem_vendor == bttv_pci_dev->subsystem_vendor) &&
+ (bt878[card_nr].dev->subsystem_device == bttv_pci_dev->subsystem_device) &&
+ (bt878[card_nr].dev->bus->number == bttv_pci_dev->bus->number) &&
+ (PCI_SLOT(bt878[card_nr].dev->devfn) == PCI_SLOT(bttv_pci_dev->devfn)))
+ return &bt878[card_nr];
+
+ }
+
+ return NULL;
+
+}
+
static int __init dvb_bt8xx_load(unsigned int bttv_nr, char *card_name, u32 gpio_mode)
{
@@ -128,8 +152,16 @@ static int __init dvb_bt8xx_load(unsigned int bttv_nr, char *card_name, u32 gpio
if (!(card = kmalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL)))
return -ENOMEM;
- card->bt = &bt878[0];
card->bttv_nr = bttv_nr;
+
+ if (!(card->bt = dvb_bt8xx_get_bt(card->bttv_nr))) {
+
+ printk("dvb_bt8xx: unable to determine DMA core of card%d\n", card->bttv_nr);
+
+ return -EFAULT;
+
+ }
+
card->gpio_mode = gpio_mode;
if (!(card->i2c_adap = bttv_get_i2c_adap(card->bttv_nr))) {