Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-flexiantxendom0-3.2.10.git] / drivers / media / video / v4l2-subdev.c
index 6521cf8..65ade5f 100644 (file)
@@ -174,6 +174,25 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 
        case VIDIOC_UNSUBSCRIBE_EVENT:
                return v4l2_subdev_call(sd, core, unsubscribe_event, vfh, arg);
+
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+       case VIDIOC_DBG_G_REGISTER:
+       {
+               struct v4l2_dbg_register *p = arg;
+
+               if (!capable(CAP_SYS_ADMIN))
+                       return -EPERM;
+               return v4l2_subdev_call(sd, core, g_register, p);
+       }
+       case VIDIOC_DBG_S_REGISTER:
+       {
+               struct v4l2_dbg_register *p = arg;
+
+               if (!capable(CAP_SYS_ADMIN))
+                       return -EPERM;
+               return v4l2_subdev_call(sd, core, s_register, p);
+       }
+#endif
 #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
        case VIDIOC_SUBDEV_G_FMT: {
                struct v4l2_subdev_format *format = arg;