forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/media/pci/solo6x10/solo6x10-v4l2.c
....@@ -1,21 +1,12 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
2
- * Copyright (C) 2010-2013 Bluecherry, LLC <http://www.bluecherrydvr.com>
3
+ * Copyright (C) 2010-2013 Bluecherry, LLC <https://www.bluecherrydvr.com>
34 *
45 * Original author:
56 * Ben Collins <bcollins@ubuntu.com>
67 *
78 * Additional work by:
89 * John Brooks <john.brooks@bluecherry.net>
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or
13
- * (at your option) any later version.
14
- *
15
- * This program is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU General Public License for more details.
1910 */
2011
2112 #include <linux/kernel.h>
....@@ -383,13 +374,10 @@
383374 {
384375 struct solo_dev *solo_dev = video_drvdata(file);
385376
386
- strcpy(cap->driver, SOLO6X10_NAME);
387
- strcpy(cap->card, "Softlogic 6x10");
377
+ strscpy(cap->driver, SOLO6X10_NAME, sizeof(cap->driver));
378
+ strscpy(cap->card, "Softlogic 6x10", sizeof(cap->card));
388379 snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s",
389380 pci_name(solo_dev->pdev));
390
- cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
391
- V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
392
- cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
393381 return 0;
394382 }
395383
....@@ -470,8 +458,6 @@
470458 return -EINVAL;
471459
472460 f->pixelformat = V4L2_PIX_FMT_UYVY;
473
- strlcpy(f->description, "UYUV 4:2:2 Packed", sizeof(f->description));
474
-
475461 return 0;
476462 }
477463
....@@ -491,7 +477,6 @@
491477 pix->field = V4L2_FIELD_INTERLACED;
492478 pix->pixelformat = V4L2_PIX_FMT_UYVY;
493479 pix->colorspace = V4L2_COLORSPACE_SMPTE170M;
494
- pix->priv = 0;
495480 return 0;
496481 }
497482
....@@ -521,7 +506,6 @@
521506 pix->sizeimage = solo_image_size(solo_dev);
522507 pix->colorspace = V4L2_COLORSPACE_SMPTE170M;
523508 pix->bytesperline = solo_bytesperline(solo_dev);
524
- pix->priv = 0;
525509
526510 return 0;
527511 }
....@@ -637,6 +621,8 @@
637621 .minor = -1,
638622 .release = video_device_release,
639623 .tvnorms = V4L2_STD_NTSC_M | V4L2_STD_PAL,
624
+ .device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
625
+ V4L2_CAP_STREAMING,
640626 };
641627
642628 static const struct v4l2_ctrl_ops solo_ctrl_ops = {
....@@ -706,7 +692,7 @@
706692 while (erase_off(solo_dev))
707693 /* Do nothing */;
708694
709
- ret = video_register_device(solo_dev->vfd, VFL_TYPE_GRABBER, nr);
695
+ ret = video_register_device(solo_dev->vfd, VFL_TYPE_VIDEO, nr);
710696 if (ret < 0)
711697 goto fail;
712698