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

media: rename VFL_TYPE_GRABBER to _VIDEO

We currently have the following devnode types:

enum vfl_devnode_type {
VFL_TYPE_GRABBER = 0,
VFL_TYPE_VBI,
VFL_TYPE_RADIO,
VFL_TYPE_SUBDEV,
VFL_TYPE_SDR,
VFL_TYPE_TOUCH,
VFL_TYPE_MAX /* Shall be the last one */
};

They all make sense, except for the first: GRABBER really refers to /dev/videoX
devices, which can be capture, output or m2m, so 'grabber' doesn't even refer to
their function anymore.

Let's call a spade a spade and rename this to VFL_TYPE_VIDEO.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
238e4a5b cc62c747

+16 -14
+2 -2
Documentation/media/kapi/v4l2-dev.rst
··· 185 185 186 186 .. code-block:: c 187 187 188 - err = video_register_device(vdev, VFL_TYPE_GRABBER, -1); 188 + err = video_register_device(vdev, VFL_TYPE_VIDEO, -1); 189 189 if (err) { 190 190 video_device_release(vdev); /* or kfree(my_vdev); */ 191 191 return err; ··· 201 201 ========================== ==================== ============================== 202 202 :c:type:`vfl_devnode_type` Device name Usage 203 203 ========================== ==================== ============================== 204 - ``VFL_TYPE_GRABBER`` ``/dev/videoX`` for video input/output devices 204 + ``VFL_TYPE_VIDEO`` ``/dev/videoX`` for video input/output devices 205 205 ``VFL_TYPE_VBI`` ``/dev/vbiX`` for vertical blank data (i.e. 206 206 closed captions, teletext) 207 207 ``VFL_TYPE_RADIO`` ``/dev/radioX`` for radio tuners
+2 -2
Documentation/translations/zh_CN/video4linux/v4l2-framework.txt
··· 649 649 650 650 接下来你需要注册视频设备:这会为你创建一个字符设备。 651 651 652 - err = video_register_device(vdev, VFL_TYPE_GRABBER, -1); 652 + err = video_register_device(vdev, VFL_TYPE_VIDEO, -1); 653 653 if (err) { 654 654 video_device_release(vdev); /* or kfree(my_vdev); */ 655 655 return err; ··· 660 660 661 661 注册哪种设备是根据类型(type)参数。存在以下类型: 662 662 663 - VFL_TYPE_GRABBER: 用于视频输入/输出设备的 videoX 663 + VFL_TYPE_VIDEO: 用于视频输入/输出设备的 videoX 664 664 VFL_TYPE_VBI: 用于垂直消隐数据的 vbiX (例如,隐藏式字幕,图文电视) 665 665 VFL_TYPE_RADIO: 用于广播调谐器的 radioX 666 666
+5 -5
drivers/media/v4l2-core/v4l2-dev.c
··· 542 542 V4L2_CAP_META_OUTPUT; 543 543 DECLARE_BITMAP(valid_ioctls, BASE_VIDIOC_PRIVATE); 544 544 const struct v4l2_ioctl_ops *ops = vdev->ioctl_ops; 545 - bool is_vid = vdev->vfl_type == VFL_TYPE_GRABBER && 545 + bool is_vid = vdev->vfl_type == VFL_TYPE_VIDEO && 546 546 (vdev->device_caps & vid_caps); 547 547 bool is_vbi = vdev->vfl_type == VFL_TYPE_VBI; 548 548 bool is_radio = vdev->vfl_type == VFL_TYPE_RADIO; 549 549 bool is_sdr = vdev->vfl_type == VFL_TYPE_SDR; 550 550 bool is_tch = vdev->vfl_type == VFL_TYPE_TOUCH; 551 - bool is_meta = vdev->vfl_type == VFL_TYPE_GRABBER && 551 + bool is_meta = vdev->vfl_type == VFL_TYPE_VIDEO && 552 552 (vdev->device_caps & meta_caps); 553 553 bool is_rx = vdev->vfl_dir != VFL_DIR_TX; 554 554 bool is_tx = vdev->vfl_dir != VFL_DIR_RX; ··· 783 783 vdev->entity.function = MEDIA_ENT_F_UNKNOWN; 784 784 785 785 switch (vdev->vfl_type) { 786 - case VFL_TYPE_GRABBER: 786 + case VFL_TYPE_VIDEO: 787 787 intf_type = MEDIA_INTF_T_V4L_VIDEO; 788 788 vdev->entity.function = MEDIA_ENT_F_IO_V4L; 789 789 break; ··· 891 891 892 892 /* Part 1: check device type */ 893 893 switch (type) { 894 - case VFL_TYPE_GRABBER: 894 + case VFL_TYPE_VIDEO: 895 895 name_base = "video"; 896 896 break; 897 897 case VFL_TYPE_VBI: ··· 935 935 * of 128-191 and just pick the first free minor there 936 936 * (new style). */ 937 937 switch (type) { 938 - case VFL_TYPE_GRABBER: 938 + case VFL_TYPE_VIDEO: 939 939 minor_offset = 0; 940 940 minor_cnt = 64; 941 941 break;
+2 -2
drivers/media/v4l2-core/v4l2-ioctl.c
··· 941 941 V4L2_CAP_META_OUTPUT; 942 942 struct video_device *vfd = video_devdata(file); 943 943 const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops; 944 - bool is_vid = vfd->vfl_type == VFL_TYPE_GRABBER && 944 + bool is_vid = vfd->vfl_type == VFL_TYPE_VIDEO && 945 945 (vfd->device_caps & vid_caps); 946 946 bool is_vbi = vfd->vfl_type == VFL_TYPE_VBI; 947 947 bool is_sdr = vfd->vfl_type == VFL_TYPE_SDR; 948 948 bool is_tch = vfd->vfl_type == VFL_TYPE_TOUCH; 949 - bool is_meta = vfd->vfl_type == VFL_TYPE_GRABBER && 949 + bool is_meta = vfd->vfl_type == VFL_TYPE_VIDEO && 950 950 (vfd->device_caps & meta_caps); 951 951 bool is_rx = vfd->vfl_dir != VFL_DIR_TX; 952 952 bool is_tx = vfd->vfl_dir != VFL_DIR_RX;
+4 -2
include/media/v4l2-dev.h
··· 24 24 /** 25 25 * enum vfl_devnode_type - type of V4L2 device node 26 26 * 27 - * @VFL_TYPE_GRABBER: for video input/output devices 27 + * @VFL_TYPE_VIDEO: for video input/output devices 28 + * @VFL_TYPE_GRABBER: deprecated, same as VFL_TYPE_VIDEO 28 29 * @VFL_TYPE_VBI: for vertical blank data (i.e. closed captions, teletext) 29 30 * @VFL_TYPE_RADIO: for radio tuners 30 31 * @VFL_TYPE_SUBDEV: for V4L2 subdevices ··· 34 33 * @VFL_TYPE_MAX: number of VFL types, must always be last in the enum 35 34 */ 36 35 enum vfl_devnode_type { 37 - VFL_TYPE_GRABBER = 0, 36 + VFL_TYPE_VIDEO, 37 + VFL_TYPE_GRABBER = VFL_TYPE_VIDEO, 38 38 VFL_TYPE_VBI, 39 39 VFL_TYPE_RADIO, 40 40 VFL_TYPE_SUBDEV,
+1 -1
samples/v4l/v4l2-pci-skeleton.c
··· 879 879 vdev->tvnorms = SKEL_TVNORMS; 880 880 video_set_drvdata(vdev, skel); 881 881 882 - ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1); 882 + ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1); 883 883 if (ret) 884 884 goto free_hdl; 885 885