From patchwork Wed Jun 22 18:01:10 2011 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: 906722 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5MI2WLR008977 for ; Wed, 22 Jun 2011 18:02:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758579Ab1FVSC1 (ORCPT ); Wed, 22 Jun 2011 14:02:27 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:21081 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758531Ab1FVSBk (ORCPT ); Wed, 22 Jun 2011 14:01:40 -0400 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: TEXT/PLAIN Received: from eu_spt1 ([210.118.77.13]) by mailout3.w1.samsung.com (Sun Java(tm) System Messaging Server 6.3-8.04 (built Jul 29 2009; 32bit)) with ESMTP id <0LN700FAQE2PCY30@mailout3.w1.samsung.com>; Wed, 22 Jun 2011 19:01:37 +0100 (BST) Received: from linux.samsung.com ([106.116.38.10]) by spt1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LN700JQHE2OWR@spt1.w1.samsung.com>; Wed, 22 Jun 2011 19:01:37 +0100 (BST) Received: from mcdsrvbld02.digital.local (unknown [106.116.37.23]) by linux.samsung.com (Postfix) with ESMTP id 697C0270050; Wed, 22 Jun 2011 20:01:53 +0200 (CEST) Date: Wed, 22 Jun 2011 20:01:10 +0200 From: Sylwester Nawrocki Subject: [PATCH v2 04/18] s5p-fimc: Limit number of available inputs to one In-reply-to: <1308765684-10677-1-git-send-email-s.nawrocki@samsung.com> To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: m.szyprowski@samsung.com, kyungmin.park@samsung.com, s.nawrocki@samsung.com, sw0312.kim@samsung.com, riverful.kim@samsung.com Message-id: <1308765684-10677-5-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.2.5 References: <1308765684-10677-1-git-send-email-s.nawrocki@samsung.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 22 Jun 2011 18:02:32 +0000 (UTC) Camera sensors at FIMC input are no longer selected with S_INPUT ioctl. They will be attached to required FIMC entity through pipeline re-configuration at the media device level. Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park --- drivers/media/video/s5p-fimc/fimc-capture.c | 43 ++++----------------------- 1 files changed, 6 insertions(+), 37 deletions(-) diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c index c7bb6f6..f42cda3 100644 --- a/drivers/media/video/s5p-fimc/fimc-capture.c +++ b/drivers/media/video/s5p-fimc/fimc-capture.c @@ -566,57 +566,26 @@ static int fimc_cap_s_fmt_mplane(struct file *file, void *priv, } static int fimc_cap_enum_input(struct file *file, void *priv, - struct v4l2_input *i) + struct v4l2_input *i) { struct fimc_ctx *ctx = priv; - struct s5p_platform_fimc *pldata = ctx->fimc_dev->pdata; - struct s5p_fimc_isp_info *isp_info; - if (i->index >= pldata->num_clients) + if (i->index != 0) return -EINVAL; - isp_info = &pldata->isp_info[i->index]; i->type = V4L2_INPUT_TYPE_CAMERA; - strncpy(i->name, isp_info->board_info->type, 32); return 0; } -static int fimc_cap_s_input(struct file *file, void *priv, - unsigned int i) +static int fimc_cap_s_input(struct file *file, void *priv, unsigned int i) { - struct fimc_ctx *ctx = priv; - struct fimc_dev *fimc = ctx->fimc_dev; - struct s5p_platform_fimc *pdata = fimc->pdata; - - if (fimc_capture_active(ctx->fimc_dev)) - return -EBUSY; - - if (i >= pdata->num_clients) - return -EINVAL; - - - if (fimc->vid_cap.sd) { - int ret = v4l2_subdev_call(fimc->vid_cap.sd, core, s_power, 0); - if (ret) - err("s_power failed: %d", ret); - - clk_disable(fimc->clock[CLK_CAM]); - } - - /* Release the attached sensor subdevice. */ - fimc_subdev_unregister(fimc); - - return fimc_isp_subdev_init(fimc, i); + return i == 0 ? i : -EINVAL; } -static int fimc_cap_g_input(struct file *file, void *priv, - unsigned int *i) +static int fimc_cap_g_input(struct file *file, void *priv, unsigned int *i) { - struct fimc_ctx *ctx = priv; - struct fimc_vid_cap *cap = &ctx->fimc_dev->vid_cap; - - *i = cap->input_index; + *i = 0; return 0; }