forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/media/pci/cx88/cx88-blackbird.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Support for a cx23416 mpeg encoder via cx2388x host port.
34 * "blackbird" reference design.
....@@ -9,16 +10,6 @@
910 * - video_ioctl2 conversion
1011 *
1112 * Includes parts from the ivtv driver <http://sourceforge.net/projects/ivtv/>
12
- *
13
- * This program is free software; you can redistribute it and/or modify
14
- * it under the terms of the GNU General Public License as published by
15
- * the Free Software Foundation; either version 2 of the License, or
16
- * (at your option) any later version.
17
- *
18
- * This program is distributed in the hope that it will be useful,
19
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- * GNU General Public License for more details.
2213 */
2314
2415 #include "cx88.h"
....@@ -37,7 +28,7 @@
3728
3829 MODULE_DESCRIPTION("driver for cx2388x/cx23416 based mpeg encoder cards");
3930 MODULE_AUTHOR("Jelle Foks <jelle@foks.us>, Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
40
-MODULE_LICENSE("GPL");
31
+MODULE_LICENSE("GPL v2");
4132 MODULE_VERSION(CX88_VERSION);
4233
4334 static unsigned int debug;
....@@ -803,7 +794,7 @@
803794 struct cx8802_dev *dev = video_drvdata(file);
804795 struct cx88_core *core = dev->core;
805796
806
- strcpy(cap->driver, "cx88_blackbird");
797
+ strscpy(cap->driver, "cx88_blackbird", sizeof(cap->driver));
807798 sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));
808799 return cx88_querycap(file, core, cap);
809800 }
....@@ -814,9 +805,7 @@
814805 if (f->index != 0)
815806 return -EINVAL;
816807
817
- strlcpy(f->description, "MPEG", sizeof(f->description));
818808 f->pixelformat = V4L2_PIX_FMT_MPEG;
819
- f->flags = V4L2_FMT_FLAG_COMPRESSED;
820809 return 0;
821810 }
822811
....@@ -995,7 +984,7 @@
995984 if (t->index != 0)
996985 return -EINVAL;
997986
998
- strcpy(t->name, "Television");
987
+ strscpy(t->name, "Television", sizeof(t->name));
999988 t->capability = V4L2_TUNER_CAP_NORM;
1000989 t->rangehigh = 0xffffffffUL;
1001990 call_all(core, tuner, g_tuner, t);
....@@ -1145,7 +1134,11 @@
11451134 dev->mpeg_dev.ctrl_handler = &dev->cxhdl.hdl;
11461135 video_set_drvdata(&dev->mpeg_dev, dev);
11471136 dev->mpeg_dev.queue = &dev->vb2_mpegq;
1148
- err = video_register_device(&dev->mpeg_dev, VFL_TYPE_GRABBER, -1);
1137
+ dev->mpeg_dev.device_caps = V4L2_CAP_READWRITE | V4L2_CAP_STREAMING |
1138
+ V4L2_CAP_VIDEO_CAPTURE;
1139
+ if (dev->core->board.tuner_type != UNSET)
1140
+ dev->mpeg_dev.device_caps |= V4L2_CAP_TUNER;
1141
+ err = video_register_device(&dev->mpeg_dev, VFL_TYPE_VIDEO, -1);
11491142 if (err < 0) {
11501143 pr_info("can't register mpeg device\n");
11511144 return err;
....@@ -1183,7 +1176,7 @@
11831176 err = cx2341x_handler_init(&dev->cxhdl, 36);
11841177 if (err)
11851178 goto fail_core;
1186
- v4l2_ctrl_add_handler(&dev->cxhdl.hdl, &core->video_hdl, NULL);
1179
+ v4l2_ctrl_add_handler(&dev->cxhdl.hdl, &core->video_hdl, NULL, false);
11871180
11881181 /* blackbird stuff */
11891182 pr_info("cx23416 based mpeg encoder (blackbird reference design)\n");