display: Update the DCS commands for panel scan direction

Update the NT35510 panel scan direction DCS commands to DOCPTR
instead of MADCTL commands. This helps in proper scan direction
of the panel and avoids tearing issues.

CRs-fixed: 401084
Change-Id: Id0dbcbb4275f11ca3372075b2fcbdbcb41e5db77
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
diff --git a/dev/panel/msm/mipi_nt35510.c b/dev/panel/msm/mipi_nt35510.c
index 7d52be5..f407895 100644
--- a/dev/panel/msm/mipi_nt35510.c
+++ b/dev/panel/msm/mipi_nt35510.c
@@ -37,13 +37,6 @@
 #include <target/display.h>
 #include <dev/gpio.h>
 
-static char cmd_rotate[4]= {0x36, 0xc0, 0x15, 0x80};
-
-static struct mipi_dsi_cmd nt35510_panel_rotate_cmds[] = {
-	{sizeof(cmd_rotate), cmd_rotate},
-};
-
-
 int mipi_nt35510_panel_dsi_config(int on)
 {
 	if (on) {
@@ -82,11 +75,3 @@
 	return 0;
 }
 
-int mipi_nt35510_panel_wvga_rotate()
-{
-        int ret = NO_ERROR;
-
-        ret = mipi_dsi_cmds_tx(nt35510_panel_rotate_cmds, ARRAY_SIZE(nt35510_panel_rotate_cmds));
-
-        return ret;
-}
diff --git a/dev/panel/msm/mipi_nt35510_cmd_wvga.c b/dev/panel/msm/mipi_nt35510_cmd_wvga.c
index 63e4c04..e79921f 100644
--- a/dev/panel/msm/mipi_nt35510_cmd_wvga.c
+++ b/dev/panel/msm/mipi_nt35510_cmd_wvga.c
@@ -36,8 +36,6 @@
 #include <debug.h>
 #include <target/display.h>
 
-extern int mipi_nt35510_panel_wvga_rotate();
-
 /* MIPI NT35510 panel commands */
 static char exit_sleep[4] = {0x11, 0x00, 0x05, 0x80};
 static char display_on[4] = {0x29, 0x00, 0x05, 0x80};
@@ -183,6 +181,9 @@
 static char cmd19[8] = {
 	0x03, 0x00, 0x29, 0xc0, 0xB1, 0xEC, 0x00, 0xff,
 };
+static char cmd19_rotate[8] = {
+	0x03, 0x00, 0x29, 0xc0, 0xB1, 0xEC, 0x06, 0xff,
+};
 static char cmd20[8] = {
 	0x04, 0x00, 0x29, 0xc0, 0xBC, 0x05, 0x05, 0x05,
 };
@@ -253,6 +254,10 @@
 	{sizeof(write_ram), write_ram},
 };
 
+static struct mipi_dsi_cmd nt35510_cmd_rotate_cmds[] = {
+	{sizeof(cmd19_rotate), cmd19_rotate},
+};
+
 int mipi_nt35510_cmd_wvga_on()
 {
 	int ret = NO_ERROR;
@@ -265,6 +270,15 @@
 	return ret;
 }
 
+int mipi_nt35510_cmd_wvga_rotate()
+{
+        int ret = NO_ERROR;
+
+        ret = mipi_dsi_cmds_tx(nt35510_cmd_rotate_cmds, ARRAY_SIZE(nt35510_cmd_rotate_cmds));
+
+        return ret;
+}
+
 int mipi_nt35510_cmd_wvga_config(void *pdata)
 {
 	int ret = NO_ERROR;
@@ -325,7 +339,7 @@
 	pinfo->on = mipi_nt35510_cmd_wvga_on;
 	pinfo->off = mipi_nt35510_cmd_wvga_off;
 	pinfo->config = mipi_nt35510_cmd_wvga_config;
-	pinfo->rotate = mipi_nt35510_panel_wvga_rotate;
+	pinfo->rotate = mipi_nt35510_cmd_wvga_rotate;
 
 	return;
 }
diff --git a/dev/panel/msm/mipi_nt35510_video_wvga.c b/dev/panel/msm/mipi_nt35510_video_wvga.c
index a84906a..2c476d6 100644
--- a/dev/panel/msm/mipi_nt35510_video_wvga.c
+++ b/dev/panel/msm/mipi_nt35510_video_wvga.c
@@ -39,7 +39,6 @@
 #include <dev/gpio.h>
 
 
-extern int mipi_nt35510_panel_wvga_rotate();
 /* MIPI NT35510 panel commands */
 static char exit_sleep[4] = {0x11, 0x00, 0x09, 0x80};
 static char display_on[4] = {0x29, 0x00, 0x05, 0x80};
@@ -184,6 +183,9 @@
 static char video19[8] = {
 	0x03, 0x00, 0x29, 0xc0, 0xB1, 0xFC, 0x00, 0xff,
 };
+static char video19_rotate[8] = {
+	0x03, 0x00, 0x29, 0xc0, 0xB1, 0xFC, 0x06, 0xff,
+};
 static char video20[8] = {
 	0x04, 0x00, 0x29, 0xc0, 0xBC, 0x05, 0x05, 0x05,
 };
@@ -251,6 +253,10 @@
 	{sizeof(display_on), display_on},
 };
 
+static struct mipi_dsi_cmd nt35510_video_rotate_cmds[] = {
+	{sizeof(video19_rotate), video19_rotate},
+};
+
 int mipi_nt35510_video_wvga_config(void *pdata)
 {
 	int ret = NO_ERROR;
@@ -303,6 +309,15 @@
 	return ret;
 }
 
+int mipi_nt35510_video_wvga_rotate()
+{
+        int ret = NO_ERROR;
+
+        ret = mipi_dsi_cmds_tx(nt35510_video_rotate_cmds, ARRAY_SIZE(nt35510_video_rotate_cmds));
+
+        return ret;
+}
+
 static struct mipi_dsi_phy_ctrl dsi_video_mode_phy_db = {
 	/* DSI_BIT_CLK at 500MHz, 2 lane, RGB888 */
 	{0x03, 0x01, 0x01, 0x00},	/* regulator */
@@ -351,7 +366,7 @@
 	pinfo->on = mipi_nt35510_video_wvga_on;
 	pinfo->off = mipi_nt35510_video_wvga_off;
 	pinfo->config = mipi_nt35510_video_wvga_config;
-	pinfo->rotate = mipi_nt35510_panel_wvga_rotate;
+	pinfo->rotate = mipi_nt35510_video_wvga_rotate;
 
 	return;
 }