Commit 03ce1a13 authored by Mateusz Krawczuk's avatar Mateusz Krawczuk Committed by Mauro Carvalho Chehab

[media] s5p-tv: mixer: Prepare for common clock framework

Replace clk_enable() by clock_enable_prepare() and clk_disable()
with clk_disable_unprepare(). clk_{prepare/unprepare} calls are
required by common clock framework and this driver was missed while
converting all users of the Samsung original clocks driver to its
new implementation based on the common clock API.
Signed-off-by: default avatarMateusz Krawczuk <m.krawczuk@partner.samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Acked-by: default avatarTomasz Stanislawski <t.stanislaws@samsung.com>
[s.nawrocki@samsung.com: edited commit description]
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent a889c115
......@@ -347,19 +347,41 @@ static int mxr_runtime_resume(struct device *dev)
{
struct mxr_device *mdev = to_mdev(dev);
struct mxr_resources *res = &mdev->res;
int ret;
mxr_dbg(mdev, "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);
mxr_dbg(mdev, "resume - finished\n");
mutex_unlock(&mdev->mutex);
return 0;
fail_vp:
clk_disable_unprepare(res->vp);
fail_mixer:
clk_disable_unprepare(res->mixer);
fail:
mutex_unlock(&mdev->mutex);
dev_err(mdev->dev, "resume failed\n");
return ret;
}
static int mxr_runtime_suspend(struct device *dev)
......@@ -369,9 +391,9 @@ static int mxr_runtime_suspend(struct device *dev)
mxr_dbg(mdev, "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);
mxr_dbg(mdev, "suspend - finished\n");
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment