The default videodev behavior for VIDIOC_G_STD is not correct for all devices.
Add a new callback that drivers can use instead.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
        {
                v4l2_std_id *id = arg;
 
-               *id = vfd->current_norm;
-
-               dbgarg (cmd, "value=%08Lx\n", (long long unsigned) *id);
+               ret = 0;
+               /* Calls the specific handler */
+               if (vfd->vidioc_g_std)
+                       ret = vfd->vidioc_g_std(file, fh, id);
+               else
+                       *id = vfd->current_norm;
 
-               ret=0;
+               if (!ret)
+                       dbgarg(cmd, "value=%08Lx\n", (long long unsigned)*id);
                break;
        }
        case VIDIOC_S_STD:
 
        int (*vidioc_streamoff)(struct file *file, void *fh, enum v4l2_buf_type i);
 
                /* Standard handling
-                       G_STD and ENUMSTD are handled by videodev.c
+                       ENUMSTD is handled by videodev.c
                 */
+       int (*vidioc_g_std) (struct file *file, void *fh, v4l2_std_id *norm);
        int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id *norm);
        int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a);