Merge "msm8x25: Add support for continuous splash screen"
diff --git a/dev/panel/msm/mipi_nt35510.c b/dev/panel/msm/mipi_nt35510.c
index d32af1e..7d52be5 100644
--- a/dev/panel/msm/mipi_nt35510.c
+++ b/dev/panel/msm/mipi_nt35510.c
@@ -48,7 +48,16 @@
 {
 	if (on) {
 		gpio_config(96, GPIO_OUTPUT);
+		/*
+		 * As per the specification follow the sequence to put lcd
+		 * backlight in one wire mode.
+		 */
 		gpio_set(96, 0x1);
+		udelay(190);
+		gpio_set(96, 0x0);
+		udelay(286);
+		gpio_set(96, 0x1);
+		udelay(50);
 
 		gpio_config(35, GPIO_OUTPUT);
 		gpio_set(35, 0x1);
@@ -64,9 +73,11 @@
 		gpio_set(85, 0x1);
 		mdelay(20);
 	} else {
-		gpio_set(96, 0x0);
-		gpio_set(35, 0x0);
-		gpio_set(40, 0x0);
+		if (!target_cont_splash_screen()) {
+			gpio_set(96, 0x0);
+			gpio_set(35, 0x0);
+			gpio_set(40, 0x0);
+		}
 	}
 	return 0;
 }
diff --git a/platform/msm_shared/mdp3.c b/platform/msm_shared/mdp3.c
index 7f57661..9271de3 100644
--- a/platform/msm_shared/mdp3.c
+++ b/platform/msm_shared/mdp3.c
@@ -113,28 +113,33 @@
 
 void mdp_disable(void)
 {
-	writel(0x00000000, MDP_DSI_VIDEO_EN);
+	if (!target_cont_splash_screen())
+		writel(0x00000000, MDP_DSI_VIDEO_EN);
 }
 
 int mdp_dsi_video_off(void)
 {
-	mdp_disable();
-	mdelay(60);
-	writel(0x00000000, MDP_INTR_ENABLE);
-	writel(0x01ffffff, MDP_INTR_CLEAR);
+	if (!target_cont_splash_screen()) {
+		mdp_disable();
+		mdelay(60);
+		writel(0x00000000, MDP_INTR_ENABLE);
+		writel(0x01ffffff, MDP_INTR_CLEAR);
+	}
 	return NO_ERROR;
 }
 
 int mdp_dsi_cmd_off(void)
 {
-	mdp_dma_off();
-	/*
-	 * Allow sometime for the DMA channel to
-	 * stop the data transfer
-	 */
-	mdelay(10);
-	writel(0x00000000, MDP_INTR_ENABLE);
-	writel(0x01ffffff, MDP_INTR_CLEAR);
+	if (!target_cont_splash_screen()) {
+		mdp_dma_off();
+		/*
+		 * Allow sometime for the DMA channel to
+		 * stop the data transfer
+		 */
+		mdelay(10);
+		writel(0x00000000, MDP_INTR_ENABLE);
+		writel(0x01ffffff, MDP_INTR_CLEAR);
+	}
 	return NO_ERROR;
 }
 
@@ -170,7 +175,8 @@
 {
 	int ret = 0;
 
-	writel(0x00000000, MDP_DMA_P_START);
+	if (!target_cont_splash_screen())
+		writel(0x00000000, MDP_DMA_P_START);
 
 	return ret;
 }
diff --git a/platform/msm_shared/proc_comm.c b/platform/msm_shared/proc_comm.c
index 13a5d30..24e5d59 100644
--- a/platform/msm_shared/proc_comm.c
+++ b/platform/msm_shared/proc_comm.c
@@ -252,7 +252,8 @@
 
 void mdp_clock_disable(void)
 {
-	clock_disable(MDP_CLK);
+	if (!target_cont_splash_screen())
+		clock_disable(MDP_CLK);
 	clock_disable(MDP_P_CLK);
 }
 
diff --git a/target/msm7627a/include/target/display.h b/target/msm7627a/include/target/display.h
index 4494a37..db35aa4 100644
--- a/target/msm7627a/include/target/display.h
+++ b/target/msm7627a/include/target/display.h
@@ -76,4 +76,5 @@
 
 extern int mipi_dsi_phy_init(struct mipi_dsi_panel_config *);
 extern void config_renesas_dsi_video_mode(void);
+int target_cont_splash_screen(void);
 #endif
diff --git a/target/msm7627a/init.c b/target/msm7627a/init.c
index a457613..5e10708 100644
--- a/target/msm7627a/init.c
+++ b/target/msm7627a/init.c
@@ -602,3 +602,21 @@
 {
 	target_ulpi_init();
 }
+
+int target_cont_splash_screen()
+{
+	int ret = 0;
+	unsigned mach_type = 0;
+
+	mach_type = board_machtype();
+
+	switch(mach_type) {
+		case MSM8X25_EVB:
+		case MSM8X25_EVT:
+			ret = 1;
+			break;
+		default:
+			ret = 0;
+	};
+	return ret;
+}
diff --git a/target/msm7627a/rules.mk b/target/msm7627a/rules.mk
index e414c2b..758a7a8 100644
--- a/target/msm7627a/rules.mk
+++ b/target/msm7627a/rules.mk
@@ -23,6 +23,7 @@
 DEFINES += DISPLAY_MIPI_PANEL_RENESAS=1
 DEFINES += USE_PCOM_SECBOOT=1
 DEFINES += TARGET_USES_GIC_VIC=1
+DEFINES += MIPI_VIDEO_MODE=0
 
 MODULES += \
 	dev/keys \
diff --git a/target/msm7627a/target_display.c b/target/msm7627a/target_display.c
index d92dd1e..92a4a93 100644
--- a/target/msm7627a/target_display.c
+++ b/target/msm7627a/target_display.c
@@ -64,7 +64,11 @@
 	case MSM7X27A_SURF:
 	case MSM8X25_SURF:
 	case MSM7X27A_FFA:
+#if MIPI_VIDEO_MODE
+		mipi_renesas_video_fwvga_init(&(panel.panel_info));
+#else
 		mipi_renesas_cmd_fwvga_init(&(panel.panel_info));
+#endif
 		panel.clk_func = msm7627a_mdp_clock_init;
 		panel.power_func = mipi_renesas_panel_dsi_config;
 		panel.fb.base = MIPI_FB_ADDR;
@@ -77,7 +81,11 @@
 		break;
 	case MSM7X25A_SURF:
 	case MSM7X25A_FFA:
+#if MIPI_VIDEO_MODE
+		mipi_renesas_video_hvga_init(&(panel.panel_info));
+#else
 		mipi_renesas_cmd_hvga_init(&(panel.panel_info));
+#endif
 		panel.clk_func = msm7627a_mdp_clock_init;
 		panel.power_func = mipi_renesas_panel_dsi_config;
 		panel.fb.base = MIPI_FB_ADDR;
@@ -91,7 +99,11 @@
 	case MSM7X27A_EVB:
 	case MSM8X25_EVB:
 	case MSM8X25_EVT:
+#if MIPI_VIDEO_MODE
+		mipi_nt35510_video_wvga_init(&(panel.panel_info));
+#else
 		mipi_nt35510_cmd_wvga_init(&(panel.panel_info));
+#endif
 		panel.clk_func = msm7627a_mdp_clock_init;
 		panel.power_func = mipi_nt35510_panel_dsi_config;
 		panel.fb.base = MIPI_FB_ADDR;