diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2015-07-30 10:55:38 +0900 |
---|---|---|
committer | Junghoon Kim <jhoon20.kim@samsung.com> | 2019-02-14 14:57:11 +0900 |
commit | e2af5d0e273a61a7047b7a924dd757a459893061 (patch) | |
tree | 9d7c4a7553e25b03eb0313fd91fc5405a31e1d02 /drivers/media | |
parent | 5cf51ce1110dc014942b8bd65f539fd6f29c9922 (diff) | |
download | linux-exynos-e2af5d0e273a61a7047b7a924dd757a459893061.tar.gz linux-exynos-e2af5d0e273a61a7047b7a924dd757a459893061.tar.bz2 linux-exynos-e2af5d0e273a61a7047b7a924dd757a459893061.zip |
fimc-is: Fix/add vidioc_querycap for several video nodes
This allows us to get rid of a warning from v4l2-core.
Change-Id: I30fae593f0dcdd314d5c2cd18f02528b78e7807c
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Diffstat (limited to 'drivers/media')
7 files changed, 56 insertions, 49 deletions
diff --git a/drivers/media/platform/exynos/fimc-is/fimc-is-video-3aa.c b/drivers/media/platform/exynos/fimc-is/fimc-is-video-3aa.c index 08b023b09897..1e40c5e47889 100644 --- a/drivers/media/platform/exynos/fimc-is/fimc-is-video-3aa.c +++ b/drivers/media/platform/exynos/fimc-is/fimc-is-video-3aa.c @@ -273,7 +273,17 @@ const struct v4l2_file_operations fimc_is_3aa_video_fops = { static int fimc_is_3aa_video_querycap(struct file *file, void *fh, struct v4l2_capability *cap) { - /* Todo : add to query capability code */ + struct fimc_is_video_ctx *vctx = file->private_data; + struct fimc_is_device_ischain *device = vctx->device; + + strlcpy(cap->driver, FIMC_IS_DRV_NAME, sizeof(cap->driver)); + strlcpy(cap->card, FIMC_IS_DRV_NAME, sizeof(cap->card)); + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", + dev_name(&device->pdev->dev)); + cap->device_caps = V4L2_CAP_STREAMING + | V4L2_CAP_VIDEO_OUTPUT_MPLANE + | V4L2_CAP_VIDEO_CAPTURE_MPLANE; + cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; return 0; } diff --git a/drivers/media/platform/exynos/fimc-is/fimc-is-video-isp.c b/drivers/media/platform/exynos/fimc-is/fimc-is-video-isp.c index 3f417e2bcb64..bd526d15b7b5 100644 --- a/drivers/media/platform/exynos/fimc-is/fimc-is-video-isp.c +++ b/drivers/media/platform/exynos/fimc-is/fimc-is-video-isp.c @@ -225,15 +225,12 @@ static int fimc_is_isp_video_querycap(struct file *file, void *fh, { struct fimc_is_core *isp = video_drvdata(file); - strncpy(cap->driver, isp->pdev->name, sizeof(cap->driver) - 1); - - dbg_isp("%s(devname : %s)\n", __func__, cap->driver); - strncpy(cap->card, isp->pdev->name, sizeof(cap->card) - 1); - cap->bus_info[0] = 0; - cap->version = KERNEL_VERSION(1, 0, 0); - cap->capabilities = V4L2_CAP_STREAMING - | V4L2_CAP_VIDEO_CAPTURE - | V4L2_CAP_VIDEO_CAPTURE_MPLANE; + strlcpy(cap->driver, FIMC_IS_DRV_NAME, sizeof(cap->driver)); + strlcpy(cap->card, FIMC_IS_DRV_NAME, sizeof(cap->card)); + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", + dev_name(&isp->pdev->dev)); + cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE_MPLANE; + cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; return 0; } diff --git a/drivers/media/platform/exynos/fimc-is/fimc-is-video-scc.c b/drivers/media/platform/exynos/fimc-is/fimc-is-video-scc.c index 75704ae1b145..33ef6b211400 100644 --- a/drivers/media/platform/exynos/fimc-is/fimc-is-video-scc.c +++ b/drivers/media/platform/exynos/fimc-is/fimc-is-video-scc.c @@ -225,17 +225,15 @@ const struct v4l2_file_operations fimc_is_scc_video_fops = { static int fimc_is_scc_video_querycap(struct file *file, void *fh, struct v4l2_capability *cap) { - struct fimc_is_core *isp = video_drvdata(file); - - strncpy(cap->driver, isp->pdev->name, sizeof(cap->driver) - 1); - - dbg("(devname : %s)\n", cap->driver); - strncpy(cap->card, isp->pdev->name, sizeof(cap->card) - 1); - cap->bus_info[0] = 0; - cap->version = KERNEL_VERSION(1, 0, 0); - cap->capabilities = V4L2_CAP_STREAMING - | V4L2_CAP_VIDEO_CAPTURE - | V4L2_CAP_VIDEO_CAPTURE_MPLANE; + struct fimc_is_video_ctx *vctx = file->private_data; + struct fimc_is_device_ischain *device = vctx->device; + + strlcpy(cap->driver, FIMC_IS_DRV_NAME, sizeof(cap->driver)); + strlcpy(cap->card, FIMC_IS_DRV_NAME, sizeof(cap->card)); + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", + dev_name(&device->pdev->dev)); + cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE_MPLANE; + cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; return 0; } diff --git a/drivers/media/platform/exynos/fimc-is/fimc-is-video-scp.c b/drivers/media/platform/exynos/fimc-is/fimc-is-video-scp.c index 2026260a6a17..864658c6b28b 100644 --- a/drivers/media/platform/exynos/fimc-is/fimc-is-video-scp.c +++ b/drivers/media/platform/exynos/fimc-is/fimc-is-video-scp.c @@ -34,6 +34,7 @@ #include "fimc-is-regs.h" #include "fimc-is-err.h" #include "fimc-is-video.h" +#include "fimc-is-core.h" const struct v4l2_file_operations fimc_is_scp_video_fops; const struct v4l2_ioctl_ops fimc_is_scp_video_ioctl_ops; @@ -227,15 +228,12 @@ static int fimc_is_scp_video_querycap(struct file *file, void *fh, { struct fimc_is_core *core = video_drvdata(file); - strncpy(cap->driver, core->pdev->name, sizeof(cap->driver) - 1); - - dbg("%s(devname : %s)\n", __func__, cap->driver); - strncpy(cap->card, core->pdev->name, sizeof(cap->card) - 1); - cap->bus_info[0] = 0; - cap->version = KERNEL_VERSION(1, 0, 0); - cap->capabilities = V4L2_CAP_STREAMING - | V4L2_CAP_VIDEO_CAPTURE - | V4L2_CAP_VIDEO_CAPTURE_MPLANE; + strlcpy(cap->driver, FIMC_IS_DRV_NAME, sizeof(cap->driver)); + strlcpy(cap->card, FIMC_IS_DRV_NAME, sizeof(cap->card)); + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", + dev_name(&core->pdev->dev)); + cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE_MPLANE; + cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; return 0; } diff --git a/drivers/media/platform/exynos/fimc-is/fimc-is-video-sensor.c b/drivers/media/platform/exynos/fimc-is/fimc-is-video-sensor.c index d1b194ac63bc..ef205b05d245 100644 --- a/drivers/media/platform/exynos/fimc-is/fimc-is-video-sensor.c +++ b/drivers/media/platform/exynos/fimc-is/fimc-is-video-sensor.c @@ -35,6 +35,7 @@ #include "fimc-is-err.h" #include "fimc-is-video.h" #include "fimc-is-metadata.h" +#include "fimc-is-core.h" const struct v4l2_file_operations fimc_is_sen_video_fops; const struct v4l2_ioctl_ops fimc_is_sen_video_ioctl_ops; @@ -228,7 +229,16 @@ const struct v4l2_file_operations fimc_is_sen_video_fops = { static int fimc_is_sen_video_querycap(struct file *file, void *fh, struct v4l2_capability *cap) { - /* Todo : add to query capability code */ + struct fimc_is_video_ctx *vctx = file->private_data; + struct fimc_is_device_sensor *device = vctx->device; + + strlcpy(cap->driver, FIMC_IS_DRV_NAME, sizeof(cap->driver)); + strlcpy(cap->card, FIMC_IS_DRV_NAME, sizeof(cap->card)); + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", + dev_name(&device->pdev->dev)); + cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE_MPLANE; + cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; + return 0; } diff --git a/drivers/media/platform/exynos/fimc-is/fimc-is-video-vdisc.c b/drivers/media/platform/exynos/fimc-is/fimc-is-video-vdisc.c index 0ce8579ff771..0cae490db99b 100644 --- a/drivers/media/platform/exynos/fimc-is/fimc-is-video-vdisc.c +++ b/drivers/media/platform/exynos/fimc-is/fimc-is-video-vdisc.c @@ -208,15 +208,12 @@ static int fimc_is_vdc_video_querycap(struct file *file, void *fh, { struct fimc_is_core *core = video_drvdata(file); - dbg_vdisc("%s(devname : %s)\n", __func__, core->pdev->name); - - strncpy(cap->driver, core->pdev->name, sizeof(cap->driver) - 1); - strncpy(cap->card, core->pdev->name, sizeof(cap->card) - 1); - cap->bus_info[0] = 0; - cap->version = KERNEL_VERSION(1, 0, 0); - cap->capabilities = V4L2_CAP_STREAMING - | V4L2_CAP_VIDEO_CAPTURE - | V4L2_CAP_VIDEO_CAPTURE_MPLANE; + strlcpy(cap->driver, FIMC_IS_DRV_NAME, sizeof(cap->driver)); + strlcpy(cap->card, FIMC_IS_DRV_NAME, sizeof(cap->card)); + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", + dev_name(&core->pdev->dev)); + cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE_MPLANE; + cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; return 0; } diff --git a/drivers/media/platform/exynos/fimc-is/fimc-is-video-vdiso.c b/drivers/media/platform/exynos/fimc-is/fimc-is-video-vdiso.c index cc670d0fcd12..5c0bd39d6c30 100644 --- a/drivers/media/platform/exynos/fimc-is/fimc-is-video-vdiso.c +++ b/drivers/media/platform/exynos/fimc-is/fimc-is-video-vdiso.c @@ -218,15 +218,12 @@ static int fimc_is_vdo_video_querycap(struct file *file, void *fh, { struct fimc_is_core *core = video_drvdata(file); - strncpy(cap->driver, core->pdev->name, sizeof(cap->driver) - 1); - - dbg_vdiso("%s(devname : %s)\n", __func__, cap->driver); - strncpy(cap->card, core->pdev->name, sizeof(cap->card) - 1); - cap->bus_info[0] = 0; - cap->version = KERNEL_VERSION(1, 0, 0); - cap->capabilities = V4L2_CAP_STREAMING - | V4L2_CAP_VIDEO_CAPTURE - | V4L2_CAP_VIDEO_CAPTURE_MPLANE; + strlcpy(cap->driver, FIMC_IS_DRV_NAME, sizeof(cap->driver)); + strlcpy(cap->card, FIMC_IS_DRV_NAME, sizeof(cap->card)); + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", + dev_name(&core->pdev->dev)); + cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_OUTPUT_MPLANE; + cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; return 0; } |