aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Abgrall <jpa@google.com>2012-03-30 19:13:52 -0700
committerJP Abgrall <jpa@google.com>2012-03-30 19:13:52 -0700
commitd916b9f291cdc66bbe894fece5d91167cadaa563 (patch)
tree34f346f4d165aee25512e42074730d312564b054
parent937fb8beb9c0a205df32344e7daa9845df692078 (diff)
downloadkernel_samsung_aries-d916b9f291cdc66bbe894fece5d91167cadaa563.zip
kernel_samsung_aries-d916b9f291cdc66bbe894fece5d91167cadaa563.tar.gz
kernel_samsung_aries-d916b9f291cdc66bbe894fece5d91167cadaa563.tar.bz2
S5PC11X: FIMC: Handle off mode in suspend()/resume()
Avoid clock gating in suspend()/resume() when ctrl->status is set to FIMC_OFF_SLEEP because the fimc doesn't support it. Prevent the fimc from turning on during resume when it is not used. This patch fixes issue 5400100, which says mp3 playback power usage increased by 33%. Also, don't allow capture modue op during output mode, and vice-versa. Change-Id: I705523a674f1102a77195ee2ee170935bcf4d41e Signed-off-by: jung-min.oh <jung-min.oh@samsung.com>
-rw-r--r--drivers/media/video/samsung/fimc/fimc_capture.c6
-rw-r--r--drivers/media/video/samsung/fimc/fimc_dev.c6
-rw-r--r--drivers/media/video/samsung/fimc/fimc_output.c6
3 files changed, 14 insertions, 4 deletions
diff --git a/drivers/media/video/samsung/fimc/fimc_capture.c b/drivers/media/video/samsung/fimc/fimc_capture.c
index 2367bf6..2028bf9 100644
--- a/drivers/media/video/samsung/fimc/fimc_capture.c
+++ b/drivers/media/video/samsung/fimc/fimc_capture.c
@@ -690,6 +690,12 @@ int fimc_enum_fmt_vid_capture(struct file *file, void *fh,
fimc_dbg("%s\n", __func__);
+ if (ctrl->out) {
+ fimc_err("%s: fimc is already used for output mode\n",
+ __func__);
+ return -EINVAL;
+ }
+
if (!ctrl->cam || !ctrl->cam->sd) {
fimc_err("%s: No capture device.\n", __func__);
return -ENODEV;
diff --git a/drivers/media/video/samsung/fimc/fimc_dev.c b/drivers/media/video/samsung/fimc/fimc_dev.c
index 1441367..e9f088a 100644
--- a/drivers/media/video/samsung/fimc/fimc_dev.c
+++ b/drivers/media/video/samsung/fimc/fimc_dev.c
@@ -1503,13 +1503,12 @@ int fimc_suspend(struct platform_device *pdev, pm_message_t state)
if (ctrl->out)
fimc_suspend_out(ctrl);
-
else if (ctrl->cap)
fimc_suspend_cap(ctrl);
else
ctrl->status = FIMC_OFF_SLEEP;
- if (atomic_read(&ctrl->in_use))
+ if (atomic_read(&ctrl->in_use) && ctrl->status != FIMC_OFF_SLEEP)
fimc_clk_en(ctrl, false);
return 0;
@@ -1624,12 +1623,11 @@ int fimc_resume(struct platform_device *pdev)
ctrl = get_fimc_ctrl(id);
pdata = to_fimc_plat(ctrl->dev);
- if (atomic_read(&ctrl->in_use))
+ if (atomic_read(&ctrl->in_use) && ctrl->status != FIMC_OFF_SLEEP)
fimc_clk_en(ctrl, true);
if (ctrl->out)
fimc_resume_out(ctrl);
-
else if (ctrl->cap)
fimc_resume_cap(ctrl);
else
diff --git a/drivers/media/video/samsung/fimc/fimc_output.c b/drivers/media/video/samsung/fimc/fimc_output.c
index c66f995..6bf839d 100644
--- a/drivers/media/video/samsung/fimc/fimc_output.c
+++ b/drivers/media/video/samsung/fimc/fimc_output.c
@@ -2158,6 +2158,12 @@ int fimc_g_fmt_vid_out(struct file *filp, void *fh, struct v4l2_format *f)
fimc_info1("%s: called\n", __func__);
+ if (ctrl->cap) {
+ fimc_err("%s: fimc is already used for capture mode\n",
+ __func__);
+ return -EINVAL;
+ }
+
if (!out) {
out = kzalloc(sizeof(*out), GFP_KERNEL);
if (!out) {