target: msm8952: enable HX8399C FHD+ panel for SDM439 CDP/MTP

Add change to enable display support on SDM439 CDP/MTP with
HX8399C FHD+ video mode panel.

Change-Id: Idaed6b0dd19e2f70e3b8176d1c2431fb37580e20
diff --git a/dev/gcdb/display/include/panel_hx8399c_fhd_pluse_video.h b/dev/gcdb/display/include/panel_hx8399c_fhd_pluse_video.h
index 2915fe2..9258672 100644
--- a/dev/gcdb/display/include/panel_hx8399c_fhd_pluse_video.h
+++ b/dev/gcdb/display/include/panel_hx8399c_fhd_pluse_video.h
@@ -295,6 +295,10 @@
 	0x24, 0x1C, 0x34, 0x00, 0x58, 0x4d, 0x36, 0x3f, 0x53, 0x03, 0x04, 0x00
 };
 
+static const uint32_t hx8399c_fhd_pluse_video_12nm_timings[] = {
+	0x18, 0x0A, 0x10, 0x06, 0x03, 0x08, 0x06, 0x0E
+};
+
 static const uint32_t hx8399c_fhd_pluse_14nm_video_timings[] = {
 	0x24, 0x1f, 0x08, 0x09, 0x05, 0x03, 0x04, 0xa0,
 	0x24, 0x1f, 0x08, 0x09, 0x05, 0x03, 0x04, 0xa0,
@@ -321,7 +325,7 @@
 /* Backlight setting                                                         */
 /*---------------------------------------------------------------------------*/
 static struct backlight hx8399c_fhd_pluse_video_backlight = {
-	1, 1, 4095, 100, 1, "PMIC_8941"
+	0, 1, 4095, 100, 1, "PMIC_8941"
 };
 
 #define HX8399C_FHD_PLUSE_VIDEO_SIGNATURE 0xA0000
diff --git a/dev/gcdb/display/panel_display.h b/dev/gcdb/display/panel_display.h
index ed99a98..c305a4c 100755
--- a/dev/gcdb/display/panel_display.h
+++ b/dev/gcdb/display/panel_display.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2015, 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
@@ -39,6 +39,7 @@
 #define BPP_24 24
 
 #define TIMING_SIZE 48
+#define TIMING_SIZE_12NM 32
 #define REGULATOR_SIZE 28
 
 #define DUAL_DSI_FLAG 0x1
diff --git a/target/msm8952/oem_panel.c b/target/msm8952/oem_panel.c
old mode 100755
new mode 100644
index cb0e050..dde07f6
--- a/target/msm8952/oem_panel.c
+++ b/target/msm8952/oem_panel.c
@@ -63,6 +63,7 @@
 #include "include/panel_truly_wuxga_video.h"
 #include "include/panel_truly_720p_cmd.h"
 #include "include/panel_lead_fl10802_fwvga_video.h"
+#include "include/panel_hx8399c_fhd_pluse_video.h"
 
 /*---------------------------------------------------------------------------*/
 /* static panel selection variable                                           */
@@ -86,6 +87,7 @@
 	TRULY_WUXGA_VIDEO_PANEL,
 	TRULY_720P_CMD_PANEL,
 	LEAD_FL10802_FWVGA_VIDEO_PANEL,
+	HX8399C_FHD_PLUSE_VIDEO_PANEL,
 	UNKNOWN_PANEL
 };
 
@@ -116,6 +118,7 @@
 	{"truly_wuxga_video", TRULY_WUXGA_VIDEO_PANEL},
 	{"truly_720p_cmd", TRULY_720P_CMD_PANEL},
 	{"lead_fl10802_fwvga_video", LEAD_FL10802_FWVGA_VIDEO_PANEL},
+	{"hx8399c_fhd_pluse_video", HX8399C_FHD_PLUSE_VIDEO_PANEL},
 };
 
 static uint32_t panel_id;
@@ -710,6 +713,40 @@
 		pinfo->mipi.signature = LEAD_FL10802_FWVGA_VIDEO_SIGNATURE;
 		pinfo->mipi.cmds_post_tg = 1;
 		break;
+	case HX8399C_FHD_PLUSE_VIDEO_PANEL:
+		panelstruct->paneldata    = &hx8399c_fhd_pluse_video_panel_data;
+		panelstruct->panelres     = &hx8399c_fhd_pluse_video_panel_res;
+		panelstruct->color        = &hx8399c_fhd_pluse_video_color;
+		panelstruct->videopanel   =
+				&hx8399c_fhd_pluse_video_video_panel;
+		panelstruct->commandpanel =
+				&hx8399c_fhd_pluse_video_command_panel;
+		panelstruct->state        = &hx8399c_fhd_pluse_video_state;
+		panelstruct->laneconfig   =
+				&hx8399c_fhd_pluse_video_lane_config;
+		panelstruct->paneltiminginfo
+				= &hx8399c_fhd_pluse_video_timing_info;
+		panelstruct->panelresetseq
+				= &hx8399c_fhd_pluse_video_panel_reset_seq;
+		panelstruct->backlightinfo = &hx8399c_fhd_pluse_video_backlight;
+		pinfo->labibb = &hx8399c_fhd_pluse_video_labibb;
+		pinfo->mipi.panel_on_cmds
+				= hx8399c_fhd_pluse_video_on_command;
+		pinfo->mipi.num_of_panel_on_cmds
+				= HX8399C_FHD_PLUSE_VIDEO_ON_COMMAND;
+		pinfo->mipi.panel_off_cmds
+				= hx8399c_fhd_pluse_video_off_command;
+		pinfo->mipi.num_of_panel_off_cmds
+				= HX8399C_FHD_PLUSE_VIDEO_OFF_COMMAND;
+		if (phy_db->pll_type == DSI_PLL_TYPE_12NM)
+			memcpy(phy_db->timing,
+				hx8399c_fhd_pluse_video_12nm_timings,
+				TIMING_SIZE_12NM);
+		else
+			memcpy(phy_db->timing, hx8399c_fhd_pluse_video_timings,
+				TIMING_SIZE);
+		pinfo->mipi.signature    = HX8399C_FHD_PLUSE_VIDEO_SIGNATURE;
+		break;
 	case UNKNOWN_PANEL:
 	default:
 		memset(panelstruct, 0, sizeof(struct panel_struct));
@@ -770,8 +807,10 @@
 	case HW_PLATFORM_MTP:
 		if (platform_is_msm8956())
 			panel_id = NT35597_WQXGA_DUALDSI_VIDEO_PANEL;
-        else if (platform_is_msm8917())
+		else if (platform_is_msm8917())
 			panel_id = TRULY_720P_VIDEO_PANEL;
+		else if (platform_is_sdm439())
+			panel_id = HX8399C_FHD_PLUSE_VIDEO_PANEL;
 		else
 			panel_id = TRULY_1080P_VIDEO_PANEL;
 		break;
@@ -779,8 +818,10 @@
 	case HW_PLATFORM_RCM:
 		if (platform_is_msm8956())
 			panel_id = NT35597_WQXGA_DUALDSI_VIDEO_PANEL;
-        else if (platform_is_msm8917())
+		else if (platform_is_msm8917())
 			panel_id = TRULY_720P_VIDEO_PANEL;
+		else if (platform_is_sdm439())
+			panel_id = HX8399C_FHD_PLUSE_VIDEO_PANEL;
 		else
 			panel_id = TRULY_1080P_VIDEO_PANEL;
 		break;