[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <6962075.17ypj6ChmC@amdc1227>
Date: Thu, 29 Aug 2013 15:17:23 +0200
From: Tomasz Figa <t.figa@...sung.com>
To: Mateusz Krawczuk <m.krawczuk@...tner.samsung.com>
Cc: kyungmin.park@...sung.com, t.stanislaws@...sung.com,
m.chehab@...sung.com, linux-arm-kernel@...ts.infradead.org,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
rob.herring@...xeda.com, pawel.moll@....com, mark.rutland@....com,
swarren@...dotorg.org, ian.campbell@...rix.com, rob@...dley.net,
mturquette@...aro.org, tomasz.figa@...il.com,
kgene.kim@...sung.com, thomas.abraham@...aro.org,
s.nawrocki@...sung.com, devicetree@...r.kernel.org,
linux-doc@...r.kernel.org, linux@....linux.org.uk,
ben-linux@...ff.org, linux-samsung-soc@...r.kernel.org
Subject: Re: [PATCH v3 4/6] media: s5p-tv: Fix mixer driver to work with CCF
On Wednesday 28 of August 2013 18:13:02 Mateusz Krawczuk wrote:
> Replace clk_enable by clock_enable_prepare and clk_disable with
> clk_disable_unprepare. Clock prepare is required by Clock Common
> Framework, and old clock driver didn`t support it. Without it Common
> Clock Framework prints a warning.
>
> Signed-off-by: Mateusz Krawczuk <m.krawczuk@...tner.samsung.com>
> ---
> drivers/media/platform/s5p-tv/mixer_drv.c | 35
> ++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7
> deletions(-)
>
> diff --git a/drivers/media/platform/s5p-tv/mixer_drv.c
> b/drivers/media/platform/s5p-tv/mixer_drv.c index 8ce7c3e..3b2b305
> 100644
> --- a/drivers/media/platform/s5p-tv/mixer_drv.c
> +++ b/drivers/media/platform/s5p-tv/mixer_drv.c
> @@ -347,19 +347,40 @@ static int mxr_runtime_resume(struct device *dev)
> {
> struct mxr_device *mdev = to_mdev(dev);
> struct mxr_resources *res = &mdev->res;
> + int ret;
>
> dev_dbg(mdev->dev, "resume - start\n");
> mutex_lock(&mdev->mutex);
> /* turn clocks on */
> - clk_enable(res->mixer);
> - clk_enable(res->vp);
> - clk_enable(res->sclk_mixer);
> + ret = clk_prepare_enable(res->mixer);
> + if (ret < 0) {
> + dev_err(mdev->dev, "clk_prepare_enable(mixer) failed\n");
> + goto fail;
> + }
> + ret = clk_prepare_enable(res->vp);
> + if (ret < 0) {
> + dev_err(mdev->dev, "clk_prepare_enable(vp) failed\n");
> + goto fail_mixer;
> + }
> + ret = clk_prepare_enable(res->sclk_mixer);
> + if (ret < 0) {
> + dev_err(mdev->dev, "clk_prepare_enable(sclk_mixer) failed\n");
> + goto fail_vp;
> + }
> /* apply default configuration */
> mxr_reg_reset(mdev);
> - dev_dbg(mdev->dev, "resume - finished\n");
>
> mutex_unlock(&mdev->mutex);
> + dev_dbg(mdev->dev, "resume - finished\n");
Why is this line moved in this patch?
> return 0;
nit: A blank line would look good here.
> +fail_vp:
> + clk_disable_unprepare(res->vp);
> +fail_mixer:
> + clk_disable_unprepare(res->mixer);
> +fail:
> + mutex_unlock(&mdev->mutex);
> + dev_info(mdev->dev, "resume failed\n");
dev_err?
Best regards,
Tomasz
> + return ret;
> }
>
> static int mxr_runtime_suspend(struct device *dev)
> @@ -369,9 +390,9 @@ static int mxr_runtime_suspend(struct device *dev)
> dev_dbg(mdev->dev, "suspend - start\n");
> mutex_lock(&mdev->mutex);
> /* turn clocks off */
> - clk_disable(res->sclk_mixer);
> - clk_disable(res->vp);
> - clk_disable(res->mixer);
> + clk_disable_unprepare(res->sclk_mixer);
> + clk_disable_unprepare(res->vp);
> + clk_disable_unprepare(res->mixer);
> mutex_unlock(&mdev->mutex);
> dev_dbg(mdev->dev, "suspend - finished\n");
> return 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists