Commit 64230aa0 authored by Jon Hunter's avatar Jon Hunter Committed by Thierry Reding

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: default avatarJon Hunter <jonathanh@nvidia.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 30b49435
...@@ -1489,9 +1489,11 @@ static int tegra_dsi_probe(struct platform_device *pdev) ...@@ -1489,9 +1489,11 @@ static int tegra_dsi_probe(struct platform_device *pdev)
dsi->format = MIPI_DSI_FMT_RGB888; dsi->format = MIPI_DSI_FMT_RGB888;
dsi->lanes = 4; dsi->lanes = 4;
dsi->rst = devm_reset_control_get(&pdev->dev, "dsi"); if (!pdev->dev.pm_domain) {
if (IS_ERR(dsi->rst)) dsi->rst = devm_reset_control_get(&pdev->dev, "dsi");
return PTR_ERR(dsi->rst); if (IS_ERR(dsi->rst))
return PTR_ERR(dsi->rst);
}
dsi->clk = devm_clk_get(&pdev->dev, NULL); dsi->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(dsi->clk)) { if (IS_ERR(dsi->clk)) {
...@@ -1592,10 +1594,12 @@ static int tegra_dsi_suspend(struct device *dev) ...@@ -1592,10 +1594,12 @@ static int tegra_dsi_suspend(struct device *dev)
struct tegra_dsi *dsi = dev_get_drvdata(dev); struct tegra_dsi *dsi = dev_get_drvdata(dev);
int err; int err;
err = reset_control_assert(dsi->rst); if (dsi->rst) {
if (err < 0) { err = reset_control_assert(dsi->rst);
dev_err(dev, "failed to assert reset: %d\n", err); if (err < 0) {
return err; dev_err(dev, "failed to assert reset: %d\n", err);
return err;
}
} }
usleep_range(1000, 2000); usleep_range(1000, 2000);
...@@ -1633,10 +1637,12 @@ static int tegra_dsi_resume(struct device *dev) ...@@ -1633,10 +1637,12 @@ static int tegra_dsi_resume(struct device *dev)
usleep_range(1000, 2000); usleep_range(1000, 2000);
err = reset_control_deassert(dsi->rst); if (dsi->rst) {
if (err < 0) { err = reset_control_deassert(dsi->rst);
dev_err(dev, "cannot assert reset: %d\n", err); if (err < 0) {
goto disable_clk_lp; dev_err(dev, "cannot assert reset: %d\n", err);
goto disable_clk_lp;
}
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment