diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2014-02-21 19:28:36 +0100 |
---|---|---|
committer | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2014-11-27 03:38:40 -0800 |
commit | c5af28d8cd8b1dcfe95da51d176aa575f6abc6e4 (patch) | |
tree | 025377cd56be33e5da38d25acf9b70b3a08b68cd /drivers | |
parent | e53c708f791c5234b0ab666661480db3bbb2bae1 (diff) | |
download | linux-3.10-c5af28d8cd8b1dcfe95da51d176aa575f6abc6e4.tar.gz linux-3.10-c5af28d8cd8b1dcfe95da51d176aa575f6abc6e4.tar.bz2 linux-3.10-c5af28d8cd8b1dcfe95da51d176aa575f6abc6e4.zip |
exynos5-is: Make sclk_bayer clock handling optional
There is no sclk_bayer clock on exynos3250.
Some flag at the variant data could be added later to handle
properly error from clk calls.
Change-Id: I249169e1a7c451db6805dee7d01dd95816f329e0
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/platform/exynos5-is/exynos5-mdev.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/media/platform/exynos5-is/exynos5-mdev.c b/drivers/media/platform/exynos5-is/exynos5-mdev.c index 33f20a0e761..7c82a83328d 100644 --- a/drivers/media/platform/exynos5-is/exynos5-mdev.c +++ b/drivers/media/platform/exynos5-is/exynos5-mdev.c @@ -207,9 +207,12 @@ static int __fimc_pipeline_open(struct exynos_media_pipeline *ep, si = v4l2_get_subdev_hostdata(sd); fmd = entity_to_fimc_mdev(&sd->entity); - ret = clk_prepare_enable(fmd->clk_bayer); - if (ret < 0) - return ret; + + if (!IS_ERR(fmd->clk_bayer)) { + ret = clk_prepare_enable(fmd->clk_bayer); + if (ret < 0) + return ret; + } ret = fimc_pipeline_s_power(p, 1); if (!ret) @@ -240,7 +243,9 @@ static int __fimc_pipeline_close(struct exynos_media_pipeline *ep) si = v4l2_get_subdev_hostdata(sd); fmd = entity_to_fimc_mdev(&sd->entity); - clk_disable_unprepare(fmd->clk_bayer); + + if (!IS_ERR(fmd->clk_bayer)) + clk_disable_unprepare(fmd->clk_bayer); if (p->subdevs[IDX_SENSOR]->grp_id == GRP_ID_FIMC_IS_SENSOR) { struct fimc_pipeline_isp *p_isp; @@ -1153,11 +1158,8 @@ int exynos_camera_register(struct device *dev, struct fimc_md **md) } fmd->clk_bayer = clk_get(dev, BAYER_CLK_NAME); - if (IS_ERR(fmd->clk_bayer)) { - v4l2_err(v4l2_dev, "Failed to get clk: %s\n", BAYER_CLK_NAME); - goto err_md; - } - + if (IS_ERR(fmd->clk_bayer)) + v4l2_info(v4l2_dev, "Couldn't get clk: " BAYER_CLK_NAME "\n"); /* Protect the media graph while we're registering entities */ mutex_lock(&fmd->media_dev.graph_mutex); @@ -1189,7 +1191,8 @@ int exynos_camera_register(struct device *dev, struct fimc_md **md) err_unlock: mutex_unlock(&fmd->media_dev.graph_mutex); err_clk: - clk_put(fmd->clk_bayer); + if (!IS_ERR(fmd->clk_bayer)) + clk_put(fmd->clk_bayer); fimc_md_unregister_entities(fmd); media_device_unregister(&fmd->media_dev); err_md: @@ -1207,7 +1210,9 @@ int exynos_camera_unregister(struct fimc_md *fmd) fimc_md_unregister_entities(fmd); fimc_md_pipelines_free(fmd); media_device_unregister(&fmd->media_dev); - clk_put(fmd->clk_bayer); + + if (!IS_ERR(fmd->clk_bayer)) + clk_put(fmd->clk_bayer); return 0; } |