Commit 15f90ab5 authored by Ulf Hansson's avatar Ulf Hansson Committed by Mauro Carvalho Chehab

[media] exynos-gsc: Make driver functional when CONFIG_PM is unset

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.

[mszyprow: rebased onto v4.9-rc4]
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Tested-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent f9fd6ee6
...@@ -1085,7 +1085,7 @@ static int gsc_probe(struct platform_device *pdev) ...@@ -1085,7 +1085,7 @@ static int gsc_probe(struct platform_device *pdev)
return PTR_ERR(gsc->clock); return PTR_ERR(gsc->clock);
} }
ret = clk_prepare(gsc->clock); ret = clk_prepare_enable(gsc->clock);
if (ret) { if (ret) {
dev_err(&gsc->pdev->dev, "clock prepare failed for clock: %s\n", dev_err(&gsc->pdev->dev, "clock prepare failed for clock: %s\n",
GSC_CLOCK_GATE_NAME); GSC_CLOCK_GATE_NAME);
...@@ -1108,24 +1108,23 @@ static int gsc_probe(struct platform_device *pdev) ...@@ -1108,24 +1108,23 @@ static int gsc_probe(struct platform_device *pdev)
goto err_v4l2; goto err_v4l2;
platform_set_drvdata(pdev, gsc); platform_set_drvdata(pdev, gsc);
pm_runtime_enable(dev);
ret = pm_runtime_get_sync(&pdev->dev); gsc_hw_set_sw_reset(gsc);
if (ret < 0) gsc_wait_reset(gsc);
goto err_m2m;
vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32)); vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32));
dev_dbg(dev, "gsc-%d registered successfully\n", gsc->id); 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; return 0;
err_m2m:
gsc_unregister_m2m_device(gsc);
err_v4l2: err_v4l2:
v4l2_device_unregister(&gsc->v4l2_dev); v4l2_device_unregister(&gsc->v4l2_dev);
err_clk: err_clk:
clk_unprepare(gsc->clock); clk_disable_unprepare(gsc->clock);
return ret; return ret;
} }
......
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