]> err.no Git - linux-2.6/blobdiff - drivers/media/radio/radio-rtrack2.c
V4L/DVB (7729): Fix VIDIOCGAP corruption in ivtv
[linux-2.6] / drivers / media / radio / radio-rtrack2.c
index 4239a7f3f7e54844ebc049abdec20671da61af74..070802103dc34d52176b87fa78c43511f2ce3798 100644 (file)
@@ -249,6 +249,38 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
        return -EINVAL;
 }
 
+static int vidioc_g_audio(struct file *file, void *priv,
+                               struct v4l2_audio *a)
+{
+       if (a->index > 1)
+               return -EINVAL;
+
+       strcpy(a->name, "Radio");
+       a->capability = V4L2_AUDCAP_STEREO;
+       return 0;
+}
+
+static int vidioc_g_input(struct file *filp, void *priv, unsigned int *i)
+{
+       *i = 0;
+       return 0;
+}
+
+static int vidioc_s_input(struct file *filp, void *priv, unsigned int i)
+{
+       if (i != 0)
+               return -EINVAL;
+       return 0;
+}
+
+static int vidioc_s_audio(struct file *file, void *priv,
+                               struct v4l2_audio *a)
+{
+       if (a->index != 0)
+               return -EINVAL;
+       return 0;
+}
+
 static struct rt_device rtrack2_unit;
 
 static const struct file_operations rtrack2_fops = {
@@ -256,7 +288,9 @@ static const struct file_operations rtrack2_fops = {
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
        .ioctl          = video_ioctl2,
+#ifdef CONFIG_COMPAT
        .compat_ioctl   = v4l_compat_ioctl32,
+#endif
        .llseek         = no_llseek,
 };
 
@@ -265,7 +299,6 @@ static struct video_device rtrack2_radio=
        .owner          = THIS_MODULE,
        .name           = "RadioTrack II radio",
        .type           = VID_TYPE_TUNER,
-       .hardware       = 0,
        .fops           = &rtrack2_fops,
        .vidioc_querycap    = vidioc_querycap,
        .vidioc_g_tuner     = vidioc_g_tuner,
@@ -275,6 +308,10 @@ static struct video_device rtrack2_radio=
        .vidioc_queryctrl   = vidioc_queryctrl,
        .vidioc_g_ctrl      = vidioc_g_ctrl,
        .vidioc_s_ctrl      = vidioc_s_ctrl,
+       .vidioc_g_audio     = vidioc_g_audio,
+       .vidioc_s_audio     = vidioc_s_audio,
+       .vidioc_g_input     = vidioc_g_input,
+       .vidioc_s_input     = vidioc_s_input,
 };
 
 static int __init rtrack2_init(void)