diff options
author | Kevin Huang <kevinh@nvidia.com> | 2011-07-15 02:31:19 -0700 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-07-26 16:47:37 -0700 |
commit | fffc39c3565be6cac129a85957f971cd702c3df1 (patch) | |
tree | ec9de2fdf395ee0e17cfef3e62b336a3970ee15c /drivers | |
parent | 58ed5495f0175beb7514f2c2e0141e30ab14ab97 (diff) |
video: tegra: dsi: Fix DC & DSI clock issue.
- Balance the clock disable/enable in DSI module to fix the issue that
DC can't be disabled in suspend.
Bug 847254
Change-Id: I1beaab6d0ba96e9b886526c1f07107b8d27bcf94
Reviewed-on: http://git-master/r/41180
Reviewed-by: Kevin Huang <kevinh@nvidia.com>
Tested-by: Kevin Huang <kevinh@nvidia.com>
Reviewed-by: Chih-Lung Huang <lhuang@nvidia.com>
Tested-by: Chih-Lung Huang <lhuang@nvidia.com>
Reviewed-by: Jonathan Mayo <jmayo@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/tegra/dc/dsi.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/video/tegra/dc/dsi.c b/drivers/video/tegra/dc/dsi.c index 74a27db171fc..85473db12429 100644 --- a/drivers/video/tegra/dc/dsi.c +++ b/drivers/video/tegra/dc/dsi.c @@ -99,6 +99,7 @@ struct tegra_dc_dsi_data { struct clk *dc_clk; struct clk *dsi_clk; + bool clk_ref; struct mutex lock; @@ -419,6 +420,7 @@ static void tegra_dsi_init_sw(struct tegra_dc *dc, dsi->controller_index = dc->ndev->id; dsi->ulpm = false; dsi->enabled = false; + dsi->clk_ref = false; dsi->dsi_control_val = DSI_CONTROL_VIRTUAL_CHANNEL(dsi->info.virtual_channel) | @@ -467,7 +469,6 @@ static void tegra_dsi_init_sw(struct tegra_dc *dc, dsi->target_hs_clk_khz); dsi->controller_index = dc->ndev->id; - dsi->ulpm = false; #if DSI_USE_SYNC_POINTS dsi->syncpt_id = NVSYNCPT_DSI; @@ -903,8 +904,6 @@ static void tegra_dsi_set_dc_clk(struct tegra_dc *dc, val = PIXEL_CLK_DIVIDER_PCD1 | SHIFT_CLK_DIVIDER(shift_clk_div_register); tegra_dc_writel(dc, val, DC_DISP_DISP_CLOCK_CONTROL); - - clk_enable(dsi->dc_clk); } static void tegra_dsi_set_dsi_clk(struct tegra_dc *dc, @@ -921,6 +920,10 @@ static void tegra_dsi_set_dsi_clk(struct tegra_dc *dc, dc->mode.pclk = clk*1000; tegra_dc_setup_clk(dc, dsi->dsi_clk); + if (dsi->clk_ref == true) + clk_disable(dsi->dsi_clk); + else + dsi->clk_ref = true; clk_enable(dsi->dsi_clk); tegra_periph_reset_deassert(dsi->dsi_clk); @@ -2125,6 +2128,7 @@ static void tegra_dc_dsi_suspend(struct tegra_dc *dc) dsi->enabled = false; clk_disable(dsi->dsi_clk); + dsi->clk_ref = false; fail: mutex_unlock(&dsi->lock); tegra_dc_io_end(dc); |