]> err.no Git - linux-2.6/blobdiff - drivers/media/radio/radio-rtrack2.c
V4L/DVB (8493): mt20xx: test below 0 on unsigned lo1a and lo2a
[linux-2.6] / drivers / media / radio / radio-rtrack2.c
index 4239a7f3f7e54844ebc049abdec20671da61af74..e065cb16dc5a3d44b7b574dd5dc2a269821c934e 100644 (file)
@@ -17,6 +17,7 @@
 #include <asm/uaccess.h>       /* copy to/from user            */
 #include <linux/videodev2.h>   /* kernel radio structs         */
 #include <media/v4l2-common.h>
+#include <media/v4l2-ioctl.h>
 #include <linux/spinlock.h>
 
 #include <linux/version.h>      /* for KERNEL_VERSION MACRO     */
@@ -249,6 +250,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,17 +289,13 @@ 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,
 };
 
-static struct video_device rtrack2_radio=
-{
-       .owner          = THIS_MODULE,
-       .name           = "RadioTrack II radio",
-       .type           = VID_TYPE_TUNER,
-       .hardware       = 0,
-       .fops           = &rtrack2_fops,
+static const struct v4l2_ioctl_ops rtrack2_ioctl_ops = {
        .vidioc_querycap    = vidioc_querycap,
        .vidioc_g_tuner     = vidioc_g_tuner,
        .vidioc_s_tuner     = vidioc_s_tuner,
@@ -275,6 +304,17 @@ 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 struct video_device rtrack2_radio = {
+       .name           = "RadioTrack II radio",
+       .type           = VID_TYPE_TUNER,
+       .fops           = &rtrack2_fops,
+       .ioctl_ops      = &rtrack2_ioctl_ops,
 };
 
 static int __init rtrack2_init(void)