diff options
author | Animesh Kishore <ankishore@nvidia.com> | 2013-10-22 17:57:04 +0530 |
---|---|---|
committer | Animesh Kishore <ankishore@nvidia.com> | 2013-10-25 05:56:14 -0700 |
commit | 9cc57b57980f7653b16d425c37ed2440d098a004 (patch) | |
tree | f5d015ce0ec3b3edde4e0b754f681802c515d457 | |
parent | cd589d9b55b1e1cbcd7a8096918433970927dade (diff) |
video: tegra: dsi: Fix explicit host trigger calls
Bug 1381539
Change-Id: I1cdd336b55152b2383343fb0a65064ce491efe5d
Signed-off-by: Animesh Kishore <ankishore@nvidia.com>
Reviewed-on: http://git-master/r/302370
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
-rw-r--r-- | drivers/video/tegra/dc/dsi.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/video/tegra/dc/dsi.c b/drivers/video/tegra/dc/dsi.c index c24d9013d9e4..be0f51a0ce00 100644 --- a/drivers/video/tegra/dc/dsi.c +++ b/drivers/video/tegra/dc/dsi.c @@ -1754,9 +1754,9 @@ static void tegra_dsi_start_dc_stream(struct tegra_dc *dc, /* set non-continuous mode */ tegra_dc_writel(dc, DISP_CTRL_MODE_NC_DISPLAY, DC_CMD_DISPLAY_COMMAND); + tegra_dc_writel(dc, GENERAL_UPDATE, DC_CMD_STATE_CONTROL); - tegra_dc_writel(dc, GENERAL_ACT_REQ | NC_HOST_TRIG, - DC_CMD_STATE_CONTROL); + tegra_dc_writel(dc, GENERAL_ACT_REQ, DC_CMD_STATE_CONTROL); if (dsi->info.te_gpio) tegra_dc_gpio_to_spio(dsi, dsi->info.te_gpio); @@ -1790,6 +1790,8 @@ static void tegra_dsi_set_dc_clk(struct tegra_dc *dc, shift_clk_div_register = 0; } + tegra_dc_get(dc); + val = PIXEL_CLK_DIVIDER_PCD1 | SHIFT_CLK_DIVIDER(shift_clk_div_register + 2); @@ -1809,6 +1811,8 @@ static void tegra_dsi_set_dc_clk(struct tegra_dc *dc, SHIFT_CLK_DIVIDER(shift_clk_div_register); tegra_dc_writel(dc, val, DC_DISP_DISP_CLOCK_CONTROL); + + tegra_dc_put(dc); } static void tegra_dsi_set_dsi_clk(struct tegra_dc *dc, @@ -3595,11 +3599,13 @@ static void tegra_dsi_send_dc_frames(struct tegra_dc *dc, * Send frames in Continuous or One-shot mode. */ if (dc->out->flags & TEGRA_DC_OUT_ONE_SHOT_MODE) { - while (no_of_frames--) { - tegra_dc_writel(dc, GENERAL_ACT_REQ | NC_HOST_TRIG, - DC_CMD_STATE_CONTROL); - mdelay(frame_period); - } + int flag = mutex_is_locked(&dc->lock); + if (flag) + mutex_unlock(&dc->lock); + while (no_of_frames--) + tegra_dc_blank(dc); + if (flag) + mutex_lock(&dc->lock); } else mdelay(no_of_frames * frame_period); @@ -4342,13 +4348,11 @@ static int tegra_dsi_te_on_off(struct tegra_dc_dsi_data *dsi, bool flag) struct tegra_dsi_cmd te_enable[] = { DSI_CMD_SHORT(DSI_DCS_WRITE_0_PARAM, DSI_DCS_SET_TEARING_EFFECT_ON, 0x0), - DSI_DLY_MS(20), }; struct tegra_dsi_cmd te_disable[] = { DSI_CMD_SHORT(DSI_DCS_WRITE_0_PARAM, DSI_DCS_SET_TEARING_EFFECT_OFF, 0x0), - DSI_DLY_MS(20), }; if (flag) @@ -4543,7 +4547,7 @@ static int tegra_dsi_host_suspend(struct tegra_dc *dc) dsi->host_suspended = true; - tegra_dsi_stop_dc_stream_at_frame_end(dc, dsi, 2); + tegra_dsi_stop_dc_stream(dc, dsi); tegra_dsi_te_on_off(dsi, false); @@ -4556,7 +4560,7 @@ static int tegra_dsi_host_suspend(struct tegra_dc *dc) /* Shutting down. Drop any reference to dc clk */ while (tegra_is_clk_enabled(dc->clk)) - clk_disable_unprepare(dc->clk); + tegra_dc_put(dc); pm_runtime_put_sync(&dc->ndev->dev); fail: @@ -4666,6 +4670,7 @@ static int tegra_dsi_host_resume(struct tegra_dc *dc) return -EINVAL; cancel_delayed_work(&dsi->idle_work); + mutex_lock(&dsi->host_lock); if (!dsi->host_suspended) { mutex_unlock(&dsi->host_lock); @@ -4673,7 +4678,6 @@ static int tegra_dsi_host_resume(struct tegra_dc *dc) } tegra_dc_io_start(dc); - clk_prepare_enable(dc->clk); pm_runtime_get_sync(&dc->ndev->dev); |