From: ulf.hansson@linaro.org (Ulf Hansson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 3/8] [media] exynos-gsc: Make driver functional when CONFIG_PM is unset
Date: Mon, 19 Jan 2015 14:22:35 +0100 [thread overview]
Message-ID: <1421673760-2600-4-git-send-email-ulf.hansson@linaro.org> (raw)
In-Reply-To: <1421673760-2600-1-git-send-email-ulf.hansson@linaro.org>
The driver depended on CONFIG_PM to be functional. Let's remove that
dependency, by enable the runtime PM resourses during ->probe() and
update the device's runtime PM status to reflect this.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/media/platform/exynos-gsc/gsc-core.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c
index 1865738..532daa8 100644
--- a/drivers/media/platform/exynos-gsc/gsc-core.c
+++ b/drivers/media/platform/exynos-gsc/gsc-core.c
@@ -1088,7 +1088,7 @@ static int gsc_probe(struct platform_device *pdev)
return PTR_ERR(gsc->clock);
}
- ret = clk_prepare(gsc->clock);
+ ret = clk_prepare_enable(gsc->clock);
if (ret) {
dev_err(&gsc->pdev->dev, "clock prepare failed for clock: %s\n",
GSC_CLOCK_GATE_NAME);
@@ -1111,30 +1111,29 @@ static int gsc_probe(struct platform_device *pdev)
goto err_v4l2;
platform_set_drvdata(pdev, gsc);
- pm_runtime_enable(dev);
- ret = pm_runtime_get_sync(&pdev->dev);
- if (ret < 0)
- goto err_m2m;
+
+ gsc_hw_set_sw_reset(gsc);
+ gsc_wait_reset(gsc);
/* Initialize continious memory allocator */
gsc->alloc_ctx = vb2_dma_contig_init_ctx(dev);
if (IS_ERR(gsc->alloc_ctx)) {
ret = PTR_ERR(gsc->alloc_ctx);
- goto err_pm;
+ goto err_m2m;
}
dev_dbg(dev, "gsc-%d registered successfully\n", gsc->id);
- pm_runtime_put(dev);
+ pm_runtime_set_active(dev);
+ pm_runtime_enable(dev);
+
return 0;
-err_pm:
- pm_runtime_put(dev);
err_m2m:
gsc_unregister_m2m_device(gsc);
err_v4l2:
v4l2_device_unregister(&gsc->v4l2_dev);
err_clk:
- clk_unprepare(gsc->clock);
+ clk_disable_unprepare(gsc->clock);
return ret;
}
--
1.9.1
next prev parent reply other threads:[~2015-01-19 13:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-19 13:22 [PATCH V2 0/8] [media] exynos-gsc: Fixup PM support Ulf Hansson
2015-01-19 13:22 ` [PATCH V2 1/8] [media] exynos-gsc: Simplify clock management Ulf Hansson
2015-01-19 13:22 ` [PATCH V2 2/8] [media] exynos-gsc: Convert gsc_m2m_resume() from int to void Ulf Hansson
2015-01-19 13:22 ` Ulf Hansson [this message]
2015-01-19 13:22 ` [PATCH V2 4/8] [media] exynos-gsc: Make runtime PM callbacks available for CONFIG_PM Ulf Hansson
2015-01-19 13:22 ` [PATCH V2 5/8] [media] exynos-gsc: Fixup clock management at ->remove() Ulf Hansson
2015-01-19 13:22 ` [PATCH V2 6/8] [media] exynos-gsc: Do full clock gating at runtime PM suspend Ulf Hansson
2015-01-19 13:22 ` [PATCH V2 7/8] [media] exynos-gsc: Make system PM callbacks available for CONFIG_PM_SLEEP Ulf Hansson
2015-01-19 13:22 ` [PATCH V2 8/8] [media] exynos-gsc: Simplify system PM Ulf Hansson
2015-03-02 12:28 ` [PATCH V2 0/8] [media] exynos-gsc: Fixup PM support Ulf Hansson
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=1421673760-2600-4-git-send-email-ulf.hansson@linaro.org \
--to=ulf.hansson@linaro.org \
--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;
as well as URLs for NNTP newsgroup(s).