forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/media/pci/cx18/cx18-streams.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * cx18 init/start/stop/exit stream functions
34 *
....@@ -5,16 +6,6 @@
56 *
67 * Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl>
78 * Copyright (C) 2008 Andy Walls <awalls@md.metrocast.net>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
189 */
1910
2011 #include "cx18-driver.h"
....@@ -57,19 +48,19 @@
5748 } cx18_stream_info[] = {
5849 { /* CX18_ENC_STREAM_TYPE_MPG */
5950 "encoder MPEG",
60
- VFL_TYPE_GRABBER, 0,
51
+ VFL_TYPE_VIDEO, 0,
6152 PCI_DMA_FROMDEVICE,
6253 V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
6354 V4L2_CAP_AUDIO | V4L2_CAP_TUNER
6455 },
6556 { /* CX18_ENC_STREAM_TYPE_TS */
6657 "TS",
67
- VFL_TYPE_GRABBER, -1,
58
+ VFL_TYPE_VIDEO, -1,
6859 PCI_DMA_FROMDEVICE,
6960 },
7061 { /* CX18_ENC_STREAM_TYPE_YUV */
7162 "encoder YUV",
72
- VFL_TYPE_GRABBER, CX18_V4L2_ENC_YUV_OFFSET,
63
+ VFL_TYPE_VIDEO, CX18_V4L2_ENC_YUV_OFFSET,
7364 PCI_DMA_FROMDEVICE,
7465 V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
7566 V4L2_CAP_STREAMING | V4L2_CAP_AUDIO | V4L2_CAP_TUNER
....@@ -83,13 +74,13 @@
8374 },
8475 { /* CX18_ENC_STREAM_TYPE_PCM */
8576 "encoder PCM audio",
86
- VFL_TYPE_GRABBER, CX18_V4L2_ENC_PCM_OFFSET,
77
+ VFL_TYPE_VIDEO, CX18_V4L2_ENC_PCM_OFFSET,
8778 PCI_DMA_FROMDEVICE,
8879 V4L2_CAP_TUNER | V4L2_CAP_AUDIO | V4L2_CAP_READWRITE,
8980 },
9081 { /* CX18_ENC_STREAM_TYPE_IDX */
9182 "encoder IDX",
92
- VFL_TYPE_GRABBER, -1,
83
+ VFL_TYPE_VIDEO, -1,
9384 PCI_DMA_FROMDEVICE,
9485 },
9586 { /* CX18_ENC_STREAM_TYPE_RAD */
....@@ -420,6 +411,7 @@
420411 return 0;
421412
422413 num = s->video_dev.num;
414
+ s->video_dev.device_caps = s->v4l2_dev_caps; /* device capabilities */
423415 /* card number + user defined offset + device offset */
424416 if (type != CX18_ENC_STREAM_TYPE_MPG) {
425417 struct cx18_stream *s_mpg = &cx->streams[CX18_ENC_STREAM_TYPE_MPG];
....@@ -442,7 +434,7 @@
442434 name = video_device_node_name(&s->video_dev);
443435
444436 switch (vfl_type) {
445
- case VFL_TYPE_GRABBER:
437
+ case VFL_TYPE_VIDEO:
446438 CX18_INFO("Registered device %s for %s (%d x %d.%02d kB)\n",
447439 name, s->name, cx->stream_buffers[type],
448440 cx->stream_buf_size[type] / 1024,
....@@ -853,7 +845,7 @@
853845
854846 /*
855847 * Audio related reset according to
856
- * Documentation/media/v4l-drivers/cx2341x.rst
848
+ * Documentation/driver-api/media/drivers/cx2341x-devel.rst
857849 */
858850 if (atomic_read(&cx->ana_capturing) == 0)
859851 cx18_vapi(cx, CX18_CPU_SET_MISC_PARAMETERS, 2,
....@@ -861,7 +853,7 @@
861853
862854 /*
863855 * Number of lines for Field 1 & Field 2 according to
864
- * Documentation/media/v4l-drivers/cx2341x.rst
856
+ * Documentation/driver-api/media/drivers/cx2341x-devel.rst
865857 * Field 1 is 312 for 625 line systems in BT.656
866858 * Field 2 is 313 for 625 line systems in BT.656
867859 */