video: tegra: dsi: Enable pllp_outx during bta operation
Animesh Kishore [Fri, 2 Nov 2012 10:47:57 +0000 (15:47 +0530)]
dsi hw needs pllp_outx only for read operations.

Bug 1155689

Change-Id: I29479dcace9dfeb52454d396404f6d29990c15b8
Signed-off-by: Animesh Kishore <ankishore@nvidia.com>
Reviewed-on: http://git-master/r/160858
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

drivers/video/tegra/dc/dsi.c

index 87db9c7..b4b19ca 100644 (file)
@@ -404,19 +404,17 @@ static inline void tegra_dc_dsi_debug_create(struct tegra_dc_dsi_data *dsi)
 
 static inline void tegra_dsi_clk_enable(struct tegra_dc_dsi_data *dsi)
 {
-       if (!tegra_is_clk_enabled(dsi->dsi_clk)) {
+       if (!tegra_is_clk_enabled(dsi->dsi_clk))
                clk_prepare_enable(dsi->dsi_clk);
-               clk_prepare_enable(dsi->dsi_fixed_clk);
-       }
+
        tegra_mipi_cal_clk_enable(dsi->mipi_cal);
 }
 
 static inline void tegra_dsi_clk_disable(struct tegra_dc_dsi_data *dsi)
 {
-       if (tegra_is_clk_enabled(dsi->dsi_clk)) {
+       if (tegra_is_clk_enabled(dsi->dsi_clk))
                clk_disable_unprepare(dsi->dsi_clk);
-               clk_disable_unprepare(dsi->dsi_fixed_clk);
-       }
+
        tegra_mipi_cal_clk_disable(dsi->mipi_cal);
 }
 
@@ -2989,6 +2987,7 @@ int tegra_dsi_read_data(struct tegra_dc *dc,
 
        mutex_lock(&dsi->lock);
        tegra_dc_io_start(dc);
+       clk_prepare_enable(dsi->dsi_fixed_clk);
 
        init_status = tegra_dsi_prepare_host_transmission(
                                dc, dsi, DSI_LP_OP_WRITE);
@@ -3045,6 +3044,7 @@ fail:
        err = tegra_dsi_restore_state(dc, dsi, init_status);
        if (err < 0)
                dev_err(&dc->ndev->dev, "Failed to restore prev state\n");
+       clk_disable_unprepare(dsi->dsi_fixed_clk);
        tegra_dc_io_end(dc);
        mutex_unlock(&dsi->lock);
        return err;
@@ -3061,6 +3061,7 @@ int tegra_dsi_panel_sanity_check(struct tegra_dc *dc,
                        DSI_CMD_SHORT(0x05, 0x0, 0x0);
 
        tegra_dc_io_start(dc);
+       clk_prepare_enable(dsi->dsi_fixed_clk);
 
        init_status = tegra_dsi_prepare_host_transmission(
                                        dc, dsi, DSI_LP_OP_WRITE);
@@ -3108,6 +3109,7 @@ fail:
        err = tegra_dsi_restore_state(dc, dsi, init_status);
        if (err < 0)
                dev_err(&dc->ndev->dev, "Failed to restore prev state\n");
+       clk_disable_unprepare(dsi->dsi_fixed_clk);
        tegra_dc_io_end(dc);
        return err;
 }