diff options
author | Michael Hunold <devnull@localhost> | 2003-07-07 11:28:54 +0000 |
---|---|---|
committer | Michael Hunold <devnull@localhost> | 2003-07-07 11:28:54 +0000 |
commit | e841743cf89630b111efa5feccde7ded4d96c5f7 (patch) | |
tree | 9ecfc993bb338715e37bcce2694a41a0f5ad5b68 /linux/drivers/media/common | |
parent | 424b720a5ac042b07b0b1045f36c915b617ebaf1 (diff) | |
download | mediapointer-dvb-s2-e841743cf89630b111efa5feccde7ded4d96c5f7.tar.gz mediapointer-dvb-s2-e841743cf89630b111efa5feccde7ded4d96c5f7.tar.bz2 |
Make the "ext_vv_data" informations a per-device information instead
of a per-extension information. This is needed for the DVB-C cards,
which seem to have swapped field order and need to propagate some
video4linux specific stuff for the analog module to work.
Diffstat (limited to 'linux/drivers/media/common')
-rw-r--r-- | linux/drivers/media/common/saa7146_core.c | 8 | ||||
-rw-r--r-- | linux/drivers/media/common/saa7146_fops.c | 7 | ||||
-rw-r--r-- | linux/drivers/media/common/saa7146_hlp.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/common/saa7146_video.c | 34 |
4 files changed, 29 insertions, 24 deletions
diff --git a/linux/drivers/media/common/saa7146_core.c b/linux/drivers/media/common/saa7146_core.c index 51013c6b9..0bc053a2e 100644 --- a/linux/drivers/media/common/saa7146_core.c +++ b/linux/drivers/media/common/saa7146_core.c @@ -153,7 +153,7 @@ void saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *p ptr = pt->cpu; for (i = 0; i < length; i++, list++) { for (p = 0; p * 4096 < list->length; p++, ptr++) { - *ptr = sg_dma_address(list) - list->offset; + *ptr = sg_dma_address(list) - list->offset; // + p } } @@ -372,6 +372,9 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent dev->module = THIS_MODULE; init_waitqueue_head(&dev->i2c_wq); + /* set some default values */ + saa7146_write(dev, BCS_CTRL, 0x80400040); + if( 0 != ext->probe) { if( 0 != ext->probe(dev) ) { DEB_D(("ext->probe() failed for %p. skipping device.\n",dev)); @@ -390,9 +393,6 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent list_add_tail(&dev->item,&saa7146_devices); saa7146_num++; - /* set some default values */ - saa7146_write(dev, BCS_CTRL, 0x80400040); - err = 0; goto out; attach_error: diff --git a/linux/drivers/media/common/saa7146_fops.c b/linux/drivers/media/common/saa7146_fops.c index 73d39004b..5562f93c0 100644 --- a/linux/drivers/media/common/saa7146_fops.c +++ b/linux/drivers/media/common/saa7146_fops.c @@ -385,7 +385,7 @@ static struct video_device device_template = .minor = -1, }; -int saa7146_vv_init(struct saa7146_dev* dev) +int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv) { struct saa7146_vv *vv = kmalloc (sizeof(struct saa7146_vv),GFP_KERNEL); if( NULL == vv ) { @@ -395,6 +395,11 @@ int saa7146_vv_init(struct saa7146_dev* dev) memset(vv, 0x0, sizeof(*vv)); DEB_EE(("dev:%p\n",dev)); + + /* save per-device extension data (one extension can + handle different devices that might need different + configuration data) */ + dev->ext_vv_data = ext_vv; vv->video_minor = -1; vv->vbi_minor = -1; diff --git a/linux/drivers/media/common/saa7146_hlp.c b/linux/drivers/media/common/saa7146_hlp.c index 76ac43cfe..32cc90748 100644 --- a/linux/drivers/media/common/saa7146_hlp.c +++ b/linux/drivers/media/common/saa7146_hlp.c @@ -710,7 +710,7 @@ void saa7146_write_out_dma(struct saa7146_dev* dev, int which, struct saa7146_vi /* calculate starting address */ where = (which-1)*0x18; - if( 0 != (dev->ext->ext_vv_data->flags & SAA7146_EXT_SWAP_ODD_EVEN)) { + if( 0 != (dev->ext_vv_data->flags & SAA7146_EXT_SWAP_ODD_EVEN)) { saa7146_write(dev, where, vdma->base_even); saa7146_write(dev, where+0x04, vdma->base_odd); } else { @@ -962,7 +962,7 @@ static void program_capture_engine(struct saa7146_dev *dev, int planar) unsigned long e_wait = vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? CMD_E_FID_A : CMD_E_FID_B; unsigned long o_wait = vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? CMD_O_FID_A : CMD_O_FID_B; - if( 0 != (dev->ext->ext_vv_data->flags & SAA7146_EXT_SWAP_ODD_EVEN)) { + if( 0 != (dev->ext_vv_data->flags & SAA7146_EXT_SWAP_ODD_EVEN)) { unsigned long tmp = e_wait; e_wait = o_wait; o_wait = tmp; diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c index ef443426e..502ffbc2c 100644 --- a/linux/drivers/media/common/saa7146_video.c +++ b/linux/drivers/media/common/saa7146_video.c @@ -748,19 +748,19 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int struct videobuf_queue *q; /* check if extension handles the command */ - for(ee = 0; dev->ext->ext_vv_data->ioctls[ee].flags != 0; ee++) { - if( cmd == dev->ext->ext_vv_data->ioctls[ee].cmd ) + for(ee = 0; dev->ext_vv_data->ioctls[ee].flags != 0; ee++) { + if( cmd == dev->ext_vv_data->ioctls[ee].cmd ) break; } - if( 0 != (dev->ext->ext_vv_data->ioctls[ee].flags & SAA7146_EXCLUSIVE) ) { + if( 0 != (dev->ext_vv_data->ioctls[ee].flags & SAA7146_EXCLUSIVE) ) { DEB_D(("extension handles ioctl exclusive.\n")); - result = dev->ext->ext_vv_data->ioctl(fh, cmd, arg); + result = dev->ext_vv_data->ioctl(fh, cmd, arg); return result; } - if( 0 != (dev->ext->ext_vv_data->ioctls[ee].flags & SAA7146_BEFORE) ) { + if( 0 != (dev->ext_vv_data->ioctls[ee].flags & SAA7146_BEFORE) ) { DEB_D(("extension handles ioctl before.\n")); - result = dev->ext->ext_vv_data->ioctl(fh, cmd, arg); + result = dev->ext_vv_data->ioctl(fh, cmd, arg); if( -EAGAIN != result ) { return result; } @@ -801,7 +801,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int V4L2_CAP_VIDEO_OVERLAY | V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; - cap->capabilities |= dev->ext->ext_vv_data->capabilities; + cap->capabilities |= dev->ext_vv_data->capabilities; return 0; } case VIDIOC_G_FBUF: @@ -950,9 +950,9 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int struct v4l2_standard *e = arg; if (e->index < 0 ) return -EINVAL; - if( e->index < dev->ext->ext_vv_data->num_stds ) { + if( e->index < dev->ext_vv_data->num_stds ) { DEB_EE(("VIDIOC_ENUMSTD: index:%d\n",e->index)); - v4l2_video_std_construct(e, dev->ext->ext_vv_data->stds[e->index].id, dev->ext->ext_vv_data->stds[e->index].name); + v4l2_video_std_construct(e, dev->ext_vv_data->stds[e->index].id, dev->ext_vv_data->stds[e->index].name); return 0; } return -EINVAL; @@ -981,13 +981,13 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int restart_overlay = 1; } - for(i = 0; i < dev->ext->ext_vv_data->num_stds; i++) - if (*id & dev->ext->ext_vv_data->stds[i].id) + for(i = 0; i < dev->ext_vv_data->num_stds; i++) + if (*id & dev->ext_vv_data->stds[i].id) break; - if (i != dev->ext->ext_vv_data->num_stds) { - vv->standard = &dev->ext->ext_vv_data->stds[i]; - if( NULL != dev->ext->ext_vv_data->std_callback ) - dev->ext->ext_vv_data->std_callback(dev, vv->standard); + if (i != dev->ext_vv_data->num_stds) { + vv->standard = &dev->ext_vv_data->stds[i]; + if( NULL != dev->ext_vv_data->std_callback ) + dev->ext_vv_data->std_callback(dev, vv->standard); found = 1; } @@ -1084,7 +1084,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int q = &fh->video_q; down(&q->lock); - err = videobuf_mmap_setup(file,q,gbuffers,gbufsize); + err = videobuf_mmap_setup(file,q,gbuffers,gbufsize); // ,V4L2_MEMORY_MMAP); if (err < 0) { up(&q->lock); return err; @@ -1259,7 +1259,7 @@ static void video_init(struct saa7146_dev *dev, struct saa7146_vv *vv) vv->video_q.dev = dev; /* set some default values */ - vv->standard = &dev->ext->ext_vv_data->stds[0]; + vv->standard = &dev->ext_vv_data->stds[0]; /* FIXME: what's this? */ vv->current_hps_source = SAA7146_HPS_SOURCE_PORT_A; |