]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: sor: Fix detach sequence
authorAnimehs Kishore <ankishore@nvidia.com>
Mon, 29 Jun 2015 13:53:12 +0000 (19:23 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Sat, 5 Sep 2015 09:20:35 +0000 (02:20 -0700)
- Add polling for head op mode sleep completion
- fix head op mode final state
- refactor for better code utilization across all chips

Bug 200103501

Change-Id: Iede7d004558149e29e5c9e7d90010ff8f606215f
Signed-off-by: Animesh Kishore <ankishore@nvidia.com>
Reviewed-on: http://git-master/r/762361
(cherry picked from commit c5c4e9217ccbe4d6eb2a9fef3998cab642b6a2b6)
Reviewed-on: http://git-master/r/780903
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Santosh Galma <galmar@nvidia.com>
Reviewed-by: Shu Zhong <shuz@nvidia.com>
Tested-by: Shu Zhong <shuz@nvidia.com>
Reviewed-by: Mitch Luban <mluban@nvidia.com>
drivers/video/tegra/dc/sor.c

index c2969f14be08163878fc51b9d8dd8a9e53f9f210..c21383898486e57932f2b073665e583f72799304 100644 (file)
@@ -1643,8 +1643,6 @@ void tegra_dc_sor_pre_detach(struct tegra_dc_sor_data *sor)
                NV_SOR_SUPER_STATE1_ASY_ORMODE_SAFE |
                NV_SOR_SUPER_STATE1_ATTACHED_YES);
        tegra_dc_sor_super_update(sor);
-
-       tegra_dc_sor_disable_win_short_raster(dc, sor->dc_reg_ctx);
 #else
        tegra_sor_writel(sor, NV_SOR_SUPER_STATE1,
                NV_SOR_SUPER_STATE1_ASY_HEAD_OP_AWAKE |
@@ -1657,9 +1655,18 @@ void tegra_dc_sor_pre_detach(struct tegra_dc_sor_data *sor)
                NV_SOR_SUPER_STATE1_ASY_ORMODE_SAFE |
                NV_SOR_SUPER_STATE1_ATTACHED_YES);
        tegra_dc_sor_super_update(sor);
+#endif
+
+       if (tegra_dc_sor_poll_register(sor, NV_SOR_TEST,
+               NV_SOR_TEST_ACT_HEAD_OPMODE_DEFAULT_MASK,
+               NV_SOR_TEST_ACT_HEAD_OPMODE_SLEEP,
+               100, TEGRA_SOR_ATTACH_TIMEOUT_MS)) {
+               dev_err(&dc->ndev->dev,
+                       "dc timeout waiting for OPMOD = SLEEP\n");
+       }
 
        tegra_dc_sor_disable_win_short_raster(dc, sor->dc_reg_ctx);
-#endif
+
        sor->sor_state = SOR_DETACHING;
        tegra_dc_put(dc);
 }
@@ -1678,24 +1685,11 @@ void tegra_dc_sor_detach(struct tegra_dc_sor_data *sor)
        if (sor->sor_state != SOR_DETACHING)
                tegra_dc_sor_pre_detach(sor);
 
-#if defined(CONFIG_ARCH_TEGRA_12x_SOC) || defined(CONFIG_ARCH_TEGRA_13x_SOC)
-       if (tegra_dc_sor_poll_register(sor, NV_SOR_TEST,
-               NV_SOR_TEST_ACT_HEAD_OPMODE_DEFAULT_MASK,
-               NV_SOR_TEST_ACT_HEAD_OPMODE_SLEEP,
-               100, TEGRA_SOR_ATTACH_TIMEOUT_MS)) {
-               dev_err(&dc->ndev->dev,
-                       "dc timeout waiting for OPMOD = SLEEP\n");
-       }
-
        tegra_sor_writel(sor, NV_SOR_SUPER_STATE1,
                NV_SOR_SUPER_STATE1_ASY_HEAD_OP_SLEEP |
                NV_SOR_SUPER_STATE1_ASY_ORMODE_SAFE |
                NV_SOR_SUPER_STATE1_ATTACHED_NO);
-#else
-       tegra_sor_writel(sor, NV_SOR_SUPER_STATE1,
-               NV_SOR_SUPER_STATE1_ASY_HEAD_OP_AWAKE |
-               NV_SOR_SUPER_STATE1_ASY_ORMODE_SAFE |
-               NV_SOR_SUPER_STATE1_ATTACHED_NO);
+       tegra_dc_sor_super_update(sor);
 
        if (tegra_dc_sor_poll_register(sor, NV_SOR_TEST,
                NV_SOR_TEST_ATTACHED_DEFAULT_MASK,
@@ -1710,7 +1704,7 @@ void tegra_dc_sor_detach(struct tegra_dc_sor_data *sor)
                NV_SOR_STATE1_ASY_SUBOWNER_NONE |
                NV_SOR_STATE1_ASY_PROTOCOL_LVDS_CUSTOM);
        tegra_dc_sor_update(sor);
-#endif
+
        tegra_sor_stop_dc(sor);
 
        tegra_dc_sor_restore_win_and_raster(dc, sor->dc_reg_ctx);