aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/tegra/dsi.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-11-13 08:27:29 -0500
committerThierry Reding <treding@nvidia.com>2014-11-13 10:12:10 -0500
commit183ef2883d060d69d17d63f7c56fbf1a5d65e3f9 (patch)
treeaf87185c07e47a1c0397723922b03d279bcaedad /drivers/gpu/drm/tegra/dsi.c
parent976cebc35bed0456a42bf96073a26f251d23b264 (diff)
drm/tegra: dsi: Do not manage clock on enable/disable
In preparation for supporting command mode panels, don't disable the clock when the output is disabled. The output will be enabled only after the panel has been programmed in command mode, so the clock must always remain on. As a side-effect, pad calibration now only needs to be done at driver probe time, since neither power nor controller state will go away before driver removal. While at it, use a 32-bit variable to store register content because the registers are 32-bit even on 64-bit Tegra. Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/drm/tegra/dsi.c')
-rw-r--r--drivers/gpu/drm/tegra/dsi.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
index 584b771d8b2f..c62f68071ade 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -456,12 +456,6 @@ static int tegra_output_dsi_enable(struct tegra_output *output)
456 if (err < 0) 456 if (err < 0)
457 return err; 457 return err;
458 458
459 err = clk_enable(dsi->clk);
460 if (err < 0)
461 return err;
462
463 reset_control_deassert(dsi->rst);
464
465 value = DSI_CONTROL_CHANNEL(0) | DSI_CONTROL_FORMAT(format) | 459 value = DSI_CONTROL_CHANNEL(0) | DSI_CONTROL_FORMAT(format) |
466 DSI_CONTROL_LANES(dsi->lanes - 1) | 460 DSI_CONTROL_LANES(dsi->lanes - 1) |
467 DSI_CONTROL_SOURCE(dc->pipe); 461 DSI_CONTROL_SOURCE(dc->pipe);
@@ -576,8 +570,6 @@ static int tegra_output_dsi_disable(struct tegra_output *output)
576 tegra_dc_writel(dc, GENERAL_ACT_REQ, DC_CMD_STATE_CONTROL); 570 tegra_dc_writel(dc, GENERAL_ACT_REQ, DC_CMD_STATE_CONTROL);
577 } 571 }
578 572
579 clk_disable(dsi->clk);
580
581 dsi->enabled = false; 573 dsi->enabled = false;
582 574
583 return 0; 575 return 0;
@@ -695,7 +687,7 @@ static int tegra_dsi_pad_enable(struct tegra_dsi *dsi)
695 687
696static int tegra_dsi_pad_calibrate(struct tegra_dsi *dsi) 688static int tegra_dsi_pad_calibrate(struct tegra_dsi *dsi)
697{ 689{
698 unsigned long value; 690 u32 value;
699 691
700 tegra_dsi_writel(dsi, 0, DSI_PAD_CONTROL_0); 692 tegra_dsi_writel(dsi, 0, DSI_PAD_CONTROL_0);
701 tegra_dsi_writel(dsi, 0, DSI_PAD_CONTROL_1); 693 tegra_dsi_writel(dsi, 0, DSI_PAD_CONTROL_1);
@@ -736,12 +728,6 @@ static int tegra_dsi_init(struct host1x_client *client)
736 dev_err(dsi->dev, "debugfs setup failed: %d\n", err); 728 dev_err(dsi->dev, "debugfs setup failed: %d\n", err);
737 } 729 }
738 730
739 err = tegra_dsi_pad_calibrate(dsi);
740 if (err < 0) {
741 dev_err(dsi->dev, "MIPI calibration failed: %d\n", err);
742 return err;
743 }
744
745 return 0; 731 return 0;
746} 732}
747 733
@@ -863,6 +849,13 @@ static int tegra_dsi_probe(struct platform_device *pdev)
863 if (IS_ERR(dsi->rst)) 849 if (IS_ERR(dsi->rst))
864 return PTR_ERR(dsi->rst); 850 return PTR_ERR(dsi->rst);
865 851
852 err = reset_control_deassert(dsi->rst);
853 if (err < 0) {
854 dev_err(&pdev->dev, "failed to bring DSI out of reset: %d\n",
855 err);
856 return err;
857 }
858
866 dsi->clk = devm_clk_get(&pdev->dev, NULL); 859 dsi->clk = devm_clk_get(&pdev->dev, NULL);
867 if (IS_ERR(dsi->clk)) { 860 if (IS_ERR(dsi->clk)) {
868 dev_err(&pdev->dev, "cannot get DSI clock\n"); 861 dev_err(&pdev->dev, "cannot get DSI clock\n");
@@ -926,6 +919,12 @@ static int tegra_dsi_probe(struct platform_device *pdev)
926 if (IS_ERR(dsi->mipi)) 919 if (IS_ERR(dsi->mipi))
927 return PTR_ERR(dsi->mipi); 920 return PTR_ERR(dsi->mipi);
928 921
922 err = tegra_dsi_pad_calibrate(dsi);
923 if (err < 0) {
924 dev_err(dsi->dev, "MIPI calibration failed: %d\n", err);
925 return err;
926 }
927
929 dsi->host.ops = &tegra_dsi_host_ops; 928 dsi->host.ops = &tegra_dsi_host_ops;
930 dsi->host.dev = &pdev->dev; 929 dsi->host.dev = &pdev->dev;
931 930