]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
MLK-10232-1: vadc: Add vadc to generic pm domain
authorSandor Yu <R01008@freescale.com>
Wed, 11 Feb 2015 08:12:36 +0000 (16:12 +0800)
committerSandor Yu <R01008@freescale.com>
Thu, 12 Feb 2015 02:26:11 +0000 (10:26 +0800)
Vadc in the dispmix power domian, the register will been reset
when dispmix power off, add vadc to generic pm domain,
dispmix will not power off when vadc driver loading.

Signed-off-by: Sandor Yu <R01008@freescale.com>
(cherry picked from commit e06f7339c01d6f77a94cfc8fc22276d03841fecf)

drivers/media/platform/mxc/subdev/mxc_vadc.c

index e54c3f21264f52b9576e4aace96e6825822b217b..f77044f895b795397de6c9c585e2a74acd5e8617 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
+#include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 #include <media/v4l2-ioctl.h>
 #include <linux/videodev2.h>
@@ -726,6 +727,9 @@ static int vadc_probe(struct platform_device *pdev)
 
        vadc_v4l2_subdev_init(sd, pdev, &vadc_ops);
 
+       pm_runtime_enable(&pdev->dev);
+
+       pm_runtime_get_sync(&pdev->dev);
        /* Init VADC */
        ret = vadc_of_init(pdev);
        if (ret < 0)
@@ -736,6 +740,9 @@ static int vadc_probe(struct platform_device *pdev)
 
        return 0;
 err:
+       pm_runtime_put_sync(&pdev->dev);
+       pm_runtime_disable(&pdev->dev);
+       v4l2_async_unregister_subdev(&state->sd);
        clk_disable_unprepare(state->csi_clk);
        clk_disable_unprepare(state->vadc_clk);
        return ret;
@@ -745,6 +752,8 @@ static int vadc_remove(struct platform_device *pdev)
 {
        struct vadc_state *state = platform_get_drvdata(pdev);
 
+       pm_runtime_put_sync(&pdev->dev);
+       pm_runtime_disable(&pdev->dev);
        v4l2_async_unregister_subdev(&state->sd);
        clk_disable_unprepare(state->csi_clk);
        clk_disable_unprepare(state->vadc_clk);