aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Hunter <jonathanh@nvidia.com>2016-07-01 09:21:37 -0400
committerThierry Reding <treding@nvidia.com>2016-07-14 08:57:02 -0400
commit64230aa075864f7c8e270b583bca685304246b57 (patch)
treef89db8c1d47d3ae97ebd45701bf0a4d54980b62d
parent30b4943558b9c482c30fc09cb899d6b03f67fb11 (diff)
drm/tegra: dsi: Prepare for generic PM domain support
The DSI driver for Tegra requires the SOR power partition to be enabled. Now that Tegra supports the generic PM domain framework we manage the SOR power partition via this framework. However, the sequence for gating/ungating the SOR power partition requires that the DSI reset is asserted/de-asserted at the time the SOR power partition is gated/ungated, respectively. Now that the reset control core assumes that resets are exclusive, the Tegra generic PM domain code and the DSI driver cannot request the same reset unless we mark the reset as shared. Sharing resets will not work in this case because we cannot guarantee that the reset will be asserted/de-asserted at the appropriate time. Therefore, given that the Tegra generic PM domain code will handle the resets, do not request the reset in the DSI driver if the DSI device has a PM domain associated. Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--drivers/gpu/drm/tegra/dsi.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
index 7e75215a9de4..972618e6acf6 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -1489,9 +1489,11 @@ static int tegra_dsi_probe(struct platform_device *pdev)
1489 dsi->format = MIPI_DSI_FMT_RGB888; 1489 dsi->format = MIPI_DSI_FMT_RGB888;
1490 dsi->lanes = 4; 1490 dsi->lanes = 4;
1491 1491
1492 dsi->rst = devm_reset_control_get(&pdev->dev, "dsi"); 1492 if (!pdev->dev.pm_domain) {
1493 if (IS_ERR(dsi->rst)) 1493 dsi->rst = devm_reset_control_get(&pdev->dev, "dsi");
1494 return PTR_ERR(dsi->rst); 1494 if (IS_ERR(dsi->rst))
1495 return PTR_ERR(dsi->rst);
1496 }
1495 1497
1496 dsi->clk = devm_clk_get(&pdev->dev, NULL); 1498 dsi->clk = devm_clk_get(&pdev->dev, NULL);
1497 if (IS_ERR(dsi->clk)) { 1499 if (IS_ERR(dsi->clk)) {
@@ -1592,10 +1594,12 @@ static int tegra_dsi_suspend(struct device *dev)
1592 struct tegra_dsi *dsi = dev_get_drvdata(dev); 1594 struct tegra_dsi *dsi = dev_get_drvdata(dev);
1593 int err; 1595 int err;
1594 1596
1595 err = reset_control_assert(dsi->rst); 1597 if (dsi->rst) {
1596 if (err < 0) { 1598 err = reset_control_assert(dsi->rst);
1597 dev_err(dev, "failed to assert reset: %d\n", err); 1599 if (err < 0) {
1598 return err; 1600 dev_err(dev, "failed to assert reset: %d\n", err);
1601 return err;
1602 }
1599 } 1603 }
1600 1604
1601 usleep_range(1000, 2000); 1605 usleep_range(1000, 2000);
@@ -1633,10 +1637,12 @@ static int tegra_dsi_resume(struct device *dev)
1633 1637
1634 usleep_range(1000, 2000); 1638 usleep_range(1000, 2000);
1635 1639
1636 err = reset_control_deassert(dsi->rst); 1640 if (dsi->rst) {
1637 if (err < 0) { 1641 err = reset_control_deassert(dsi->rst);
1638 dev_err(dev, "cannot assert reset: %d\n", err); 1642 if (err < 0) {
1639 goto disable_clk_lp; 1643 dev_err(dev, "cannot assert reset: %d\n", err);
1644 goto disable_clk_lp;
1645 }
1640 } 1646 }
1641 1647
1642 return 0; 1648 return 0;