From patchwork Fri May 31 16:47:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 2644971 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 4762A3FD4E for ; Fri, 31 May 2013 16:48:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754004Ab3EaQsF (ORCPT ); Fri, 31 May 2013 12:48:05 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:13700 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751921Ab3EaQsC (ORCPT ); Fri, 31 May 2013 12:48:02 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MNO001RN9C1A010@mailout4.samsung.com> for linux-media@vger.kernel.org; Sat, 01 Jun 2013 01:48:01 +0900 (KST) X-AuditID: cbfee61b-b7f8e6d00000524c-7c-51a8d441fcae Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 04.42.21068.144D8A15; Sat, 01 Jun 2013 01:48:01 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MNO009N79ALSY40@mmp2.samsung.com>; Sat, 01 Jun 2013 01:48:01 +0900 (KST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: hj210.choi@samsung.com, yhwan.joo@samsung.com, arun.kk@samsung.com, shaik.ameer@samsung.com, kyungmin.park@samsung.com, Sylwester Nawrocki Subject: [REVIEW PATCH 5/7] exynos4-is: Move __fimc_videoc_querycap() function to the common module Date: Fri, 31 May 2013 18:47:03 +0200 Message-id: <1370018825-13088-6-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1370018825-13088-1-git-send-email-s.nawrocki@samsung.com> References: <1370018825-13088-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpiluLIzCtJLcpLzFFi42I5/e+xoK7jlRWBBv37zS0+nrrNavF44zVm i7NNb9gtejZsZbU4/Kad1eLIw93sFrNPLGZ1YPfo27KK0ePzJrkApigum5TUnMyy1CJ9uwSu jAkXJrMUvFOouDzNqYHxikwXIyeHhICJxJJZ01ghbDGJC/fWs3UxcnEICUxnlJiwYQcrhNPB JHF8wRGwKjYBQ4neo32MILaIgLzEk94bbCA2s8BqRokdH6NBbGGBVIk9R3qYQGwWAVWJGX8n M4PYvAJuEudfXgGyOYC2KUjMmWQDYnIKuEs0v3IHqRACqri8fAnTBEbeBYwMqxhFUwuSC4qT 0nON9IoTc4tL89L1kvNzNzGCQ+aZ9A7GVQ0WhxgFOBiVeHgNVqwIFGJNLCuuzD3EKMHBrCTC mz8HKMSbklhZlVqUH19UmpNafIhRmoNFSZz3YKt1oJBAemJJanZqakFqEUyWiYNTqoHR/XHu upWvbhd+qS3vfLgzT7pC3a/4aE/o54X5S265b/j+Ou5wwdPMtV9csxrlPimdXthrc9ZTL33C i1mvLvqfj98fN0M2SN7o5hzPXZf/RuW2KvtkrzmzefsSxsQcoarGZ0x8avv+PqgNqIxY91z2 ykfFjmMG21Qvx0YfV5D7IPjDjFXrhoe4EktxRqKhFnNRcSIABkk+VhUCAAA= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Move __fimc_videoc_querycap() function to the common exynos4-is-common.ko module so it don't need to be reimplemented in multiple video node drivers of the exynos4-is. Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park --- drivers/media/platform/exynos4-is/common.c | 12 ++++++++++++ drivers/media/platform/exynos4-is/common.h | 4 ++++ drivers/media/platform/exynos4-is/fimc-core.c | 11 ----------- drivers/media/platform/exynos4-is/fimc-core.h | 2 -- drivers/media/platform/exynos4-is/fimc-m2m.c | 1 + 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/drivers/media/platform/exynos4-is/common.c b/drivers/media/platform/exynos4-is/common.c index 6720520..e427e1d 100644 --- a/drivers/media/platform/exynos4-is/common.c +++ b/drivers/media/platform/exynos4-is/common.c @@ -38,4 +38,16 @@ struct v4l2_subdev *fimc_find_remote_sensor(struct media_entity *entity) } EXPORT_SYMBOL(fimc_find_remote_sensor); +void __fimc_vidioc_querycap(struct device *dev, struct v4l2_capability *cap, + unsigned int caps) +{ + strlcpy(cap->driver, dev->driver->name, sizeof(cap->driver)); + strlcpy(cap->card, dev->driver->name, sizeof(cap->card)); + snprintf(cap->bus_info, sizeof(cap->bus_info), + "platform:%s", dev_name(dev)); + cap->device_caps = caps; + cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; +} +EXPORT_SYMBOL(__fimc_vidioc_querycap); + MODULE_LICENSE("GPL"); diff --git a/drivers/media/platform/exynos4-is/common.h b/drivers/media/platform/exynos4-is/common.h index 3c39803..75b9c71 100644 --- a/drivers/media/platform/exynos4-is/common.h +++ b/drivers/media/platform/exynos4-is/common.h @@ -6,7 +6,11 @@ * published by the Free Software Foundation. */ +#include +#include #include #include struct v4l2_subdev *fimc_find_remote_sensor(struct media_entity *entity); +void __fimc_vidioc_querycap(struct device *dev, struct v4l2_capability *cap, + unsigned int caps); diff --git a/drivers/media/platform/exynos4-is/fimc-core.c b/drivers/media/platform/exynos4-is/fimc-core.c index e856730..aa6716e 100644 --- a/drivers/media/platform/exynos4-is/fimc-core.c +++ b/drivers/media/platform/exynos4-is/fimc-core.c @@ -213,17 +213,6 @@ struct fimc_fmt *fimc_get_format(unsigned int index) return &fimc_formats[index]; } -void __fimc_vidioc_querycap(struct device *dev, struct v4l2_capability *cap, - unsigned int caps) -{ - strlcpy(cap->driver, dev->driver->name, sizeof(cap->driver)); - strlcpy(cap->card, dev->driver->name, sizeof(cap->card)); - snprintf(cap->bus_info, sizeof(cap->bus_info), - "platform:%s", dev_name(dev)); - cap->device_caps = caps; - cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; -} - int fimc_check_scaler_ratio(struct fimc_ctx *ctx, int sw, int sh, int dw, int dh, int rotation) { diff --git a/drivers/media/platform/exynos4-is/fimc-core.h b/drivers/media/platform/exynos4-is/fimc-core.h index bba6b25..0f25ce0 100644 --- a/drivers/media/platform/exynos4-is/fimc-core.h +++ b/drivers/media/platform/exynos4-is/fimc-core.h @@ -621,8 +621,6 @@ static inline struct fimc_frame *ctx_get_frame(struct fimc_ctx *ctx, /* fimc-core.c */ int fimc_vidioc_enum_fmt_mplane(struct file *file, void *priv, struct v4l2_fmtdesc *f); -void __fimc_vidioc_querycap(struct device *dev, struct v4l2_capability *cap, - unsigned int caps); int fimc_ctrls_create(struct fimc_ctx *ctx); void fimc_ctrls_delete(struct fimc_ctx *ctx); void fimc_ctrls_activate(struct fimc_ctx *ctx, bool active); diff --git a/drivers/media/platform/exynos4-is/fimc-m2m.c b/drivers/media/platform/exynos4-is/fimc-m2m.c index bde1f47..8d33b68 100644 --- a/drivers/media/platform/exynos4-is/fimc-m2m.c +++ b/drivers/media/platform/exynos4-is/fimc-m2m.c @@ -27,6 +27,7 @@ #include #include +#include "common.h" #include "fimc-core.h" #include "fimc-reg.h" #include "media-dev.h"