From: t.figa@samsung.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 4/6] media: s5p-tv: Fix mixer driver to work with CCF
Date: Thu, 29 Aug 2013 15:17:23 +0200 [thread overview]
Message-ID: <6962075.17ypj6ChmC@amdc1227> (raw)
In-Reply-To: <1377706384-3697-5-git-send-email-m.krawczuk@partner.samsung.com>
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@partner.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;
next prev parent reply other threads:[~2013-08-29 13:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-28 16:12 [PATCH v3 0/6] ARM: S5PV210: move to common clk framework Mateusz Krawczuk
2013-08-28 16:12 ` [PATCH v3 1/6] media: s5p-tv: Replace mxr_ macro by default dev_ Mateusz Krawczuk
2013-08-29 10:14 ` Tomasz Figa
2013-08-28 16:13 ` [PATCH v3 2/6] media: s5p-tv: Restore vpll clock rate Mateusz Krawczuk
2013-08-29 13:07 ` Tomasz Figa
2013-08-28 16:13 ` [PATCH v3 3/6] media: s5p-tv: Fix sdo driver to work with CCF Mateusz Krawczuk
2013-08-29 13:14 ` Tomasz Figa
2013-08-28 16:13 ` [PATCH v3 4/6] media: s5p-tv: Fix mixer " Mateusz Krawczuk
2013-08-29 13:17 ` Tomasz Figa [this message]
2013-08-28 16:13 ` [PATCH v3 5/6] clk: samsung: Add clock driver for s5pc110/s5pv210 Mateusz Krawczuk
2013-08-29 14:39 ` Tomasz Figa
2013-08-28 16:13 ` [PATCH v3 6/6] ARM: s5pv210: Migrate clock handling to Common Clock Framework Mateusz Krawczuk
2013-08-29 14:45 ` Tomasz Figa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6962075.17ypj6ChmC@amdc1227 \
--to=t.figa@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox