Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: staging/intel-ipu3: Make use of V4L2_CAP_IO_MC

Set the V4L2_CAP_IO_MC capability flag and remove the driver specific
vidioc_enum_{input,output}, vidioc_g_{input,output} and
vidioc_s_{input,output} callbacks.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Niklas Söderlund and committed by
Mauro Carvalho Chehab
148dd206 d5f74a1e

+7 -57
+7 -57
drivers/staging/media/ipu3/ipu3-v4l2.c
··· 605 605 { 606 606 unsigned int i, j; 607 607 608 + if (f->mbus_code != 0 && f->mbus_code != MEDIA_BUS_FMT_FIXED) 609 + return -EINVAL; 610 + 608 611 for (i = j = 0; i < ARRAY_SIZE(formats); ++i) { 609 612 if (formats[i].type == type) { 610 613 if (j == f->index) ··· 837 834 if (fmt->index > 0 || fmt->type != node->vbq.type) 838 835 return -EINVAL; 839 836 837 + if (fmt->mbus_code != 0 && fmt->mbus_code != MEDIA_BUS_FMT_FIXED) 838 + return -EINVAL; 839 + 840 840 strscpy(fmt->description, meta_fmts[i].name, sizeof(fmt->description)); 841 841 fmt->pixelformat = meta_fmts[i].fourcc; 842 842 ··· 857 851 f->fmt = node->vdev_fmt.fmt; 858 852 859 853 return 0; 860 - } 861 - 862 - static int imgu_vidioc_enum_input(struct file *file, void *fh, 863 - struct v4l2_input *input) 864 - { 865 - if (input->index > 0) 866 - return -EINVAL; 867 - strscpy(input->name, "camera", sizeof(input->name)); 868 - input->type = V4L2_INPUT_TYPE_CAMERA; 869 - 870 - return 0; 871 - } 872 - 873 - static int imgu_vidioc_g_input(struct file *file, void *fh, unsigned int *input) 874 - { 875 - *input = 0; 876 - 877 - return 0; 878 - } 879 - 880 - static int imgu_vidioc_s_input(struct file *file, void *fh, unsigned int input) 881 - { 882 - return input == 0 ? 0 : -EINVAL; 883 - } 884 - 885 - static int imgu_vidioc_enum_output(struct file *file, void *fh, 886 - struct v4l2_output *output) 887 - { 888 - if (output->index > 0) 889 - return -EINVAL; 890 - strscpy(output->name, "camera", sizeof(output->name)); 891 - output->type = V4L2_INPUT_TYPE_CAMERA; 892 - 893 - return 0; 894 - } 895 - 896 - static int imgu_vidioc_g_output(struct file *file, void *fh, 897 - unsigned int *output) 898 - { 899 - *output = 0; 900 - 901 - return 0; 902 - } 903 - 904 - static int imgu_vidioc_s_output(struct file *file, void *fh, 905 - unsigned int output) 906 - { 907 - return output == 0 ? 0 : -EINVAL; 908 854 } 909 855 910 856 /******************** function pointers ********************/ ··· 930 972 .vidioc_g_fmt_vid_out_mplane = imgu_vidioc_g_fmt, 931 973 .vidioc_s_fmt_vid_out_mplane = imgu_vidioc_s_fmt, 932 974 .vidioc_try_fmt_vid_out_mplane = imgu_vidioc_try_fmt, 933 - 934 - .vidioc_enum_output = imgu_vidioc_enum_output, 935 - .vidioc_g_output = imgu_vidioc_g_output, 936 - .vidioc_s_output = imgu_vidioc_s_output, 937 - 938 - .vidioc_enum_input = imgu_vidioc_enum_input, 939 - .vidioc_g_input = imgu_vidioc_g_input, 940 - .vidioc_s_input = imgu_vidioc_s_input, 941 975 942 976 /* buffer queue management */ 943 977 .vidioc_reqbufs = vb2_ioctl_reqbufs, ··· 1044 1094 vdev->ioctl_ops = &imgu_v4l2_ioctl_ops; 1045 1095 } 1046 1096 1047 - vdev->device_caps = V4L2_CAP_STREAMING | cap; 1097 + vdev->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_IO_MC | cap; 1048 1098 } 1049 1099 1050 1100 static int imgu_v4l2_subdev_register(struct imgu_device *imgu,