The type and type2 fields were unused and so could be removed.
Instead add a vfl_type field that contains the type of the video
device.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
DEB_EE(("dev:%p\n",dev));
- if( VFL_TYPE_GRABBER == (*vid)->type ) {
+ if ((*vid)->vfl_type == VFL_TYPE_GRABBER) {
vv->video_minor = -1;
} else {
vv->vbi_minor = -1;
/* V4L2 interface */
static struct video_device dsbr100_videodev_template = {
.name = "D-Link DSB-R 100",
- .type = VID_TYPE_TUNER,
.fops = &usb_dsbr100_fops,
.ioctl_ops = &usb_dsbr100_ioctl_ops,
.release = video_device_release,
static struct video_device pcm20_radio = {
.name = "Miro PCM 20 radio",
- .type = VID_TYPE_TUNER,
.fops = &pcm20_fops,
.priv = &pcm20_unit
};
static struct video_device rtrack_radio = {
.name = "RadioTrack radio",
- .type = VID_TYPE_TUNER,
.fops = &rtrack_fops,
.ioctl_ops = &rtrack_ioctl_ops,
};
static struct video_device aztech_radio = {
.name = "Aztech radio",
- .type = VID_TYPE_TUNER,
.fops = &aztech_fops,
.ioctl_ops = &aztech_ioctl_ops,
};
static struct video_device cadet_radio = {
.name = "Cadet radio",
- .type = VID_TYPE_TUNER,
.fops = &cadet_fops,
.ioctl_ops = &cadet_ioctl_ops,
};
static struct video_device vdev_template = {
.name = "Gemtek PCI Radio",
- .type = VID_TYPE_TUNER,
.fops = &gemtek_pci_fops,
.ioctl_ops = &gemtek_pci_ioctl_ops,
};
static struct video_device gemtek_radio = {
.name = "GemTek Radio card",
- .type = VID_TYPE_TUNER,
.fops = &gemtek_fops,
.ioctl_ops = &gemtek_ioctl_ops,
};
static struct video_device maestro_radio = {
.name = "Maestro radio",
- .type = VID_TYPE_TUNER,
.fops = &maestro_fops,
.ioctl_ops = &maestro_ioctl_ops,
};
static struct video_device maxiradio_radio = {
.name = "Maxi Radio FM2000 radio",
- .type = VID_TYPE_TUNER,
.fops = &maxiradio_fops,
.ioctl_ops = &maxiradio_ioctl_ops,
};
static struct video_device rtrack2_radio = {
.name = "RadioTrack II radio",
- .type = VID_TYPE_TUNER,
.fops = &rtrack2_fops,
.ioctl_ops = &rtrack2_ioctl_ops,
};
static struct video_device fmi_radio = {
.name = "SF16FMx radio",
- .type = VID_TYPE_TUNER,
.fops = &fmi_fops,
.ioctl_ops = &fmi_ioctl_ops,
};
static struct video_device fmr2_radio = {
.name = "SF16FMR2 radio",
- .type = VID_TYPE_TUNER,
.fops = &fmr2_fops,
.ioctl_ops = &fmr2_ioctl_ops,
};
.fops = &si470x_fops,
.ioctl_ops = &si470x_ioctl_ops,
.name = DRIVER_NAME,
- .type = VID_TYPE_TUNER,
.release = video_device_release,
};
static struct video_device terratec_radio = {
.name = "TerraTec ActiveRadio",
- .type = VID_TYPE_TUNER,
.fops = &terratec_fops,
.ioctl_ops = &terratec_ioctl_ops,
};
static struct video_device trust_radio = {
.name = "Trust FM Radio",
- .type = VID_TYPE_TUNER,
.fops = &trust_fops,
.ioctl_ops = &trust_ioctl_ops,
};
static struct video_device typhoon_radio = {
.name = "Typhoon Radio",
- .type = VID_TYPE_TUNER,
.fops = &typhoon_fops,
.ioctl_ops = &typhoon_ioctl_ops,
};
static struct video_device zoltrix_radio = {
.name = "Zoltrix Radio Plus",
- .type = VID_TYPE_TUNER,
.fops = &zoltrix_fops,
.ioctl_ops = &zoltrix_ioctl_ops,
};
static struct video_device *vdev_init(struct bttv *btv,
const struct video_device *template,
- const char *type_name,
- const int type)
+ const char *type_name)
{
struct video_device *vfd;
vfd->minor = -1;
vfd->parent = &btv->c.pci->dev;
vfd->release = video_device_release;
- vfd->type = type;
vfd->debug = bttv_debug;
snprintf(vfd->name, sizeof(vfd->name), "BT%d%s %s (%s)",
btv->id, (btv->id==848 && btv->revision==0x12) ? "A" : "",
/* register video4linux devices */
static int __devinit bttv_register_video(struct bttv *btv)
{
- int video_type = VID_TYPE_CAPTURE |
- VID_TYPE_TUNER |
- VID_TYPE_CLIPPING|
- VID_TYPE_SCALES;
-
- if (no_overlay <= 0) {
- bttv_video_template.type |= VID_TYPE_OVERLAY;
- } else {
+ if (no_overlay > 0)
printk("bttv: Overlay support disabled.\n");
- }
/* video */
- btv->video_dev = vdev_init(btv, &bttv_video_template,
- "video", video_type);
+ btv->video_dev = vdev_init(btv, &bttv_video_template, "video");
if (NULL == btv->video_dev)
goto err;
}
/* vbi */
- btv->vbi_dev = vdev_init(btv, &bttv_video_template,
- "vbi", VID_TYPE_TUNER | VID_TYPE_TELETEXT);
+ btv->vbi_dev = vdev_init(btv, &bttv_video_template, "vbi");
if (NULL == btv->vbi_dev)
goto err;
if (!btv->has_radio)
return 0;
/* radio */
- btv->radio_dev = vdev_init(btv, &radio_template,
- "radio", VID_TYPE_TUNER);
+ btv->radio_dev = vdev_init(btv, &radio_template, "radio");
if (NULL == btv->radio_dev)
goto err;
if (video_register_device(btv->radio_dev, VFL_TYPE_RADIO,radio_nr)<0)
static struct video_device qcam_template=
{
.name = "Connectix Quickcam",
- .type = VID_TYPE_CAPTURE,
.fops = &qcam_fops,
};
static struct video_device qcam_template=
{
.name = "Colour QuickCam",
- .type = VID_TYPE_CAPTURE,
.fops = &qcam_fops,
};
static struct video_device cafe_v4l_template = {
.name = "cafe",
- .type = VFL_TYPE_GRABBER,
- .type2 = VID_TYPE_CAPTURE,
.minor = -1, /* Get one dynamically */
.tvnorms = V4L2_STD_NTSC_M,
.current_norm = V4L2_STD_NTSC_M, /* make mplayer happy */
static struct video_device cpia_template = {
.name = "CPiA Camera",
- .type = VID_TYPE_CAPTURE,
.fops = &cpia_fops,
};
static struct video_device cpia2_template = {
/* I could not find any place for the old .initialize initializer?? */
.name= "CPiA2 Camera",
- .type= VID_TYPE_CAPTURE,
- .type2 = V4L2_CAP_VIDEO_CAPTURE |
- V4L2_CAP_STREAMING,
.minor= -1,
.fops= &fops_template,
.release= video_device_release,
return -ENOMEM;
}
- s->v4l2dev->type =
- VID_TYPE_CAPTURE | VID_TYPE_TUNER | VID_TYPE_TELETEXT |
- VID_TYPE_CLIPPING | VID_TYPE_SCALES | VID_TYPE_MPEG_ENCODER;
snprintf(s->v4l2dev->name, sizeof(s->v4l2dev->name), "cx18-%d",
cx->num);
static struct video_device cx23885_mpeg_template = {
.name = "cx23885",
- .type = VID_TYPE_CAPTURE |
- VID_TYPE_TUNER |
- VID_TYPE_SCALES |
- VID_TYPE_MPEG_ENCODER,
.fops = &mpeg_fops,
.ioctl_ops = &mpeg_ioctl_ops,
.minor = -1,
static struct video_device cx23885_vbi_template;
static struct video_device cx23885_video_template = {
.name = "cx23885-video",
- .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_SCALES,
.fops = &video_fops,
.minor = -1,
.ioctl_ops = &video_ioctl_ops,
memcpy(&cx23885_vbi_template, &cx23885_video_template,
sizeof(cx23885_vbi_template));
strcpy(cx23885_vbi_template.name, "cx23885-vbi");
- cx23885_vbi_template.type = VID_TYPE_TELETEXT|VID_TYPE_TUNER;
dev->tvnorm = cx23885_video_template.current_norm;
static struct video_device cx8802_mpeg_template = {
.name = "cx8802",
- .type = VID_TYPE_CAPTURE | VID_TYPE_TUNER |
- VID_TYPE_SCALES | VID_TYPE_MPEG_ENCODER,
.fops = &mpeg_fops,
.ioctl_ops = &mpeg_ioctl_ops,
.minor = -1,
static struct video_device cx8800_video_template = {
.name = "cx8800-video",
- .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_SCALES,
.fops = &video_fops,
.minor = -1,
.ioctl_ops = &video_ioctl_ops,
static struct video_device cx8800_radio_template = {
.name = "cx8800-radio",
- .type = VID_TYPE_TUNER,
.fops = &radio_fops,
.minor = -1,
.ioctl_ops = &radio_ioctl_ops,
memcpy( &cx8800_vbi_template, &cx8800_video_template,
sizeof(cx8800_vbi_template) );
strcpy(cx8800_vbi_template.name,"cx8800-vbi");
- cx8800_vbi_template.type = VID_TYPE_TELETEXT|VID_TYPE_TUNER;
/* initialize driver struct */
spin_lock_init(&dev->slock);
static struct video_device em28xx_radio_template = {
.name = "em28xx-radio",
- .type = VID_TYPE_TUNER,
.fops = &radio_fops,
.ioctl_ops = &radio_ioctl_ops,
.minor = -1,
static struct video_device *em28xx_vdev_init(struct em28xx *dev,
const struct video_device *template,
- const int type,
const char *type_name)
{
struct video_device *vfd;
vfd->minor = -1;
vfd->parent = &dev->udev->dev;
vfd->release = video_device_release;
- vfd->type = type;
vfd->debug = video_debug;
snprintf(vfd->name, sizeof(vfd->name), "%s %s",
list_add_tail(&dev->devlist, &em28xx_devlist);
/* allocate and fill video video_device struct */
- dev->vdev = em28xx_vdev_init(dev, &em28xx_video_template,
- VID_TYPE_CAPTURE, "video");
+ dev->vdev = em28xx_vdev_init(dev, &em28xx_video_template, "video");
if (NULL == dev->vdev) {
em28xx_errdev("cannot allocate video_device.\n");
goto fail_unreg;
}
- if (dev->tuner_type != TUNER_ABSENT)
- dev->vdev->type |= VID_TYPE_TUNER;
/* register v4l2 video video_device */
retval = video_register_device(dev->vdev, VFL_TYPE_GRABBER,
}
/* Allocate and fill vbi video_device struct */
- dev->vbi_dev = em28xx_vdev_init(dev, &em28xx_video_template,
- VFL_TYPE_VBI, "vbi");
+ dev->vbi_dev = em28xx_vdev_init(dev, &em28xx_video_template, "vbi");
/* register v4l2 vbi video_device */
if (video_register_device(dev->vbi_dev, VFL_TYPE_VBI,
vbi_nr[dev->devno]) < 0) {
}
if (em28xx_boards[dev->model].radio.type == EM28XX_RADIO) {
- dev->radio_dev = em28xx_vdev_init(dev, &em28xx_radio_template,
- VFL_TYPE_RADIO, "radio");
+ dev->radio_dev = em28xx_vdev_init(dev, &em28xx_radio_template, "radio");
if (NULL == dev->radio_dev) {
em28xx_errdev("cannot allocate video_device.\n");
goto fail_unreg;
}
strcpy(cam->v4ldev->name, "ET61X[12]51 PC Camera");
- cam->v4ldev->type = VID_TYPE_CAPTURE | VID_TYPE_SCALES;
cam->v4ldev->fops = &et61x251_fops;
cam->v4ldev->minor = video_nr[dev_nr];
cam->v4ldev->release = video_device_release;
static struct video_device gspca_template = {
.name = "gspca main driver",
- .type = VID_TYPE_CAPTURE,
.fops = &dev_fops,
.ioctl_ops = &dev_ioctl_ops,
.release = dev_release, /* mandatory */
return -ENOMEM;
}
- s->v4l2dev->type = VID_TYPE_CAPTURE | VID_TYPE_TUNER | VID_TYPE_TELETEXT |
- VID_TYPE_CLIPPING | VID_TYPE_SCALES | VID_TYPE_MPEG_ENCODER;
- if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) {
- s->v4l2dev->type |= VID_TYPE_MPEG_DECODER;
- }
snprintf(s->v4l2dev->name, sizeof(s->v4l2dev->name), "ivtv%d %s",
itv->num, s->name);
static struct video_device meye_template = {
.name = "meye",
- .type = VID_TYPE_CAPTURE,
.fops = &meye_fops,
.ioctl_ops = &meye_ioctl_ops,
.release = video_device_release,
static struct video_device vdev_template = {
.name = "OV511 USB Camera",
- .type = VID_TYPE_CAPTURE,
.fops = &ov511_fops,
.release = video_device_release,
.minor = -1,
static struct video_device pms_template=
{
.name = "Mediavision PMS",
- .type = VID_TYPE_CAPTURE,
.fops = &pms_fops,
};
static struct video_device vdev_template = {
- .type = VID_TYPE_CAPTURE | VID_TYPE_TUNER,
- .type2 = (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VBI_CAPTURE
- | V4L2_CAP_TUNER | V4L2_CAP_AUDIO
- | V4L2_CAP_READWRITE),
.fops = &vdev_fops,
};
};
static struct video_device pwc_template = {
.name = "Philips Webcam", /* Filled in later */
- .type = VID_TYPE_CAPTURE,
.release = video_device_release,
.fops = &pwc_fops,
.minor = -1,
static struct video_device template = {
.name = "s2255v",
- .type = VID_TYPE_CAPTURE,
.fops = &s2255_fops_v4l,
.ioctl_ops = &s2255_ioctl_ops,
.minor = -1,
static struct video_device saa_template =
{
.name = IF_NAME,
- .type = VID_TYPE_TELETEXT,
.fops = &saa_fops,
.release = video_device_release,
.minor = -1,
static struct video_device saa_template =
{
.name = IF_NAME,
- .type = VID_TYPE_TELETEXT, /*| VID_TYPE_TUNER ?? */
.fops = &saa_fops,
};
v4l2_prio_init(&dev->prio);
/* register v4l devices */
- if (saa7134_no_overlay <= 0) {
- saa7134_video_template.type |= VID_TYPE_OVERLAY;
- } else {
- printk("%s: Overlay support disabled.\n",dev->name);
- }
+ if (saa7134_no_overlay > 0)
+ printk(KERN_INFO "%s: Overlay support disabled.\n", dev->name);
+
dev->video_dev = vdev_init(dev,&saa7134_video_template,"video");
err = video_register_device(dev->video_dev,VFL_TYPE_GRABBER,
video_nr[dev->nr]);
dev->name,dev->video_dev->minor & 0x1f);
dev->vbi_dev = vdev_init(dev, &saa7134_video_template, "vbi");
- dev->vbi_dev->type = VID_TYPE_TUNER | VID_TYPE_TELETEXT;
err = video_register_device(dev->vbi_dev,VFL_TYPE_VBI,
vbi_nr[dev->nr]);
static struct video_device saa7134_empress_template = {
.name = "saa7134-empress",
- .type = 0 /* FIXME */,
- .type2 = 0 /* FIXME */,
.fops = &ts_fops,
.minor = -1,
.ioctl_ops = &ts_ioctl_ops,
struct video_device saa7134_video_template = {
.name = "saa7134-video",
- .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER |
- VID_TYPE_CLIPPING|VID_TYPE_SCALES,
.fops = &video_fops,
.ioctl_ops = &video_ioctl_ops,
.minor = -1,
struct video_device saa7134_radio_template = {
.name = "saa7134-radio",
- .type = VID_TYPE_TUNER,
.fops = &radio_fops,
.ioctl_ops = &radio_ioctl_ops,
.minor = -1,
};
static struct video_device se401_template = {
.name = "se401 USB camera",
- .type = VID_TYPE_CAPTURE,
.fops = &se401_fops,
};
}
strcpy(cam->v4ldev->name, "SN9C1xx PC Camera");
- cam->v4ldev->type = VID_TYPE_CAPTURE | VID_TYPE_SCALES;
cam->v4ldev->fops = &sn9c102_fops;
cam->v4ldev->minor = video_nr[dev_nr];
cam->v4ldev->release = video_device_release;
strlcpy(vdev->name, ici->drv_name, sizeof(vdev->name));
/* Maybe better &ici->dev */
vdev->parent = &icd->dev;
- vdev->type = VID_TYPE_CAPTURE;
vdev->current_norm = V4L2_STD_UNKNOWN;
vdev->fops = &soc_camera_fops;
vdev->ioctl_ops = &soc_camera_ioctl_ops;
static struct video_device stk_v4l_data = {
.name = "stkwebcam",
- .type = VFL_TYPE_GRABBER,
- .type2 = VID_TYPE_CAPTURE,
.minor = -1,
.tvnorms = V4L2_STD_UNKNOWN,
.current_norm = V4L2_STD_UNKNOWN,
/* template for video_device-structure */
static struct video_device saa_template = {
.name = "SAA7146A",
- .type = VID_TYPE_CAPTURE | VID_TYPE_OVERLAY,
.fops = &saa_fops,
.minor = -1,
};
};
static struct video_device stv680_template = {
.name = "STV0680 USB camera",
- .type = VID_TYPE_CAPTURE,
.fops = &stv680_fops,
.release = video_device_release,
.minor = -1,
.llseek = no_llseek,
};
static const struct video_device usbvideo_template = {
- .type = VID_TYPE_CAPTURE,
.fops = &usbvideo_fops,
};
static struct video_device vicam_template = {
.name = "ViCam-based USB Camera",
- .type = VID_TYPE_CAPTURE,
.fops = &vicam_fops,
.minor = -1,
};
};
static struct video_device usbvision_video_template = {
- .type = VID_TYPE_TUNER | VID_TYPE_CAPTURE,
.fops = &usbvision_fops,
.ioctl_ops = &usbvision_ioctl_ops,
.name = "usbvision-video",
};
static struct video_device usbvision_radio_template = {
- .type = VID_TYPE_TUNER,
.fops = &usbvision_radio_fops,
.name = "usbvision-radio",
.release = video_device_release,
static struct video_device usbvision_vbi_template=
{
- .type = VID_TYPE_TUNER,
.fops = &usbvision_vbi_fops,
.release = video_device_release,
.name = "usbvision-vbi",
* get another one.
*/
vdev->parent = &dev->intf->dev;
- vdev->type = 0;
- vdev->type2 = 0;
vdev->minor = -1;
vdev->fops = &uvc_fops;
vdev->release = video_device_release;
}
}
video_device[i] = vfd;
+ vfd->vfl_type = type;
vfd->minor = i;
ret = get_index(vfd, index);
static struct video_device v4l_device_template = {
.name = "NOT SET",
- /*.type = VID_TYPE_CAPTURE | VID_TYPE_SUBCAPTURE | */
- /* VID_TYPE_CLIPPING | VID_TYPE_SCALES, VID_TYPE_OVERLAY */
.fops = &vino_fops,
.minor = -1,
};
static struct video_device vivi_template = {
.name = "vivi",
- .type = VID_TYPE_CAPTURE,
.fops = &vivi_fops,
.ioctl_ops = &vivi_ioctl_ops,
.minor = -1,
};
static struct video_device w9966_template = {
.name = W9966_DRIVERNAME,
- .type = VID_TYPE_CAPTURE | VID_TYPE_SCALES,
.fops = &w9966_fops,
};
}
strcpy(cam->v4ldev->name, symbolic(camlist, mod_id));
- cam->v4ldev->type = VID_TYPE_CAPTURE | VID_TYPE_SCALES;
cam->v4ldev->fops = &w9968cf_fops;
cam->v4ldev->minor = video_nr[dev_nr];
cam->v4ldev->release = video_device_release;
}
strcpy(cam->v4ldev->name, "ZC0301[P] PC Camera");
- cam->v4ldev->type = VID_TYPE_CAPTURE | VID_TYPE_SCALES;
cam->v4ldev->fops = &zc0301_fops;
cam->v4ldev->minor = video_nr[dev_nr];
cam->v4ldev->release = video_device_release;
struct video_device zoran_template __devinitdata = {
.name = ZORAN_NAME,
- .type = ZORAN_VID_TYPE,
- .type2 = ZORAN_V4L2_VID_FLAGS,
.fops = &zoran_fops,
.release = &zoran_vdev_release,
.minor = -1
static struct video_device zr364xx_template = {
.name = DRIVER_DESC,
- .type = VID_TYPE_CAPTURE,
.fops = &zr364xx_fops,
.ioctl_ops = &zr364xx_ioctl_ops,
.release = video_device_release,
/* device info */
char name[32];
- int type; /* v4l1 */
- int type2; /* v4l2 */
+ int vfl_type;
int minor;
/* attribute to diferentiate multiple indexs on one physical device */
int index;
memset(&tea->vd, 0, sizeof(tea->vd));
strcpy(tea->vd.name, tea->tea5759 ? "TEA5759 radio" : "TEA5757 radio");
- tea->vd.type = VID_TYPE_TUNER;
tea->vd.release = snd_tea575x_release;
video_set_drvdata(&tea->vd, tea);
tea->vd.fops = &tea->fops;