.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * s3c24xx/s3c64xx SoC series Camera Interface (CAMIF) driver |
---|
3 | 4 | * |
---|
.. | .. |
---|
6 | 7 | * |
---|
7 | 8 | * Based on drivers/media/platform/s5p-fimc, |
---|
8 | 9 | * Copyright (C) 2010 - 2012 Samsung Electronics Co., Ltd. |
---|
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 version 2 as |
---|
12 | | - * published by the Free Software Foundation. |
---|
13 | 10 | */ |
---|
14 | 11 | #define pr_fmt(fmt) "%s:%d " fmt, __func__, __LINE__ |
---|
15 | 12 | |
---|
.. | .. |
---|
640 | 637 | { |
---|
641 | 638 | struct camif_vp *vp = video_drvdata(file); |
---|
642 | 639 | |
---|
643 | | - strlcpy(cap->driver, S3C_CAMIF_DRIVER_NAME, sizeof(cap->driver)); |
---|
644 | | - strlcpy(cap->card, S3C_CAMIF_DRIVER_NAME, sizeof(cap->card)); |
---|
| 640 | + strscpy(cap->driver, S3C_CAMIF_DRIVER_NAME, sizeof(cap->driver)); |
---|
| 641 | + strscpy(cap->card, S3C_CAMIF_DRIVER_NAME, sizeof(cap->card)); |
---|
645 | 642 | snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s.%d", |
---|
646 | 643 | dev_name(vp->camif->dev), vp->id); |
---|
647 | | - |
---|
648 | | - cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE; |
---|
649 | | - cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; |
---|
650 | | - |
---|
651 | 644 | return 0; |
---|
652 | 645 | } |
---|
653 | 646 | |
---|
.. | .. |
---|
661 | 654 | return -EINVAL; |
---|
662 | 655 | |
---|
663 | 656 | input->type = V4L2_INPUT_TYPE_CAMERA; |
---|
664 | | - strlcpy(input->name, sensor->name, sizeof(input->name)); |
---|
| 657 | + strscpy(input->name, sensor->name, sizeof(input->name)); |
---|
665 | 658 | return 0; |
---|
666 | 659 | } |
---|
667 | 660 | |
---|
.. | .. |
---|
688 | 681 | if (!fmt) |
---|
689 | 682 | return -EINVAL; |
---|
690 | 683 | |
---|
691 | | - strlcpy(f->description, fmt->name, sizeof(f->description)); |
---|
692 | 684 | f->pixelformat = fmt->fourcc; |
---|
693 | | - |
---|
694 | | - pr_debug("fmt(%d): %s\n", f->index, f->description); |
---|
695 | 685 | return 0; |
---|
696 | 686 | } |
---|
697 | 687 | |
---|
.. | .. |
---|
805 | 795 | if (vp->owner == NULL) |
---|
806 | 796 | vp->owner = priv; |
---|
807 | 797 | |
---|
808 | | - pr_debug("%ux%u. payload: %u. fmt: %s. %d %d. sizeimage: %d. bpl: %d\n", |
---|
809 | | - out_frame->f_width, out_frame->f_height, vp->payload, fmt->name, |
---|
810 | | - pix->width * pix->height * fmt->depth, fmt->depth, |
---|
811 | | - pix->sizeimage, pix->bytesperline); |
---|
| 798 | + pr_debug("%ux%u. payload: %u. fmt: 0x%08x. %d %d. sizeimage: %d. bpl: %d\n", |
---|
| 799 | + out_frame->f_width, out_frame->f_height, vp->payload, |
---|
| 800 | + fmt->fourcc, pix->width * pix->height * fmt->depth, |
---|
| 801 | + fmt->depth, pix->sizeimage, pix->bytesperline); |
---|
812 | 802 | |
---|
813 | 803 | return 0; |
---|
814 | 804 | } |
---|
.. | .. |
---|
943 | 933 | if (vp->owner && vp->owner != priv) |
---|
944 | 934 | return -EBUSY; |
---|
945 | 935 | |
---|
946 | | - return vb2_qbuf(&vp->vb_queue, buf); |
---|
| 936 | + return vb2_qbuf(&vp->vb_queue, vp->vdev.v4l2_dev->mdev, buf); |
---|
947 | 937 | } |
---|
948 | 938 | |
---|
949 | 939 | static int s3c_camif_dqbuf(struct file *file, void *priv, |
---|
.. | .. |
---|
981 | 971 | struct v4l2_buffer *b) |
---|
982 | 972 | { |
---|
983 | 973 | struct camif_vp *vp = video_drvdata(file); |
---|
984 | | - return vb2_prepare_buf(&vp->vb_queue, b); |
---|
| 974 | + return vb2_prepare_buf(&vp->vb_queue, vp->vdev.v4l2_dev->mdev, b); |
---|
985 | 975 | } |
---|
986 | 976 | |
---|
987 | 977 | static int s3c_camif_g_selection(struct file *file, void *priv, |
---|
.. | .. |
---|
1166 | 1156 | goto err_me_cleanup; |
---|
1167 | 1157 | |
---|
1168 | 1158 | vfd->ctrl_handler = &vp->ctrl_handler; |
---|
| 1159 | + vfd->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE; |
---|
1169 | 1160 | |
---|
1170 | | - ret = video_register_device(vfd, VFL_TYPE_GRABBER, -1); |
---|
| 1161 | + ret = video_register_device(vfd, VFL_TYPE_VIDEO, -1); |
---|
1171 | 1162 | if (ret) |
---|
1172 | 1163 | goto err_ctrlh_free; |
---|
1173 | 1164 | |
---|
.. | .. |
---|
1555 | 1546 | |
---|
1556 | 1547 | v4l2_subdev_init(sd, &s3c_camif_subdev_ops); |
---|
1557 | 1548 | sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; |
---|
1558 | | - strlcpy(sd->name, "S3C-CAMIF", sizeof(sd->name)); |
---|
| 1549 | + strscpy(sd->name, "S3C-CAMIF", sizeof(sd->name)); |
---|
1559 | 1550 | |
---|
1560 | 1551 | camif->pads[CAMIF_SD_PAD_SINK].flags = MEDIA_PAD_FL_SINK; |
---|
1561 | 1552 | camif->pads[CAMIF_SD_PAD_SOURCE_C].flags = MEDIA_PAD_FL_SOURCE; |
---|