diff options
author | Hyunwoong Kim <khw0178.kim@samsung.com> | 2010-08-09 16:37:46 +0900 |
---|---|---|
committer | Arve Hjønnevåg <arve@android.com> | 2011-11-17 17:40:46 -0800 |
commit | 2fafec67836ee628d638f79596013d68eaaa8660 (patch) | |
tree | 51d6bda3a030c5e90bf453c8766d862271a1c6d0 /drivers/media/video/samsung | |
parent | 24986e176afabc8ade4626d440aeb4590db0be39 (diff) | |
download | kernel_samsung_crespo-2fafec67836ee628d638f79596013d68eaaa8660.zip kernel_samsung_crespo-2fafec67836ee628d638f79596013d68eaaa8660.tar.gz kernel_samsung_crespo-2fafec67836ee628d638f79596013d68eaaa8660.tar.bz2 |
S5PC110: FIMC: Modified FIMC clock-on sequence.
when qbuf function called, FIMC clock will go on.
Signed-off-by: Hyunwong Kim <khw0178.kim@samsung.com>
Diffstat (limited to 'drivers/media/video/samsung')
-rw-r--r-- | drivers/media/video/samsung/fimc/fimc_dev.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/drivers/media/video/samsung/fimc/fimc_dev.c b/drivers/media/video/samsung/fimc/fimc_dev.c index b6bc49f..47d8aea 100644 --- a/drivers/media/video/samsung/fimc/fimc_dev.c +++ b/drivers/media/video/samsung/fimc/fimc_dev.c @@ -26,6 +26,7 @@ #include <linux/io.h> #include <linux/memory.h> #include <linux/ctype.h> +#include <linux/platform_device.h> #include <plat/clock.h> #include <plat/media.h> #include <plat/fimc.h> @@ -103,17 +104,25 @@ void fimc_dma_free(struct fimc_control *ctrl, struct fimc_buf_set *bs, int i) void fimc_clk_en(struct fimc_control *ctrl, bool on) { + struct platform_device *pdev; + struct s3c_platform_fimc *pdata; + struct clk *lclk; + + pdev = to_platform_device(ctrl->dev); + pdata = to_fimc_plat(ctrl->dev); + lclk = clk_get(&pdev->dev, pdata->lclk_name); + if(on){ - if(!ctrl->clk->usage){ + if(!lclk->usage){ if(!ctrl->out) fimc_info1("(%d) Clock %s(%d) enabled.\n", ctrl->id, ctrl->clk->name, ctrl->clk->id); - clk_enable(ctrl->clk); + clk_enable(lclk); } } else { - while(ctrl->clk->usage > 0){ + while(lclk->usage > 0){ if(!ctrl->out) fimc_info1("(%d) Clock %s(%d) disabled.\n", ctrl->id, ctrl->clk->name, ctrl->clk->id); - clk_disable(ctrl->clk); + clk_disable(lclk); } } @@ -896,6 +905,10 @@ static int fimc_open(struct file *filp) prv_data->ctrl = ctrl; filp->private_data = prv_data; + ret = s5pv210_pd_enable("fimc_pd"); + if (ret < 0) + fimc_err("failed to enable fimcn power domain\n"); + if (in_use == 1) { fimc_clk_en(ctrl, true); @@ -1264,7 +1277,7 @@ static int __devinit fimc_probe(struct platform_device *pdev) { struct s3c_platform_fimc *pdata; struct fimc_control *ctrl; - struct clk *srclk, *lclk; + struct clk *srclk; int ret; if (!fimc_dev) { @@ -1308,11 +1321,6 @@ static int __devinit fimc_probe(struct platform_device *pdev) /* set rate for mclk */ clk_set_rate(ctrl->clk, pdata->clk_rate); - ret = s5pv210_pd_enable("fimc_pd"); - - lclk = clk_get(&pdev->dev, pdata->lclk_name); - clk_enable(lclk); - /* V4L2 device-subdev registration */ ret = v4l2_device_register(&pdev->dev, &ctrl->v4l2_dev); if (ret) { |