drm/tegra: dc: Perform a complete reset sequence
authorThierry Reding <treding@nvidia.com>
Wed, 30 Aug 2017 15:41:00 +0000 (17:41 +0200)
committerThierry Reding <treding@nvidia.com>
Fri, 20 Oct 2017 12:19:54 +0000 (14:19 +0200)
In order for the reset to be applied properly, the module clock must be
enabled during the assertion.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/dc.c

index d5a6323..24a5ef4 100644 (file)
@@ -1997,8 +1997,22 @@ static int tegra_dc_probe(struct platform_device *pdev)
                return PTR_ERR(dc->rst);
        }
 
-       if (!dc->soc->broken_reset)
-               reset_control_assert(dc->rst);
+       /* assert reset and disable clock */
+       if (!dc->soc->broken_reset) {
+               err = clk_prepare_enable(dc->clk);
+               if (err < 0)
+                       return err;
+
+               usleep_range(2000, 4000);
+
+               err = reset_control_assert(dc->rst);
+               if (err < 0)
+                       return err;
+
+               usleep_range(2000, 4000);
+
+               clk_disable_unprepare(dc->clk);
+       }
 
        if (dc->soc->has_powergate) {
                if (dc->pipe == 0)