Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7cc70986 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Revert "media: rename VFL_TYPE_GRABBER to _VIDEO"



This reverts commit fa83fca5 which is
commit 238e4a5baa361256ae1641ad9455bb2bb359273f upstream.

It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.

Bug: 161946584
Change-Id: Ic404ca639db1ad734323929e0f000b3ee6bb5f1d
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent b8c488bb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ This will create the character device for you.

.. code-block:: c

	err = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
	err = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
	if (err) {
		video_device_release(vdev); /* or kfree(my_vdev); */
		return err;
@@ -201,7 +201,7 @@ types exist:
========================== ====================	 ==============================
:c:type:`vfl_devnode_type` Device name		 Usage
========================== ====================	 ==============================
``VFL_TYPE_VIDEO``         ``/dev/videoX``       for video input/output devices
``VFL_TYPE_GRABBER``       ``/dev/videoX``       for video input/output devices
``VFL_TYPE_VBI``           ``/dev/vbiX``         for vertical blank data (i.e.
						 closed captions, teletext)
``VFL_TYPE_RADIO``         ``/dev/radioX``       for radio tuners
+2 −2
Original line number Diff line number Diff line
@@ -649,7 +649,7 @@ video_device注册

接下来你需要注册视频设备:这会为你创建一个字符设备。

	err = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
	err = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
	if (err) {
		video_device_release(vdev); /* or kfree(my_vdev); */
		return err;
@@ -660,7 +660,7 @@ video_device注册

注册哪种设备是根据类型(type)参数。存在以下类型:

VFL_TYPE_VIDEO: 用于视频输入/输出设备的 videoX
VFL_TYPE_GRABBER: 用于视频输入/输出设备的 videoX
VFL_TYPE_VBI: 用于垂直消隐数据的 vbiX (例如,隐藏式字幕,图文电视)
VFL_TYPE_RADIO: 用于广播调谐器的 radioX

+5 −5
Original line number Diff line number Diff line
@@ -542,13 +542,13 @@ static void determine_valid_ioctls(struct video_device *vdev)
			      V4L2_CAP_META_OUTPUT;
	DECLARE_BITMAP(valid_ioctls, BASE_VIDIOC_PRIVATE);
	const struct v4l2_ioctl_ops *ops = vdev->ioctl_ops;
	bool is_vid = vdev->vfl_type == VFL_TYPE_VIDEO &&
	bool is_vid = vdev->vfl_type == VFL_TYPE_GRABBER &&
		      (vdev->device_caps & vid_caps);
	bool is_vbi = vdev->vfl_type == VFL_TYPE_VBI;
	bool is_radio = vdev->vfl_type == VFL_TYPE_RADIO;
	bool is_sdr = vdev->vfl_type == VFL_TYPE_SDR;
	bool is_tch = vdev->vfl_type == VFL_TYPE_TOUCH;
	bool is_meta = vdev->vfl_type == VFL_TYPE_VIDEO &&
	bool is_meta = vdev->vfl_type == VFL_TYPE_GRABBER &&
		       (vdev->device_caps & meta_caps);
	bool is_rx = vdev->vfl_dir != VFL_DIR_TX;
	bool is_tx = vdev->vfl_dir != VFL_DIR_RX;
@@ -777,7 +777,7 @@ static int video_register_media_controller(struct video_device *vdev)
	vdev->entity.function = MEDIA_ENT_F_UNKNOWN;

	switch (vdev->vfl_type) {
	case VFL_TYPE_VIDEO:
	case VFL_TYPE_GRABBER:
		intf_type = MEDIA_INTF_T_V4L_VIDEO;
		vdev->entity.function = MEDIA_ENT_F_IO_V4L;
		break;
@@ -885,7 +885,7 @@ int __video_register_device(struct video_device *vdev,

	/* Part 1: check device type */
	switch (type) {
	case VFL_TYPE_VIDEO:
	case VFL_TYPE_GRABBER:
		name_base = "video";
		break;
	case VFL_TYPE_VBI:
@@ -929,7 +929,7 @@ int __video_register_device(struct video_device *vdev,
	 * of 128-191 and just pick the first free minor there
	 * (new style). */
	switch (type) {
	case VFL_TYPE_VIDEO:
	case VFL_TYPE_GRABBER:
		minor_offset = 0;
		minor_cnt = 64;
		break;
+2 −2
Original line number Diff line number Diff line
@@ -959,12 +959,12 @@ static int check_fmt(struct file *file, enum v4l2_buf_type type)
			      V4L2_CAP_META_OUTPUT;
	struct video_device *vfd = video_devdata(file);
	const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops;
	bool is_vid = vfd->vfl_type == VFL_TYPE_VIDEO &&
	bool is_vid = vfd->vfl_type == VFL_TYPE_GRABBER &&
		      (vfd->device_caps & vid_caps);
	bool is_vbi = vfd->vfl_type == VFL_TYPE_VBI;
	bool is_sdr = vfd->vfl_type == VFL_TYPE_SDR;
	bool is_tch = vfd->vfl_type == VFL_TYPE_TOUCH;
	bool is_meta = vfd->vfl_type == VFL_TYPE_VIDEO &&
	bool is_meta = vfd->vfl_type == VFL_TYPE_GRABBER &&
		       (vfd->device_caps & meta_caps);
	bool is_rx = vfd->vfl_dir != VFL_DIR_TX;
	bool is_tx = vfd->vfl_dir != VFL_DIR_RX;
+2 −4
Original line number Diff line number Diff line
@@ -24,8 +24,7 @@
/**
 * enum vfl_devnode_type - type of V4L2 device node
 *
 * @VFL_TYPE_VIDEO:	for video input/output devices
 * @VFL_TYPE_GRABBER:	deprecated, same as VFL_TYPE_VIDEO
 * @VFL_TYPE_GRABBER:	for video input/output devices
 * @VFL_TYPE_VBI:	for vertical blank data (i.e. closed captions, teletext)
 * @VFL_TYPE_RADIO:	for radio tuners
 * @VFL_TYPE_SUBDEV:	for V4L2 subdevices
@@ -34,8 +33,7 @@
 * @VFL_TYPE_MAX:	number of VFL types, must always be last in the enum
 */
enum vfl_devnode_type {
	VFL_TYPE_VIDEO,
	VFL_TYPE_GRABBER = VFL_TYPE_VIDEO,
	VFL_TYPE_GRABBER	= 0,
	VFL_TYPE_VBI,
	VFL_TYPE_RADIO,
	VFL_TYPE_SUBDEV,
Loading