Merge "target: msm8952: add support for truly 1080p panel for SDM439/SDM429"
diff --git a/dev/gcdb/display/include/panel_truly_1080p_cmd.h b/dev/gcdb/display/include/panel_truly_1080p_cmd.h
index 16b8e3a..428417f 100644
--- a/dev/gcdb/display/include/panel_truly_1080p_cmd.h
+++ b/dev/gcdb/display/include/panel_truly_1080p_cmd.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015-2016, 2018 The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -323,6 +323,14 @@
 	0x23, 0x18, 0x7, 0x8, 0x5, 0x3, 0x4, 0xa0,
 };
 
+static const uint32_t truly_1080p_cmd_12nm_timings[] = {
+  0x17, 0x0A, 0x0F, 0x06, 0x02, 0x08, 0x06, 0x0E
+};
+
+struct labibb_desc truly_1080p_cmd_labibb = {
+  0, 0, 5700000, 5700000, 5700000, 5700000, 3, 3, 1, 0
+};
+
 static struct panel_reset_sequence truly_1080p_cmd_panel_reset_seq = {
 	{ 1, 0, 1, }, { 200, 200, 200, }, 2
 };
diff --git a/dev/gcdb/display/include/panel_truly_1080p_video.h b/dev/gcdb/display/include/panel_truly_1080p_video.h
index d535f68..f92d655 100755
--- a/dev/gcdb/display/include/panel_truly_1080p_video.h
+++ b/dev/gcdb/display/include/panel_truly_1080p_video.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015-2016, 2018 The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -282,6 +282,10 @@
   0xE6, 0x38, 0x26, 0x00, 0x68, 0x6e, 0x2A, 0x3c, 0x44, 0x03, 0x04, 0x00
 };
 
+static const uint32_t truly_1080p_video_12nm_timings[] = {
+  0x17, 0x0A, 0x0F, 0x06, 0x02, 0x08, 0x06, 0x0E
+};
+
 static const uint32_t truly_1080p_14nm_video_timings[] = {
 	0x23, 0x1e, 0x8, 0x9, 0x5, 0x3, 0x4, 0xa0,
 	0x23, 0x1e, 0x8, 0x9, 0x5, 0x3, 0x4, 0xa0,
@@ -294,6 +298,10 @@
   0, 4, 0x02, 0x2d
 };
 
+struct labibb_desc truly_1080p_video_labibb = {
+  0, 0, 5700000, 5700000, 5700000, 5700000, 3, 3, 1, 0
+};
+
 static struct panel_reset_sequence truly_1080p_video_panel_reset_seq = {
 { 1, 0, 1, }, { 200, 200, 200, }, 2
 };
diff --git a/target/msm8952/oem_panel.c b/target/msm8952/oem_panel.c
index 7b26285..b0a1536 100644
--- a/target/msm8952/oem_panel.c
+++ b/target/msm8952/oem_panel.c
@@ -176,7 +176,13 @@
 	switch (panel_id) {
 	case TRULY_1080P_VIDEO_PANEL:
 		panelstruct->paneldata    = &truly_1080p_video_panel_data;
-		panelstruct->paneldata->panel_with_enable_gpio = 1;
+		panelstruct->backlightinfo = &truly_1080p_video_backlight;
+		if (platform_is_sdm439() || platform_is_sdm429()) {
+			panelstruct->paneldata->panel_with_enable_gpio = 0;
+			panelstruct->backlightinfo->bl_interface_type = 0;
+		} else {
+			panelstruct->paneldata->panel_with_enable_gpio = 1;
+		}
 		panelstruct->panelres     = &truly_1080p_video_panel_res;
 		panelstruct->color        = &truly_1080p_video_color;
 		panelstruct->videopanel   = &truly_1080p_video_video_panel;
@@ -187,7 +193,7 @@
 			= &truly_1080p_video_timing_info;
 		panelstruct->panelresetseq
 					 = &truly_1080p_video_panel_reset_seq;
-		panelstruct->backlightinfo = &truly_1080p_video_backlight;
+		pinfo->labibb = &truly_1080p_video_labibb;
 		pinfo->mipi.panel_on_cmds
 			= truly_1080p_video_on_command;
 		pinfo->mipi.num_of_panel_on_cmds
@@ -196,13 +202,24 @@
 			= truly_1080p_video_off_command;
 		pinfo->mipi.num_of_panel_off_cmds
 			= TRULY_1080P_VIDEO_OFF_COMMAND;
-		memcpy(phy_db->timing,
-			truly_1080p_video_timings, TIMING_SIZE);
+		if (phy_db->pll_type == DSI_PLL_TYPE_12NM)
+			memcpy(phy_db->timing,
+				truly_1080p_video_12nm_timings,
+				TIMING_SIZE_12NM);
+		else
+			memcpy(phy_db->timing,
+				truly_1080p_video_timings, TIMING_SIZE);
 		pinfo->mipi.signature 	= TRULY_1080P_VIDEO_SIGNATURE;
 		break;
 	case TRULY_1080P_CMD_PANEL:
 		panelstruct->paneldata    = &truly_1080p_cmd_panel_data;
-		panelstruct->paneldata->panel_with_enable_gpio = 1;
+		panelstruct->backlightinfo = &truly_1080p_cmd_backlight;
+		if (platform_is_sdm439() || platform_is_sdm429()) {
+			panelstruct->paneldata->panel_with_enable_gpio = 0;
+			panelstruct->backlightinfo->bl_interface_type = 0;
+		} else {
+			panelstruct->paneldata->panel_with_enable_gpio = 1;
+		}
 		panelstruct->panelres     = &truly_1080p_cmd_panel_res;
 		panelstruct->color        = &truly_1080p_cmd_color;
 		panelstruct->videopanel   = &truly_1080p_cmd_video_panel;
@@ -213,7 +230,7 @@
 			= &truly_1080p_cmd_timing_info;
 		panelstruct->panelresetseq
 					 = &truly_1080p_cmd_panel_reset_seq;
-		panelstruct->backlightinfo = &truly_1080p_cmd_backlight;
+		pinfo->labibb = &truly_1080p_cmd_labibb;
 		pinfo->mipi.panel_on_cmds
 			= truly_1080p_cmd_on_command;
 		pinfo->mipi.num_of_panel_on_cmds
@@ -222,8 +239,13 @@
 			= truly_1080p_cmd_off_command;
 		pinfo->mipi.num_of_panel_off_cmds
 			= TRULY_1080P_CMD_OFF_COMMAND;
-		memcpy(phy_db->timing,
-			truly_1080p_cmd_timings, TIMING_SIZE);
+		if (phy_db->pll_type == DSI_PLL_TYPE_12NM)
+			memcpy(phy_db->timing,
+				truly_1080p_cmd_12nm_timings,
+				TIMING_SIZE_12NM);
+		else
+			memcpy(phy_db->timing,
+				truly_1080p_cmd_timings, TIMING_SIZE);
 		pinfo->mipi.signature 	= TRULY_1080P_CMD_SIGNATURE;
 		break;
 	case OTM1906C_1080P_CMD_PANEL: