| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Samsung EXYNOS4x12 FIMC-IS (Imaging Subsystem) driver |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 8 | 9 | * |
|---|
| 9 | 10 | * The hardware handling code derived from a driver written by |
|---|
| 10 | 11 | * 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. |
|---|
| 15 | 12 | */ |
|---|
| 16 | 13 | |
|---|
| 17 | 14 | #include <linux/bitops.h> |
|---|
| .. | .. |
|---|
| 278 | 275 | if (ret < 0) |
|---|
| 279 | 276 | goto unlock; |
|---|
| 280 | 277 | |
|---|
| 281 | | - ret = pm_runtime_get_sync(&isp->pdev->dev); |
|---|
| 278 | + ret = pm_runtime_resume_and_get(&isp->pdev->dev); |
|---|
| 282 | 279 | if (ret < 0) |
|---|
| 283 | 280 | goto rel_fh; |
|---|
| 284 | 281 | |
|---|
| .. | .. |
|---|
| 352 | 349 | { |
|---|
| 353 | 350 | struct fimc_isp *isp = video_drvdata(file); |
|---|
| 354 | 351 | |
|---|
| 355 | | - __fimc_vidioc_querycap(&isp->pdev->dev, cap, V4L2_CAP_STREAMING); |
|---|
| 352 | + __fimc_vidioc_querycap(&isp->pdev->dev, cap); |
|---|
| 356 | 353 | return 0; |
|---|
| 357 | 354 | } |
|---|
| 358 | 355 | |
|---|
| 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) |
|---|
| 361 | 358 | { |
|---|
| 362 | 359 | const struct fimc_fmt *fmt; |
|---|
| 363 | 360 | |
|---|
| .. | .. |
|---|
| 368 | 365 | if (WARN_ON(fmt == NULL)) |
|---|
| 369 | 366 | return -EINVAL; |
|---|
| 370 | 367 | |
|---|
| 371 | | - strlcpy(f->description, fmt->name, sizeof(f->description)); |
|---|
| 372 | 368 | f->pixelformat = fmt->fourcc; |
|---|
| 373 | 369 | |
|---|
| 374 | 370 | return 0; |
|---|
| .. | .. |
|---|
| 554 | 550 | |
|---|
| 555 | 551 | static const struct v4l2_ioctl_ops isp_video_ioctl_ops = { |
|---|
| 556 | 552 | .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, |
|---|
| 558 | 554 | .vidioc_try_fmt_vid_cap_mplane = isp_video_try_fmt_mplane, |
|---|
| 559 | 555 | .vidioc_s_fmt_vid_cap_mplane = isp_video_s_fmt_mplane, |
|---|
| 560 | 556 | .vidioc_g_fmt_vid_cap_mplane = isp_video_g_fmt_mplane, |
|---|
| .. | .. |
|---|
| 609 | 605 | |
|---|
| 610 | 606 | vdev = &iv->ve.vdev; |
|---|
| 611 | 607 | 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)); |
|---|
| 615 | 609 | vdev->queue = q; |
|---|
| 616 | 610 | vdev->fops = &isp_video_fops; |
|---|
| 617 | 611 | vdev->ioctl_ops = &isp_video_ioctl_ops; |
|---|
| .. | .. |
|---|
| 619 | 613 | vdev->minor = -1; |
|---|
| 620 | 614 | vdev->release = video_device_release_empty; |
|---|
| 621 | 615 | vdev->lock = &isp->video_lock; |
|---|
| 616 | + vdev->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE_MPLANE; |
|---|
| 622 | 617 | |
|---|
| 623 | 618 | iv->pad.flags = MEDIA_PAD_FL_SINK; |
|---|
| 624 | 619 | ret = media_entity_pads_init(&vdev->entity, 1, &iv->pad); |
|---|
| .. | .. |
|---|
| 627 | 622 | |
|---|
| 628 | 623 | video_set_drvdata(vdev, isp); |
|---|
| 629 | 624 | |
|---|
| 630 | | - ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1); |
|---|
| 625 | + ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1); |
|---|
| 631 | 626 | if (ret < 0) { |
|---|
| 632 | 627 | media_entity_cleanup(&vdev->entity); |
|---|
| 633 | 628 | return ret; |
|---|