summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorHolger Waechtler <devnull@localhost>2003-02-07 14:19:11 +0000
committerHolger Waechtler <devnull@localhost>2003-02-07 14:19:11 +0000
commitbb7e4b9a970806b7e6b6f8d29db533c363928836 (patch)
tree21810a77c31381a349fcd953bc3d6fcad5645731 /linux/drivers/media
parentab5a7f7d29d91f93cf44263ae0d3ec5b28973cdd (diff)
downloadmediapointer-dvb-s2-bb7e4b9a970806b7e6b6f8d29db533c363928836.tar.gz
mediapointer-dvb-s2-bb7e4b9a970806b7e6b6f8d29db533c363928836.tar.bz2
apply new irq handler for Nova cards contributed by Marian Durkovic <md@bts.sk>,
ported by Emard <emard@softhome.net> to the 2.5 kernel tree
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/dvb/ttpci-budget/budget-core.c47
-rw-r--r--linux/drivers/media/dvb/ttpci-budget/budget.c2
-rw-r--r--linux/drivers/media/dvb/ttpci-budget/budget.h3
3 files changed, 42 insertions, 10 deletions
diff --git a/linux/drivers/media/dvb/ttpci-budget/budget-core.c b/linux/drivers/media/dvb/ttpci-budget/budget-core.c
index 0f109a12f..1d899c3d9 100644
--- a/linux/drivers/media/dvb/ttpci-budget/budget-core.c
+++ b/linux/drivers/media/dvb/ttpci-budget/budget-core.c
@@ -58,7 +58,7 @@ TTBStop(struct budget_s *budget)
return budget->feeding;
saa7146_write(budget->dev, MC1, MASK_20); // DMA3 off
- IER_DISABLE(budget->dev, MASK_07);
+ IER_DISABLE(budget->dev, MASK_07|MASK_10);
return 0;
}
@@ -81,7 +81,7 @@ TTBStart(struct budget_s *budget)
budget->tsf=0xff;
budget->ttbp=0;
- saa7146_write(dev, DD1_INIT, 0x020006c0);
+ saa7146_write(dev, DD1_INIT, 0x02000600);
saa7146_write(dev, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26));
saa7146_write(dev, BRS_CTRL, 0x60000000);
@@ -91,20 +91,48 @@ TTBStart(struct budget_s *budget)
saa7146_write(dev, BASE_ODD3, 0);
saa7146_write(dev, BASE_EVEN3, TS_WIDTH*TS_HEIGHT/2);
saa7146_write(dev, PROT_ADDR3, TS_WIDTH*TS_HEIGHT);
- saa7146_write(dev, BASE_PAGE3, budget->pt.dma |ME1|0xb0);
- saa7146_write(dev, PITCH3, TS_WIDTH);
+ saa7146_write(dev, BASE_PAGE3, budget->pt.dma |ME1|0x90);
+ saa7146_write(dev, PITCH3, TS_WIDTH);
saa7146_write(dev, NUM_LINE_BYTE3, ((TS_HEIGHT/2)<<16)|TS_WIDTH);
saa7146_write(dev, MC2, (MASK_04 | MASK_20));
-
saa7146_write(dev, MC1, (MASK_04 | MASK_20)); // DMA3 on
- // FIDB
- IER_ENABLE(budget->dev, MASK_07);
+ IER_ENABLE(budget->dev, MASK_07|MASK_10); // FIDB + VPE
return ++budget->feeding;
}
+static void vpeirq (unsigned long data)
+{
+ struct budget_s *budget = (struct budget_s*) data;
+ u8 *mem=(u8 *)(budget->grabbing);
+ int num;
+ u32 dmapos;
+
+ dmapos=saa7146_read(budget->dev, PCI_VDP3);
+ dmapos-=(dmapos%188);
+
+ if (dmapos >= TS_BUFLEN)
+ return;
+
+ if (dmapos > budget->ttbp) {
+ mem+=budget->ttbp;
+ num=(dmapos-budget->ttbp)/188;
+ } else {
+ if (budget->feeding && mem[budget->ttbp]==0x47)
+ dvb_dmx_swfilter_packets(&budget->demux,
+ mem+budget->ttbp, 1024-budget->ttbp/188);
+
+ num=dmapos/188;
+ }
+
+ budget->ttbp=dmapos;
+
+ if (budget->feeding && mem[0]==0x47)
+ dvb_dmx_swfilter_packets(&budget->demux, mem, num);
+}
+
/* TS_PACKETS is minumum number of accumulated 188-byte packets
** (TS_SIZE=188) that is considered 'complete' and can
** be delivered to the sw_demux in one 'quantum'.
@@ -123,7 +151,7 @@ void fidbirq (unsigned long data)
u16 newpkt = saa7146_read(budget->dev, PCI_VDP3)/TS_QUANTUM; /* PCI_VDP3 = 0..TS_BUFLEN-1 */
u8 *olddma = mem + oldpkt*TS_QUANTUM; /* rounded to first complete packet */
- DEB_EE(("budget: %p\n",budget));
+ DEB_EE(("budget: %p\n", budget));
/* Zero-Packet-Loss fidbirq by EMARD */
@@ -545,6 +573,7 @@ int budget_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_data *i
saa7146_write(dev, GPIO_CTRL, 0x000000);
tasklet_init (&budget->fidb_tasklet, fidbirq, (unsigned long) budget);
+ tasklet_init (&budget->vpe_tasklet, vpeirq, (unsigned long) budget);
saa7146_setgpio(dev, 2, SAA7146_GPIO_OUTHI); /* frontend power on */
return 0;
@@ -590,6 +619,8 @@ void budget_irq(struct saa7146_dev* dev, u32 *isr)
if (*isr & MASK_07)
tasklet_schedule (&budget->fidb_tasklet);
+ if (*isr & MASK_10)
+ tasklet_schedule (&budget->vpe_tasklet);
}
EXPORT_SYMBOL_GPL(budget_register);
diff --git a/linux/drivers/media/dvb/ttpci-budget/budget.c b/linux/drivers/media/dvb/ttpci-budget/budget.c
index 4c207f83a..4d0207476 100644
--- a/linux/drivers/media/dvb/ttpci-budget/budget.c
+++ b/linux/drivers/media/dvb/ttpci-budget/budget.c
@@ -86,7 +86,7 @@ struct saa7146_extension budget_extension = {
.attach = this_budget_attach,
.detach = budget_detach,
- .irq_mask = MASK_07,
+ .irq_mask = MASK_07|MASK_10,
.irq_func = budget_irq,
};
diff --git a/linux/drivers/media/dvb/ttpci-budget/budget.h b/linux/drivers/media/dvb/ttpci-budget/budget.h
index 0a0a5b16b..47c5b6225 100644
--- a/linux/drivers/media/dvb/ttpci-budget/budget.h
+++ b/linux/drivers/media/dvb/ttpci-budget/budget.h
@@ -35,6 +35,7 @@ struct budget_s {
struct saa7146_pgtable pt;
struct tasklet_struct fidb_tasklet;
+ struct tasklet_struct vpe_tasklet;
dmxdev_t dmxdev;
struct dvb_demux demux;
@@ -47,7 +48,7 @@ struct budget_s {
struct semaphore pid_mutex;
u8 tsf;
- u16 ttbp;
+ u32 ttbp;
int feeding;
int registered;