]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
drm/tegra: sor: Reset during initialization
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Mon, 30 Mar 2015 08:33:03 +0000 (10:33 +0200)
committerThierry Reding <treding@nvidia.com>
Thu, 2 Apr 2015 16:49:24 +0000 (18:49 +0200)
As there isn't a way for the firmware on the Nyan Chromebooks to hand
over the display to the kernel, and the kernel isn't redoing the whole
configuration at present.

With this patch, the SOR is brought to a known state and we get correct
display on every boot.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/sor.c

index 41c5a6ed2c367b8f7f4e216e8554581ae457841a..7591d8901f9a24ddd61d035500116c617e4df3f6 100644 (file)
@@ -1512,12 +1512,30 @@ static int tegra_sor_init(struct host1x_client *client)
                }
        }
 
+       /*
+        * XXX: Remove this reset once proper hand-over from firmware to
+        * kernel is possible.
+        */
+       err = reset_control_assert(sor->rst);
+       if (err < 0) {
+               dev_err(sor->dev, "failed to assert SOR reset: %d\n", err);
+               return err;
+       }
+
        err = clk_prepare_enable(sor->clk);
        if (err < 0) {
                dev_err(sor->dev, "failed to enable clock: %d\n", err);
                return err;
        }
 
+       usleep_range(1000, 3000);
+
+       err = reset_control_deassert(sor->rst);
+       if (err < 0) {
+               dev_err(sor->dev, "failed to deassert SOR reset: %d\n", err);
+               return err;
+       }
+
        err = clk_prepare_enable(sor->clk_safe);
        if (err < 0)
                return err;