diff options
author | Chaitanya Bandi <bandik@nvidia.com> | 2013-01-09 14:09:48 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 12:49:28 -0700 |
commit | 30c1cb2cef70563375ae10e6a945862fc7deaa85 (patch) | |
tree | bc7e983bfd1b0d5e867da1263ab72abdc71a84cc /drivers/mipi_bif | |
parent | 03a5179d9490f5c9c042553e7963c14f04ee9317 (diff) |
mipi_bif: tegra: Add stub Runtime PM
Added Stub Runtime PM for Tegra MIPIBIF.
Bug 1165232
Change-Id: I61d5011c3bda51303387885ccabc70a2529707fc
Signed-off-by: Chaitanya Bandi <bandik@nvidia.com>
Reviewed-on: http://git-master/r/189877
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Diffstat (limited to 'drivers/mipi_bif')
-rw-r--r-- | drivers/mipi_bif/mipi-bif-tegra.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/mipi_bif/mipi-bif-tegra.c b/drivers/mipi_bif/mipi-bif-tegra.c index f336771646d2..db2161ea2b43 100644 --- a/drivers/mipi_bif/mipi-bif-tegra.c +++ b/drivers/mipi_bif/mipi-bif-tegra.c @@ -28,6 +28,7 @@ #include <linux/delay.h> #include <linux/slab.h> #include <linux/mipi-bif-tegra.h> +#include <linux/pm_runtime.h> #include <mach/clk.h> #define TEGRA_MIPIBIF_TIMEOUT 1000 @@ -479,6 +480,8 @@ tegra_mipi_bif_program_timings(struct tegra_mipi_bif_dev *mipi_bif_dev) static int tegra_mipi_bif_init(struct tegra_mipi_bif_dev *mipi_bif_dev) { u32 fifo_control; + + pm_runtime_get_sync(mipi_bif_dev->dev); clk_prepare_enable(mipi_bif_dev->mipi_bif_clk); tegra_periph_reset_assert(mipi_bif_dev->mipi_bif_clk); @@ -497,6 +500,7 @@ static int tegra_mipi_bif_init(struct tegra_mipi_bif_dev *mipi_bif_dev) tegra_mipi_bif_program_timings(mipi_bif_dev); clk_disable_unprepare(mipi_bif_dev->mipi_bif_clk); + pm_runtime_put(mipi_bif_dev->dev); return 0; } @@ -613,7 +617,7 @@ tegra_mipi_bif_xfer(struct mipi_bif_adapter *adap, struct mipi_bif_msg *msg) } tegra_mipi_bif_init(mipi_bif_dev); - + pm_runtime_get_sync(mipi_bif_dev->dev); clk_prepare_enable(mipi_bif_dev->mipi_bif_clk); tegra_mipi_bif_flush_fifos(mipi_bif_dev); @@ -758,6 +762,7 @@ tegra_mipi_bif_xfer(struct mipi_bif_adapter *adap, struct mipi_bif_msg *msg) ret = -EIO; clk_disable_unprepare(mipi_bif_dev->mipi_bif_clk); + pm_runtime_put(mipi_bif_dev->dev); rt_mutex_unlock(&mipi_bif_dev->dev_lock); return ret; } @@ -856,7 +861,7 @@ err: static int tegra_mipi_bif_remove(struct platform_device *pdev) { - + pm_runtime_disable(&pdev->dev); return 0; } static int tegra_mipi_bif_probe(struct platform_device *pdev) @@ -922,6 +927,8 @@ static int tegra_mipi_bif_probe(struct platform_device *pdev) return ret; } + pm_runtime_enable(&pdev->dev); + platform_set_drvdata(pdev, mipi_bif_dev); rt_mutex_init(&mipi_bif_dev->dev_lock); |