forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/media/platform/exynos4-is/fimc-isp-video.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Samsung EXYNOS4x12 FIMC-IS (Imaging Subsystem) driver
34 *
....@@ -8,10 +9,6 @@
89 *
910 * The hardware handling code derived from a driver written by
1011 * Younghwan Joo <yhwan.joo@samsung.com>.
11
- *
12
- * This program is free software; you can redistribute it and/or modify
13
- * it under the terms of the GNU General Public License version 2 as
14
- * published by the Free Software Foundation.
1512 */
1613
1714 #include <linux/bitops.h>
....@@ -278,7 +275,7 @@
278275 if (ret < 0)
279276 goto unlock;
280277
281
- ret = pm_runtime_get_sync(&isp->pdev->dev);
278
+ ret = pm_runtime_resume_and_get(&isp->pdev->dev);
282279 if (ret < 0)
283280 goto rel_fh;
284281
....@@ -352,12 +349,12 @@
352349 {
353350 struct fimc_isp *isp = video_drvdata(file);
354351
355
- __fimc_vidioc_querycap(&isp->pdev->dev, cap, V4L2_CAP_STREAMING);
352
+ __fimc_vidioc_querycap(&isp->pdev->dev, cap);
356353 return 0;
357354 }
358355
359
-static int isp_video_enum_fmt_mplane(struct file *file, void *priv,
360
- struct v4l2_fmtdesc *f)
356
+static int isp_video_enum_fmt(struct file *file, void *priv,
357
+ struct v4l2_fmtdesc *f)
361358 {
362359 const struct fimc_fmt *fmt;
363360
....@@ -368,7 +365,6 @@
368365 if (WARN_ON(fmt == NULL))
369366 return -EINVAL;
370367
371
- strlcpy(f->description, fmt->name, sizeof(f->description));
372368 f->pixelformat = fmt->fourcc;
373369
374370 return 0;
....@@ -554,7 +550,7 @@
554550
555551 static const struct v4l2_ioctl_ops isp_video_ioctl_ops = {
556552 .vidioc_querycap = isp_video_querycap,
557
- .vidioc_enum_fmt_vid_cap_mplane = isp_video_enum_fmt_mplane,
553
+ .vidioc_enum_fmt_vid_cap = isp_video_enum_fmt,
558554 .vidioc_try_fmt_vid_cap_mplane = isp_video_try_fmt_mplane,
559555 .vidioc_s_fmt_vid_cap_mplane = isp_video_s_fmt_mplane,
560556 .vidioc_g_fmt_vid_cap_mplane = isp_video_g_fmt_mplane,
....@@ -609,9 +605,7 @@
609605
610606 vdev = &iv->ve.vdev;
611607 memset(vdev, 0, sizeof(*vdev));
612
- snprintf(vdev->name, sizeof(vdev->name), "fimc-is-isp.%s",
613
- type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE ?
614
- "capture" : "output");
608
+ strscpy(vdev->name, "fimc-is-isp.capture", sizeof(vdev->name));
615609 vdev->queue = q;
616610 vdev->fops = &isp_video_fops;
617611 vdev->ioctl_ops = &isp_video_ioctl_ops;
....@@ -619,6 +613,7 @@
619613 vdev->minor = -1;
620614 vdev->release = video_device_release_empty;
621615 vdev->lock = &isp->video_lock;
616
+ vdev->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE_MPLANE;
622617
623618 iv->pad.flags = MEDIA_PAD_FL_SINK;
624619 ret = media_entity_pads_init(&vdev->entity, 1, &iv->pad);
....@@ -627,7 +622,7 @@
627622
628623 video_set_drvdata(vdev, isp);
629624
630
- ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
625
+ ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
631626 if (ret < 0) {
632627 media_entity_cleanup(&vdev->entity);
633628 return ret;