ARM: tegra: cardhu: power management fix for E1506 panel
Rakesh Iyer [Wed, 20 Jun 2012 00:52:52 +0000 (17:52 -0700)]
Fix for power up/down sequencing for 720p DSI panel on the E1506.

Bug 997484.

Change-Id: Ia65e20b96da3bad0703136839eaf0394f9c7b364
Signed-off-by: Rakesh Iyer <riyer@nvidia.com>
Reviewed-on: http://git-master/r/109918
(cherry picked from commit c6f7033ddbc18a4b780620d1e7d65fe2ce5e4108)
Reviewed-on: http://git-master/r/111945
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Animesh Kishore <ankishore@nvidia.com>
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
GVS: Gerrit_Virtual_Submit

arch/arm/mach-tegra/board-cardhu-panel.c

index 2a9e520..4fde792 100644 (file)
@@ -137,7 +137,6 @@ static tegra_dc_bl_output cardhu_bl_output_measured = {
 
 static p_tegra_dc_bl_output bl_output = cardhu_bl_output_measured;
 
-static bool kernel_1st_panel_init = true;
 static bool is_panel_218;
 static bool is_panel_219;
 static bool is_panel_1506;
@@ -802,7 +801,7 @@ static int cardhu_dsi_panel_enable(void)
                }
 
                gpio_set_value(e1506_dsi_vddio, 1);
-               mdelay(10);
+               mdelay(1);
                gpio_set_value(e1506_panel_enb, 1);
                mdelay(10);
                gpio_set_value(e1506_bl_enb, 1);
@@ -881,15 +880,12 @@ static int cardhu_dsi_panel_disable(void)
        } else if (is_panel_1506) {
                tegra_gpio_disable(e1506_bl_enb);
                gpio_free(e1506_bl_enb);
+               tegra_gpio_disable(cardhu_dsi_pnl_reset);
+               gpio_free(cardhu_dsi_pnl_reset);
                tegra_gpio_disable(e1506_panel_enb);
                gpio_free(e1506_panel_enb);
                tegra_gpio_disable(e1506_dsi_vddio);
                gpio_free(e1506_dsi_vddio);
-               if (kernel_1st_panel_init != true) {
-                       tegra_gpio_disable(cardhu_dsi_pnl_reset);
-                       gpio_free(cardhu_dsi_pnl_reset);
-               } else
-                       kernel_1st_panel_init = false;
        }
        return err;
 }
@@ -970,6 +966,12 @@ static struct tegra_dsi_cmd dsi_suspend_cmd[] = {
        DSI_DLY_MS(5),
 };
 
+static struct tegra_dsi_cmd dsi_suspend_cmd_1506[] = {
+       DSI_CMD_SHORT(0x05, 0x28, 0x00),
+       DSI_CMD_SHORT(0x05, 0x10, 0x00),
+       DSI_DLY_MS(120),
+};
+
 struct tegra_dsi_out cardhu_dsi = {
        .n_data_lanes = 2,
        .pixel_format = TEGRA_DSI_PIXEL_FORMAT_24BIT_P,
@@ -1256,6 +1258,8 @@ static void cardhu_panel_preinit(void)
 
                cardhu_dsi.n_init_cmd = ARRAY_SIZE(dsi_init_cmd);
                cardhu_dsi.dsi_init_cmd = dsi_init_cmd;
+               cardhu_dsi.n_suspend_cmd = ARRAY_SIZE(dsi_suspend_cmd);
+               cardhu_dsi.dsi_suspend_cmd = dsi_suspend_cmd;
 
                if (is_panel_218) {
                        cardhu_disp1_out.modes  = cardhu_dsi_modes_218;
@@ -1275,6 +1279,10 @@ static void cardhu_panel_preinit(void)
                                ARRAY_SIZE(cardhu_dsi_modes_1506);
                        cardhu_dsi.n_init_cmd = ARRAY_SIZE(dsi_init_cmd_1506);
                        cardhu_dsi.dsi_init_cmd = dsi_init_cmd_1506;
+                       cardhu_dsi.n_suspend_cmd =
+                               ARRAY_SIZE(dsi_suspend_cmd_1506);
+                       cardhu_dsi.dsi_suspend_cmd = dsi_suspend_cmd_1506;
+                       cardhu_dsi.panel_send_dc_frames = true,
                        cardhu_dsi_fb_data.xres = 720;
                        cardhu_dsi_fb_data.yres = 1280;
                }