target: msmtitanium: add support for panel enable GPIO for msmtitanium

Some panels have an on-board regulator supply instead of PMIC regulators
or LAB/IBB to power them up. This is controlled by a MSM GPIO on
msmtitanium target. Add support to configure this GPIO if required.

Change-Id: Ia5bbad3f135e891cbe8fc2c2e800d65efcf73043
diff --git a/target/msmtitanium/oem_panel.c b/target/msmtitanium/oem_panel.c
index 1d5ebb1..0f06e19 100644
--- a/target/msmtitanium/oem_panel.c
+++ b/target/msmtitanium/oem_panel.c
@@ -110,7 +110,7 @@
 	switch (panel_id) {
 	case TRULY_1080P_VIDEO_PANEL:
 		panelstruct->paneldata    = &truly_1080p_video_panel_data;
-		panelstruct->paneldata->panel_with_enable_gpio = 1;
+		panelstruct->paneldata->panel_with_enable_gpio = 0;
 		panelstruct->panelres     = &truly_1080p_video_panel_res;
 		panelstruct->color        = &truly_1080p_video_color;
 		panelstruct->videopanel   = &truly_1080p_video_video_panel;
@@ -138,7 +138,7 @@
 		break;
 	case TRULY_1080P_CMD_PANEL:
 		panelstruct->paneldata    = &truly_1080p_cmd_panel_data;
-		panelstruct->paneldata->panel_with_enable_gpio = 1;
+		panelstruct->paneldata->panel_with_enable_gpio = 0;
 		panelstruct->panelres     = &truly_1080p_cmd_panel_res;
 		panelstruct->color        = &truly_1080p_cmd_color;
 		panelstruct->videopanel   = &truly_1080p_cmd_video_panel;
diff --git a/target/msmtitanium/target_display.c b/target/msmtitanium/target_display.c
index 2032014..59b0453 100644
--- a/target/msmtitanium/target_display.c
+++ b/target/msmtitanium/target_display.c
@@ -69,6 +69,10 @@
   "msmgpio", 59, 3, 1, 0, 1
 };
 
+static struct gpio_pin enable_gpio = {
+  "msmgpio", 12, 3, 1, 0, 1
+};
+
 
 #define VCO_DELAY_USEC 1000
 #define GPIO_STATE_LOW 0
@@ -218,6 +222,15 @@
 
 	if (enable) {
 
+		if (pinfo->mipi.use_enable_gpio) {
+			gpio_tlmm_config(enable_gpio.pin_id, 0,
+				enable_gpio.pin_direction, enable_gpio.pin_pull,
+				enable_gpio.pin_strength,
+				enable_gpio.pin_state);
+
+			gpio_set_dir(enable_gpio.pin_id, 2);
+		}
+
 		gpio_tlmm_config(bkl_gpio.pin_id, 0,
 				bkl_gpio.pin_direction, bkl_gpio.pin_pull,
 				bkl_gpio.pin_strength, bkl_gpio.pin_state);
@@ -241,6 +254,7 @@
 
 	} else if(!target_cont_splash_screen()) {
 		gpio_set_dir(reset_gpio.pin_id, 0);
+		gpio_set_dir(enable_gpio.pin_id, 0);
 	}
 
 	return ret;