summaryrefslogtreecommitdiff
path: root/linux/drivers/media/common/saa7146_vbi.c
diff options
context:
space:
mode:
authorMichael Hunold <devnull@localhost>2003-10-06 18:55:09 +0000
committerMichael Hunold <devnull@localhost>2003-10-06 18:55:09 +0000
commit790720cf4b0284baba3bd526b38c70a324a4c3b9 (patch)
treef54e13dc50a828d347ced9d75959aa7bd52677da /linux/drivers/media/common/saa7146_vbi.c
parent03ddbdd9a49da4a2b8cf45cd1fb8ddca61da98ea (diff)
downloadmediapointer-dvb-s2-790720cf4b0284baba3bd526b38c70a324a4c3b9.tar.gz
mediapointer-dvb-s2-790720cf4b0284baba3bd526b38c70a324a4c3b9.tar.bz2
- add some debug and safety checks for video/vbi capture buffer handling
- fix init/exit of vbi capable devices - add new flag SAA7146_USE_PORT_B_FOR_VBI, so we can distinguish on which video port to apply the vbi workaround - add del_timer(...) for vbi capture queue and vbi_read timers, otherwise the kernel timer schedule oopses - add vbi device handling for dvb-c cards with analog module (does not work yet, have to setup the saa7113 decoder differently)
Diffstat (limited to 'linux/drivers/media/common/saa7146_vbi.c')
-rw-r--r--linux/drivers/media/common/saa7146_vbi.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/linux/drivers/media/common/saa7146_vbi.c b/linux/drivers/media/common/saa7146_vbi.c
index 48893bf37..5538ad633 100644
--- a/linux/drivers/media/common/saa7146_vbi.c
+++ b/linux/drivers/media/common/saa7146_vbi.c
@@ -38,8 +38,14 @@ static int vbi_workaround(struct saa7146_dev *dev)
WRITE_RPS1(CMD_WR_REG | (1 << 8) | (BRS_CTRL/4));
/* BXO = 1h, BRS to outbound */
WRITE_RPS1(0xc000008c);
- /* wait for vbi_a */
- WRITE_RPS1(CMD_PAUSE | MASK_10);
+ /* wait for vbi_a or vbi_b*/
+ if ( 0 != (SAA7146_USE_PORT_B_FOR_VBI & dev->ext_vv_data->flags)) {
+ DEB_D(("...using port b\n"));
+ WRITE_RPS1(CMD_PAUSE | MASK_09);
+ } else {
+ DEB_D(("...using port a\n"));
+ WRITE_RPS1(CMD_PAUSE | MASK_10);
+ }
/* upload brs */
WRITE_RPS1(CMD_UPLOAD | MASK_08);
/* load brs-control register */
@@ -106,7 +112,7 @@ static int vbi_workaround(struct saa7146_dev *dev)
if(signal_pending(current)) {
- DEB_VBI(("aborted.\n"));
+ DEB_VBI(("aborted (rps:0x%08x).\n",saa7146_read(dev,RPS_ADDR1)));
/* stop rps1 for sure */
saa7146_write(dev, MC1, MASK_29);
@@ -316,6 +322,11 @@ static void vbi_stop(struct saa7146_fh *fh)
saa7146_write(dev, MC1, MASK_20);
vv->vbi_streaming = NULL;
+
+ del_timer(&vv->vbi_q.timeout);
+ del_timer(&fh->vbi_read_timeout);
+
+ DEB_VBI(("out\n"));
spin_unlock_irqrestore(&dev->slock, flags);
}
@@ -371,7 +382,10 @@ static void vbi_open(struct saa7146_dev *dev, struct saa7146_fh *fh)
fh->vbi_read_timeout.function = vbi_read_timeout;
fh->vbi_read_timeout.data = (unsigned long)fh;
+ /* fixme! */
+/*
vbi_workaround(dev);
+*/
}
static void vbi_close(struct saa7146_dev *dev, struct saa7146_fh *fh, struct file *file)
@@ -410,7 +424,7 @@ static ssize_t vbi_read(struct file *file, char *data, size_t count, loff_t *ppo
struct saa7146_vv *vv = dev->vv_data;
ssize_t ret = 0;
- DEB_VBI(("dev:%p, fh:%p\n",dev,fh));
+// DEB_VBI(("dev:%p, fh:%p\n",dev,fh));
if( NULL == vv->vbi_streaming ) {
// fixme: check if dma3 is available