aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2011-07-26 18:27:59 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-09-06 15:20:23 -0300
commit3e00218207a22e10c205e15a47b8d71c822fedec (patch)
tree1121d3ce79d5bea9c49e660d87024073daa8bad0
parentebdfea810ec21744840f647341a1e74b8c762586 (diff)
[media] s5p-fimc: Limit number of available inputs to one
The current driver allowed camera sensors to be used only with single FIMC H/W instance, FIMC0..FIMC2/3, designated at compile time. Remaining FIMC entities could be used for video processing only, as mem-to-mem devices. Required camera could be selected with S_INPUT ioctl at one devnode only. However in that case it was not possible to use both cameras independently at the same time, as all sensors were registered to single FIMC capture driver. In most recent S5P SoC version there is enough FIMC H/W instances to cover all physical camera interfaces. Each FIMC instance exports its own video devnode. Thus we distribute the camera sensors one per each /dev/video? by default. It will allow to use both camera simultaneously by opening different video node. The camera sensors at FIMC are now not selected with S_INPUT ioctl, there is one input only available per /dev/video?. By default a single sensor is connected at FIMC input as specified by the media device platform data subdev description table. This assignment can be changed at runtime through the pipeline reconfiguration at the media device level. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/s5p-fimc/fimc-capture.c43
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 6efd952bd5a..b786c2c5fe2 100644
--- a/drivers/media/video/s5p-fimc/fimc-capture.c
+++ b/drivers/media/video/s5p-fimc/fimc-capture.c
@@ -577,57 +577,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;
}