Merge "platform: correct EOT_PACKET_CTRL register offset on 8x10"
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 23a0736..7d774f4 100755
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -65,7 +65,6 @@
 #include "mmc.h"
 #include "devinfo.h"
 #include "board.h"
-
 #include "scm.h"
 
 extern  bool target_use_signed_kernel(void);
@@ -124,7 +123,7 @@
 /* Assuming unauthorized kernel image by default */
 static int auth_kernel_img = 0;
 
-static device_info device = {DEVICE_MAGIC, 0, 0, 0};
+static device_info device = {DEVICE_MAGIC, 0, 0, 0, 0};
 
 struct atag_ptbl_entry
 {
@@ -161,6 +160,7 @@
 char charger_screen_enabled[MAX_RSP_SIZE];
 char sn_buf[13];
 char display_panel_buf[MAX_PANEL_BUF_SIZE];
+char panel_display_mode[MAX_RSP_SIZE];
 
 extern int emmc_recovery_init(void);
 
@@ -521,6 +521,12 @@
 	/* Perform target specific cleanup */
 	target_uninit();
 
+	/* Turn off splash screen if enabled */
+#if DISPLAY_SPLASH_SCREEN
+	target_display_shutdown();
+#endif
+
+
 	dprintf(INFO, "booting linux @ %p, ramdisk @ %p (%d), tags/device tree @ %p\n",
 		entry, ramdisk, ramdisk_size, tags_phys);
 
@@ -1914,6 +1920,16 @@
 	fastboot_okay("");
 }
 
+void cmd_oem_select_display_panel(const char *arg, void *data, unsigned size)
+{
+	dprintf(INFO, "Selecting display panel %s\n", arg);
+	if (arg)
+		strlcpy(device.display_panel, arg,
+			sizeof(device.display_panel));
+	write_device_info(&device);
+	fastboot_okay("");
+}
+
 void cmd_oem_unlock(const char *arg, void *data, unsigned sz)
 {
 	if(!device.is_unlocked)
@@ -1926,13 +1942,15 @@
 
 void cmd_oem_devinfo(const char *arg, void *data, unsigned sz)
 {
-	char response[64];
+	char response[128];
 	snprintf(response, sizeof(response), "\tDevice tampered: %s", (device.is_tampered ? "true" : "false"));
 	fastboot_info(response);
 	snprintf(response, sizeof(response), "\tDevice unlocked: %s", (device.is_unlocked ? "true" : "false"));
 	fastboot_info(response);
 	snprintf(response, sizeof(response), "\tCharger screen enabled: %s", (device.charger_screen_enabled ? "true" : "false"));
 	fastboot_info(response);
+	snprintf(response, sizeof(response), "\tDisplay panel: %s", (device.display_panel));
+	fastboot_info(response);
 	fastboot_okay("");
 }
 
@@ -2145,6 +2163,8 @@
 			cmd_oem_enable_charger_screen);
 	fastboot_register("oem disable-charger-screen",
 			cmd_oem_disable_charger_screen);
+	fastboot_register("oem select-display-panel",
+			cmd_oem_select_display_panel);
 	/* publish variables and their values */
 	fastboot_publish("product",  TARGET(BOARD));
 	fastboot_publish("kernel",   "lk");
@@ -2168,6 +2188,10 @@
 			device.charger_screen_enabled);
 	fastboot_publish("charger-screen-enabled",
 			(const char *) charger_screen_enabled);
+	snprintf(panel_display_mode, MAX_RSP_SIZE, "%s",
+			device.display_panel);
+	fastboot_publish("display-panel",
+			(const char *) panel_display_mode);
 }
 
 void aboot_init(const struct app_descriptor *app)
@@ -2191,6 +2215,14 @@
 
 	read_device_info(&device);
 
+	/* Display splash screen if enabled */
+#if DISPLAY_SPLASH_SCREEN
+	dprintf(SPEW, "Display Init: Start\n");
+	target_display_init(device.display_panel);
+	dprintf(SPEW, "Display Init: Done\n");
+#endif
+
+
 	target_serialno((unsigned char *) sn_buf);
 	dprintf(SPEW,"serial number: %s\n",sn_buf);
 
diff --git a/app/aboot/devinfo.h b/app/aboot/devinfo.h
index 558aaf9..a0d8743 100644
--- a/app/aboot/devinfo.h
+++ b/app/aboot/devinfo.h
@@ -1,5 +1,5 @@
 /*
- * * Copyright (c) 2011, The Linux Foundation. All rights reserved.
+ * * Copyright (c) 2011,2014, 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 are
@@ -34,6 +34,7 @@
 
 #define DEVICE_MAGIC "ANDROID-BOOT!"
 #define DEVICE_MAGIC_SIZE 13
+#define MAX_PANEL_ID_LEN 64
 
 struct device_info
 {
@@ -41,6 +42,7 @@
 	bool is_unlocked;
 	bool is_tampered;
 	bool charger_screen_enabled;
+	char display_panel[MAX_PANEL_ID_LEN];
 };
 
 #endif
diff --git a/dev/gcdb/display/gcdb_display.c b/dev/gcdb/display/gcdb_display.c
index 52a6ae7..4a15406 100755
--- a/dev/gcdb/display/gcdb_display.c
+++ b/dev/gcdb/display/gcdb_display.c
@@ -257,11 +257,11 @@
 	memcpy(dsi_video_mode_phy_db.laneCfg, panel_lane_config, LANE_SIZE);
 }
 
-int gcdb_display_init(uint32_t rev, void *base)
+int gcdb_display_init(const char *panel_name, uint32_t rev, void *base)
 {
 	int ret = NO_ERROR;
 
-	if (!oem_panel_select(&panelstruct, &(panel.panel_info),
+	if (!oem_panel_select(panel_name, &panelstruct, &(panel.panel_info),
 				 &dsi_video_mode_phy_db)) {
 		dprintf(CRITICAL, "Target panel init not found!\n");
 		ret = ERR_NOT_SUPPORTED;
diff --git a/dev/gcdb/display/gcdb_display.h b/dev/gcdb/display/gcdb_display.h
index 6259896..b2fb974 100755
--- a/dev/gcdb/display/gcdb_display.h
+++ b/dev/gcdb/display/gcdb_display.h
@@ -58,7 +58,7 @@
 						struct msm_panel_info *pinfo);
 int target_ldo_ctrl(uint8_t enable);
 
-int gcdb_display_init(uint32_t rev, void *base);
+int gcdb_display_init(const char *panel_name, uint32_t rev, void *base);
 void gcdb_display_shutdown();
 
 #endif /*_GCDB_DISPLAY_H_ */
diff --git a/dev/gcdb/display/panel_display.c b/dev/gcdb/display/panel_display.c
index 4651051..e34d966 100644
--- a/dev/gcdb/display/panel_display.c
+++ b/dev/gcdb/display/panel_display.c
@@ -38,6 +38,7 @@
 #include <err.h>
 #include <reg.h>
 #include <mdp5.h>
+#include <string.h>
 
 
 /*---------------------------------------------------------------------------*/
@@ -325,3 +326,28 @@
 
 	return ret;
 }
+
+int32_t panel_name_to_id(struct panel_list supp_panels[],
+			  uint32_t supp_panels_size,
+			  const char *panel_name)
+{
+	uint32_t i;
+	int32_t panel_id = ERR_NOT_FOUND;
+
+	if (!panel_name) {
+		dprintf(CRITICAL, "Invalid panel name\n");
+		return panel_id;
+	}
+
+	/* Remove any leading whitespaces */
+	panel_name += strspn(panel_name, " ");
+	for (i = 0; i < supp_panels_size; i++) {
+		if (!strncmp(panel_name, supp_panels[i].name,
+			MAX_PANEL_ID_LEN)) {
+			panel_id = supp_panels[i].id;
+			break;
+		}
+	}
+
+	return panel_id;
+}
diff --git a/dev/gcdb/display/panel_display.h b/dev/gcdb/display/panel_display.h
index d805715..676bd69 100755
--- a/dev/gcdb/display/panel_display.h
+++ b/dev/gcdb/display/panel_display.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2014, 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
@@ -44,6 +44,8 @@
 #define DUAL_PIPE_FLAG 0x2
 #define PIPE_SWAP_FLAG 0x4
 #define SPLIT_DISPLAY_FLAG 0x8
+
+#define MAX_PANEL_ID_LEN 64
 /*---------------------------------------------------------------------------*/
 /* struct definition                                                         */
 /*---------------------------------------------------------------------------*/
@@ -60,6 +62,10 @@
 	struct backlight            *backlightinfo;
 };
 
+struct panel_list {
+	char name[MAX_PANEL_ID_LEN];
+	uint32_t id;
+};
 
 /*---------------------------------------------------------------------------*/
 /* API                                                                       */
@@ -79,4 +85,7 @@
 int oem_panel_on();
 int oem_panel_off();
 
+/* OEM support API */
+int32_t panel_name_to_id(struct panel_list supp_panels[],
+	uint32_t supp_panels_size, const char *panel_name);
 #endif /*_PLATFORM_DISPLAY_H_ */
diff --git a/dev/pmic/pm8x41/include/pm8x41.h b/dev/pmic/pm8x41/include/pm8x41.h
index 82d3c1d..8a5eaff 100644
--- a/dev/pmic/pm8x41/include/pm8x41.h
+++ b/dev/pmic/pm8x41/include/pm8x41.h
@@ -201,6 +201,7 @@
 int pm8x41_ldo_control(struct pm8x41_ldo *ldo, uint8_t enable);
 uint8_t pm8x41_get_pmic_rev();
 uint8_t pm8x41_get_pon_reason();
+uint32_t pm8x41_get_pwrkey_is_pressed();
 void pm8x41_config_output_mpp(struct pm8x41_mpp *mpp);
 void pm8x41_enable_mpp(struct pm8x41_mpp *mpp, enum mpp_en_ctl enable);
 uint8_t pm8x41_get_is_cold_boot();
diff --git a/dev/pmic/pm8x41/include/pm8x41_hw.h b/dev/pmic/pm8x41/include/pm8x41_hw.h
index 7664f37..672514a 100644
--- a/dev/pmic/pm8x41/include/pm8x41_hw.h
+++ b/dev/pmic/pm8x41/include/pm8x41_hw.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2014, 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 are
@@ -81,6 +81,7 @@
 
 /* PON Peripheral register bit values */
 #define RESIN_ON_INT_BIT                      1
+#define KPDPWR_ON_INT_BIT                     0
 #define RESIN_BARK_INT_BIT                    4
 #define S2_RESET_EN_BIT                       7
 
diff --git a/dev/pmic/pm8x41/include/pm_vib.h b/dev/pmic/pm8x41/include/pm_vib.h
new file mode 100644
index 0000000..9b10327
--- /dev/null
+++ b/dev/pmic/pm8x41/include/pm_vib.h
@@ -0,0 +1,38 @@
+/* Copyright (c) 2014, 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 are
+ * met:
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of The Linux Foundation, Inc. nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef __DEV_PMIC_VIB_VIBRATOR_H
+#define __DEV_PMIC_VIB_VIBRATOR_H
+
+#define QPNP_VIB_EN_CTL             0x1c046
+#define QPNP_VIB_VTG_CTL            0x1c041
+#define QPNP_VIB_VTG_SET_MASK       0x1F
+#define QPNP_VIB_DEFAULT_VTG_LVL    22
+
+void pm_vib_turn_on(void);
+void pm_vib_turn_off(void);
+#endif/* __DEV_PMIC_VIB_VIBRATOR_H */
diff --git a/dev/pmic/pm8x41/pm8x41.c b/dev/pmic/pm8x41/pm8x41.c
index 4ea7643..2c14d3b 100644
--- a/dev/pmic/pm8x41/pm8x41.c
+++ b/dev/pmic/pm8x41/pm8x41.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2014, 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 are
@@ -219,6 +219,19 @@
 	return (rt_sts & BIT(RESIN_ON_INT_BIT));
 }
 
+/* Return 1 if power key is pressed */
+uint32_t pm8x41_get_pwrkey_is_pressed()
+{
+	uint8_t pwr_sts = 0;
+
+	pwr_sts = REG_READ(PON_INT_RT_STS);
+
+	if (pwr_sts & BIT(KPDPWR_ON_INT_BIT))
+		return 1;
+	else
+		return 0;
+}
+
 void pm8x41_v2_reset_configure(uint8_t reset_type)
 {
 	uint8_t val;
diff --git a/dev/pmic/pm8x41/pm8x41_vib.c b/dev/pmic/pm8x41/pm8x41_vib.c
new file mode 100644
index 0000000..7dbba77
--- /dev/null
+++ b/dev/pmic/pm8x41/pm8x41_vib.c
@@ -0,0 +1,60 @@
+/* Copyright (c) 2014, 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 are
+ * met:
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of The Linux Foundation, Inc. nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <bits.h>
+#include <debug.h>
+#include <reg.h>
+#include <pm8x41.h>
+#include <pm_vib.h>
+
+#define QPNP_VIB_EN    BIT(7)
+
+/* Turn on vibrator */
+void pm_vib_turn_on(void)
+{
+	uint8_t val;
+
+	val = pm8x41_reg_read(QPNP_VIB_VTG_CTL);
+	val &= ~QPNP_VIB_VTG_SET_MASK;
+	val |= (QPNP_VIB_DEFAULT_VTG_LVL & QPNP_VIB_VTG_SET_MASK);
+	pm8x41_reg_write(QPNP_VIB_VTG_CTL, val);
+
+	val = pm8x41_reg_read(QPNP_VIB_EN_CTL);
+	val |= QPNP_VIB_EN;
+	pm8x41_reg_write(QPNP_VIB_EN_CTL, val);
+}
+
+/* Turn off vibrator */
+void pm_vib_turn_off(void)
+{
+	uint8_t val;
+
+	val = pm8x41_reg_read(QPNP_VIB_EN_CTL);
+	val &= ~QPNP_VIB_EN;
+	pm8x41_reg_write(QPNP_VIB_EN_CTL, val);
+}
diff --git a/dev/pmic/pm8x41/rules.mk b/dev/pmic/pm8x41/rules.mk
index 1cecf27..3713a4e 100644
--- a/dev/pmic/pm8x41/rules.mk
+++ b/dev/pmic/pm8x41/rules.mk
@@ -6,3 +6,8 @@
 	$(LOCAL_DIR)/pm8x41.o \
 	$(LOCAL_DIR)/pm8x41_adc.o \
 	$(LOCAL_DIR)/pm8x41_wled.o
+
+ifeq ($(ENABLE_PON_VIB_SUPPORT),true)
+OBJS += \
+	$(LOCAL_DIR)/pm8x41_vib.o
+endif
diff --git a/dev/vib/include/vibrator.h b/dev/vib/include/vibrator.h
new file mode 100644
index 0000000..d6fb8bf
--- /dev/null
+++ b/dev/vib/include/vibrator.h
@@ -0,0 +1,37 @@
+/* Copyright (c) 2014, 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 are
+ * met:
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of The Linux Foundation, Inc. nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef __DEV_VIB_VIBRATOR_H
+#define __DEV_VIB_VIBRATOR_H
+
+#define VIB_TIMER_DEFAULT_TIMEOUT   250
+
+void vib_turn_on(void);
+void vib_turn_off(void);
+void vib_timed_turn_on(const uint32_t);
+void wait_vib_timeout(void);
+#endif				/* __DEV_VIB_VIBRATOR_H */
diff --git a/dev/vib/rules.mk b/dev/vib/rules.mk
new file mode 100644
index 0000000..e9e1d10
--- /dev/null
+++ b/dev/vib/rules.mk
@@ -0,0 +1,6 @@
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+INCLUDES += -I$(LOCAL_DIR)/include
+
+OBJS += \
+	$(LOCAL_DIR)/vibrator.o
diff --git a/dev/vib/vibrator.c b/dev/vib/vibrator.c
new file mode 100644
index 0000000..e8cb8c7
--- /dev/null
+++ b/dev/vib/vibrator.c
@@ -0,0 +1,83 @@
+/* Copyright (c) 2014, 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 are
+ * met:
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of The Linux Foundation, Inc. nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <debug.h>
+#include <reg.h>
+#include <stdlib.h>
+#include <kernel/timer.h>
+#include <platform/timer.h>
+#include <vibrator.h>
+#include <pm_vib.h>
+
+#define CHECK_VIB_TIMER_FREQUENCY    50
+
+static struct timer vib_timer;
+static uint32_t vib_timeout;
+
+/* Function to turn on vibrator */
+void vib_turn_on()
+{
+	pm_vib_turn_on();
+}
+
+/* Function to turn off vibrator */
+void vib_turn_off()
+{
+	pm_vib_turn_off();
+}
+
+/* Function to turn off vibrator when the vib_timer is expired. */
+static enum handler_return vib_timer_func(struct timer *v_timer, void *arg)
+{
+	timer_cancel(&vib_timer);
+	vib_turn_off();
+	vib_timeout=1;
+
+	return INT_RESCHEDULE;
+}
+
+/*
+ * Function to turn on vibrator.
+ * vibrate_time - the time of phone vibrate.
+ */
+void vib_timed_turn_on(const uint32_t vibrate_time)
+{
+	vib_turn_on();
+	vib_timeout=0;
+	timer_initialize(&vib_timer);
+	timer_set_oneshot(&vib_timer, vibrate_time, vib_timer_func, NULL);
+}
+
+/* Wait for vibrator timer expired */
+void wait_vib_timeout(void)
+{
+	while (!vib_timeout) {
+		/* every 50ms to check if the vibrator timer is timeout*/
+		thread_sleep(CHECK_VIB_TIMER_FREQUENCY);
+	}
+}
diff --git a/include/target.h b/include/target.h
index 45f1605..dfd5521 100644
--- a/include/target.h
+++ b/include/target.h
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 2008 Travis Geiselbrecht
  *
- * Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files
@@ -51,5 +51,6 @@
 struct mmc_device *target_mmc_device();
 
 bool target_display_panel_node(char *pbuf, uint16_t buf_size);
-
+void target_display_init(const char *panel_name);
+void target_display_shutdown(void);
 #endif
diff --git a/platform/msm_shared/board.c b/platform/msm_shared/board.c
index 3e93888..5591ecd 100644
--- a/platform/msm_shared/board.c
+++ b/platform/msm_shared/board.c
@@ -88,7 +88,7 @@
 		board.pmic_info[0].pmic_type = board_info_v7.pmic_type;
 		board.pmic_info[0].pmic_version = board_info_v7.pmic_version;
 	}
-	else if (format == 8)
+	else if (format == 8 || format == 9)
 	{
 		board_info_len = sizeof(board_info_v8);
 
diff --git a/platform/msm_shared/debug.c b/platform/msm_shared/debug.c
index 3349db7..28c053e 100644
--- a/platform/msm_shared/debug.c
+++ b/platform/msm_shared/debug.c
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 2009, Google Inc.
  * All rights reserved.
- * Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2009-2014, 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,10 @@
 #include <platform/timer.h>
 #include <platform.h>
 
+#if PON_VIB_SUPPORT
+#include <vibrator.h>
+#endif
+
 static void write_dcc(char c)
 {
 	uint32_t timeout = 10;
@@ -134,6 +138,9 @@
 
 void platform_halt(void)
 {
+#if PON_VIB_SUPPORT
+	vib_turn_off();
+#endif
 	if (set_download_mode(NORMAL_DLOAD) == 0)
 	{
 		dprintf(CRITICAL, "HALT: reboot into dload mode...\n");
diff --git a/platform/msm_shared/include/shutdown_detect.h b/platform/msm_shared/include/shutdown_detect.h
new file mode 100644
index 0000000..23690c9
--- /dev/null
+++ b/platform/msm_shared/include/shutdown_detect.h
@@ -0,0 +1,33 @@
+/* Copyright (c) 2014, 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 are
+ * met:
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of The Linux Foundation, Inc. nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __PLATFORM_MSM_SHARED_SHUTDOWN_DETECT_H
+#define __PLATFORM_MSM_SHARED_SHUTDOWN_DETECT_H
+
+void shutdown_detect(void);
+#endif				/* __PLATFORM_MSM_SHARED_SHUTDOWN_DETECT_H */
diff --git a/platform/msm_shared/rules.mk b/platform/msm_shared/rules.mk
index 7f48e01..632de53 100755
--- a/platform/msm_shared/rules.mk
+++ b/platform/msm_shared/rules.mk
@@ -132,7 +132,8 @@
             $(LOCAL_DIR)/crypto5_wrapper.o \
 			$(LOCAL_DIR)/dev_tree.o \
 			$(LOCAL_DIR)/gpio.o \
-			$(LOCAL_DIR)/dload_util.o
+			$(LOCAL_DIR)/dload_util.o \
+			$(LOCAL_DIR)/shutdown_detect.o
 endif
 
 ifeq ($(PLATFORM),mpq8092)
diff --git a/platform/msm_shared/shutdown_detect.c b/platform/msm_shared/shutdown_detect.c
new file mode 100644
index 0000000..a51c9ae
--- /dev/null
+++ b/platform/msm_shared/shutdown_detect.c
@@ -0,0 +1,160 @@
+/* Copyright (c) 2014, 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 are
+ * met:
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of The Linux Foundation, Inc. nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <debug.h>
+#include <reg.h>
+#include <stdlib.h>
+#include <pm8x41.h>
+#include <pm8x41_hw.h>
+#include <kernel/timer.h>
+#include <platform/timer.h>
+#include <shutdown_detect.h>
+
+/* sleep clock is 32.768 khz, 0x8000 count per second */
+#define MPM_SLEEP_TIMETICK_COUNT    0x8000
+#define PWRKEY_LONG_PRESS_COUNT     0xC000
+#define QPNP_DEFAULT_TIMEOUT        250
+#define PWRKEY_DETECT_FREQUENCY     50
+
+static struct timer pon_timer;
+static uint32_t pon_timer_complete = 0;
+
+/*
+ * Function to check if the the power key is pressed long enough.
+ * Return 0 if boot time more than PWRKEY_LONG_PRESS_COUNT.
+ * Return 1 if boot time less than PWRKEY_LONG_PRESS_COUNT.
+ */
+static uint32_t is_pwrkey_time_expired()
+{
+	/* power on button tied in with PMIC KPDPWR. */
+	uint32_t sclk_count = platform_get_sclk_count();
+
+	/* Here check if the long press power-key lasts for 1.5s */
+	if (sclk_count > PWRKEY_LONG_PRESS_COUNT)
+		return 0;
+	else
+		return 1;
+}
+
+/*
+ * Function to check if the power on reason is power key triggered.
+ * Return 1 if it is triggered by power key.
+ * Return 0 if it is not triggered by power key.
+ */
+static uint32_t is_pwrkey_pon_reason()
+{
+	uint8_t pon_reason = pm8x41_get_pon_reason();
+
+	if (pm8x41_get_is_cold_boot() && (pon_reason == KPDPWR_N))
+		return 1;
+	else
+		return 0;
+}
+
+/*
+ * Main timer handle: check every PWRKEY_DETECT_FREQUENCY to see
+ * if power key is pressed.
+ * Shutdown the device if power key is release before
+ * (PWRKEY_LONG_PRESS_COUNT/MPM_SLEEP_TIMETICK_COUNT) seconds.
+ */
+static enum handler_return long_press_pwrkey_timer_func(struct timer *p_timer,
+	void *arg)
+{
+	uint32_t sclk_count = platform_get_sclk_count();
+
+	/*
+	 * The following condition is treated as the power key
+	 * is pressed long enough.
+	 * 1. if the power key is pressed last for PWRKEY_LONG_PRESS_COUNT.
+	 */
+	if (sclk_count > PWRKEY_LONG_PRESS_COUNT) {
+		timer_cancel(p_timer);
+		pon_timer_complete = 1;
+	} else {
+		if (pm8x41_get_pwrkey_is_pressed()) {
+			/*
+			 * For normal man response is > 0.1 secs, so we use 0.05 secs default
+			 * for software to be safely detect if there is a key release action.
+			 */
+			timer_set_oneshot(p_timer, PWRKEY_DETECT_FREQUENCY,
+				long_press_pwrkey_timer_func, NULL);
+		} else {
+			shutdown_device();
+		}
+	}
+
+	return INT_RESCHEDULE;
+}
+
+/*
+ * Function to wait until the power key is pressed long enough
+ */
+static void wait_for_long_pwrkey_pressed()
+{
+	uint32_t sclk_count = 0;
+
+	while (!pon_timer_complete) {
+		sclk_count = platform_get_sclk_count();
+		if (sclk_count > PWRKEY_LONG_PRESS_COUNT) {
+			timer_cancel(&pon_timer);
+			break;
+		}
+	}
+}
+
+/*
+ * Function to support for shutdown detection
+ * If below condition is met, the function will shut down
+ * the device. Otherwise it will do nothing and return to
+ * normal boot.
+ * condition:
+ * 1. it is triggered by power key &&
+ * 2. the power key is released before
+ * (PWRKEY_LONG_PRESS_COUNT/MPM_SLEEP_TIMETICK_COUNT) seconds.
+ */
+void shutdown_detect()
+{
+	/*
+	 * If it is booted by power key tirigger.
+	 * Initialize pon_timer and call long_press_pwrkey_timer_func
+	 * function to check if the power key is last press long enough.
+	 */
+	if (is_pwrkey_pon_reason() && is_pwrkey_time_expired()) {
+		timer_initialize(&pon_timer);
+		timer_set_oneshot(&pon_timer, 0, long_press_pwrkey_timer_func, NULL);
+
+		/*
+		 * Wait until long press power key timeout
+		 *
+		 * It will be confused to end users if we shutdown the device
+		 * after the splash screen displayed. But it can be moved the
+		 * wait here if the boot time is much more considered.
+		 */
+		wait_for_long_pwrkey_pressed();
+	}
+}
diff --git a/project/msm8226.mk b/project/msm8226.mk
index 1e94e03..2c97294 100644
--- a/project/msm8226.mk
+++ b/project/msm8226.mk
@@ -10,6 +10,9 @@
 EMMC_BOOT := 1
 ENABLE_SDHCI_SUPPORT := 1
 
+#enable power on vibrator feature
+ENABLE_PON_VIB_SUPPORT := true
+
 #DEFINES += WITH_DEBUG_DCC=1
 DEFINES += WITH_DEBUG_UART=1
 DEFINES += WITH_DEBUG_LOG_BUF=1
@@ -26,6 +29,10 @@
 #Disable thumb mode
 ENABLE_THUMB := false
 
+ifeq ($(ENABLE_PON_VIB_SUPPORT),true)
+DEFINES += PON_VIB_SUPPORT=1
+endif
+
 ifeq ($(ENABLE_SDHCI_SUPPORT),1)
 DEFINES += MMC_SDHCI_SUPPORT=1
 endif
diff --git a/target/apq8084/oem_panel.c b/target/apq8084/oem_panel.c
index eeae271..3b487c6 100644
--- a/target/apq8084/oem_panel.c
+++ b/target/apq8084/oem_panel.c
@@ -153,7 +153,7 @@
 	return ret;
 }
 
-bool oem_panel_select(struct panel_struct *panelstruct,
+bool oem_panel_select(const char *panel_name, struct panel_struct *panelstruct,
 			struct msm_panel_info *pinfo,
 			struct mdss_dsi_phy_ctrl *phy_db)
 {
diff --git a/target/apq8084/target_display.c b/target/apq8084/target_display.c
old mode 100644
new mode 100755
index 517ea1b..fd6f766
--- a/target/apq8084/target_display.c
+++ b/target/apq8084/target_display.c
@@ -242,16 +242,16 @@
 	return NO_ERROR;
 }
 
-void display_init(void)
+void target_display_init(const char *panel_name)
 {
 	uint32_t ret = 0;
-	ret = gcdb_display_init(MDP_REV_50, MIPI_FB_ADDR);
+	ret = gcdb_display_init(panel_name, MDP_REV_50, MIPI_FB_ADDR);
 	if (ret) {
 		msm_display_off();
 	}
 }
 
-void display_shutdown(void)
+void target_display_shutdown(void)
 {
 	gcdb_display_shutdown();
 }
diff --git a/target/init.c b/target/init.c
index 7875a4f..8eeb906 100644
--- a/target/init.c
+++ b/target/init.c
@@ -146,6 +146,14 @@
 	return false;
 }
 
+__WEAK void target_display_init(const char *panel_name)
+{
+}
+
+__WEAK void target_display_shutdown(void)
+{
+}
+
 __WEAK uint8_t target_panel_auto_detect_enabled()
 {
 	return 0;
diff --git a/target/msm7627a/init.c b/target/msm7627a/init.c
index 502cb54..41c9611 100644
--- a/target/msm7627a/init.c
+++ b/target/msm7627a/init.c
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 2009, Google Inc.
  * All rights reserved.
- * Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2009-2014, 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
@@ -186,12 +186,6 @@
 	keypad_init();
 #endif
 
-	/* Display splash screen if enabled */
-#if DISPLAY_SPLASH_SCREEN
-	display_init();
-	dprintf(SPEW, "Diplay initialized\n");
-#endif
-
 	if (target_is_emmc_boot()) {
 		/* Must wait for modem-up before we can intialize MMC.
 		 */
diff --git a/target/msm7627a/target_display.c b/target/msm7627a/target_display.c
old mode 100644
new mode 100755
index 0c4d073..94270b5
--- a/target/msm7627a/target_display.c
+++ b/target/msm7627a/target_display.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012, 2014, 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 are
@@ -69,7 +69,7 @@
 	}
 	return ret;
 }
-void display_init(void)
+void target_display_init(const char *panel_name)
 {
 	unsigned mach_type;
 	mach_type = board_machtype();
@@ -155,7 +155,7 @@
 	display_enabled = 1;
 }
 
-void display_shutdown(void)
+void target_display_shutdown(void)
 {
 	dprintf(SPEW, "display_shutdown()\n");
 	if (display_enabled)
diff --git a/target/msm8226/init.c b/target/msm8226/init.c
index bd83019..286ef41 100644
--- a/target/msm8226/init.c
+++ b/target/msm8226/init.c
@@ -48,6 +48,8 @@
 #include <scm.h>
 #include <stdlib.h>
 #include <partition_parser.h>
+#include <shutdown_detect.h>
+#include <vibrator.h>
 
 extern  bool target_use_signed_kernel(void);
 static void set_sdc_power_ctrl(void);
@@ -65,6 +67,7 @@
 #define CRYPTO_ENGINE_CMD_ARRAY_SIZE       20
 
 #define TLMM_VOL_UP_BTN_GPIO    106
+#define VIBRATE_TIME    250
 
 #define SSD_CE_INSTANCE         1
 
@@ -247,12 +250,10 @@
 
 	target_sdc_init();
 
-	/* Display splash screen if enabled */
-#if DISPLAY_SPLASH_SCREEN
-	dprintf(SPEW, "Display Init: Start\n");
-	display_init();
-	dprintf(SPEW, "Display Init: Done\n");
-#endif
+	shutdown_detect();
+
+	/* turn on vibrator to indicate that phone is booting up to end user */
+	vib_timed_turn_on(VIBRATE_TIME);
 
 	if (target_use_signed_kernel())
 		target_crypto_init_params();
@@ -369,6 +370,24 @@
 	dprintf(CRITICAL, "Rebooting failed\n");
 }
 
+/* Configure PMIC and Drop PS_HOLD for shutdown */
+void shutdown_device()
+{
+	dprintf(CRITICAL, "Going down for shutdown.\n");
+
+	/* Configure PMIC for shutdown */
+	pm8x41_reset_configure(PON_PSHOLD_SHUTDOWN);
+
+	/* Drop PS_HOLD for MSM */
+	writel(0x00, MPM2_MPM_PS_HOLD);
+
+	mdelay(5000);
+
+	dprintf(CRITICAL, "shutdown failed\n");
+
+	ASSERT(0);
+}
+
 crypto_engine_type board_ce_type(void)
 {
 	return CRYPTO_ENGINE_TYPE_HW;
@@ -387,6 +406,9 @@
 
 void target_uninit(void)
 {
+	/* wait for the vibrator timer is expried */
+	wait_vib_timeout();
+
 	mmc_put_card_to_sleep(dev);
 
 	if (target_is_ssd_enabled())
diff --git a/target/msm8226/oem_panel.c b/target/msm8226/oem_panel.c
index f23aded..258f77c 100755
--- a/target/msm8226/oem_panel.c
+++ b/target/msm8226/oem_panel.c
@@ -52,6 +52,7 @@
 #define DISPLAY_MAX_PANEL_DETECTION 2
 
 #define SSD2080M_720P_VIDEO_PANEL_ON_DELAY 200
+#define MAX_PANEL_ID_LEN 64
 
 /*---------------------------------------------------------------------------*/
 /* static panel selection variable                                           */
@@ -78,6 +79,21 @@
 	HW_PLATFORM_SUBTYPE_SKUG = 5,
 };
 
+/*
+ * The list of panels that are supported on this target.
+ * Any panel in this list can be selected using fastboot oem command.
+ */
+static struct panel_list supp_panels[] = {
+	{"toshiba_720p_video", TOSHIBA_720P_VIDEO_PANEL},
+	{"nt35590_720p_cmd", NT35590_720P_CMD_PANEL},
+	{"nt35590_720p_video", NT35590_720P_VIDEO_PANEL},
+	{"nt35596_1080p_video", NT35596_1080P_VIDEO_PANEL},
+	{"hx8394a_720p_video", HX8394A_720P_VIDEO_PANEL},
+	{"nt35521_720p_video", NT35521_720P_VIDEO_PANEL},
+	{"ssd2080m_720p_video", SSD2080M_720P_VIDEO_PANEL},
+	{"jdi_1080p_video", JDI_1080P_VIDEO_PANEL},
+};
+
 static uint32_t panel_id;
 
 int oem_panel_rotation()
@@ -306,7 +322,7 @@
 
 static uint32_t auto_pan_loop = 0;
 
-bool oem_panel_select(struct panel_struct *panelstruct,
+bool oem_panel_select(const char *panel_name, struct panel_struct *panelstruct,
 			struct msm_panel_info *pinfo,
 			struct mdss_dsi_phy_ctrl *phy_db)
 {
@@ -315,10 +331,24 @@
 	uint32_t nt35590_panel_id = NT35590_720P_VIDEO_PANEL;
 	uint32_t hw_subtype = board_hardware_subtype();
 	bool ret = true;
+	int32_t panel_override_id;
 
-#if DISPLAY_TYPE_CMD_MODE
-	nt35590_panel_id = NT35590_720P_CMD_PANEL;
-#endif
+	if (panel_name) {
+		panel_override_id = panel_name_to_id(supp_panels,
+				ARRAY_SIZE(supp_panels), panel_name);
+
+		if (panel_override_id < 0) {
+			dprintf(CRITICAL, "Not able to search the panel:%s\n",
+					 panel_name + strspn(panel_name, " "));
+		} else if (panel_override_id < UNKNOWN_PANEL) {
+			/* panel override using fastboot oem command */
+			panel_id = panel_override_id;
+
+			dprintf(INFO, "OEM panel override:%s\n",
+					panel_name + strspn(panel_name, " "));
+			goto panel_init;
+		}
+	}
 
 	switch (hw_id) {
 	case HW_PLATFORM_QRD:
@@ -367,6 +397,7 @@
 		return false;
 	}
 
+panel_init:
 	init_panel_data(panelstruct, pinfo, phy_db);
 
 	return ret;
diff --git a/target/msm8226/rules.mk b/target/msm8226/rules.mk
index f5c9596..d31f2bc 100755
--- a/target/msm8226/rules.mk
+++ b/target/msm8226/rules.mk
@@ -18,7 +18,6 @@
 DEFINES += DISPLAY_SPLASH_SCREEN=1
 DEFINES += DISPLAY_TYPE_MIPI=1
 DEFINES += DISPLAY_TYPE_DSI6G=1
-DEFINES += DISPLAY_TYPE_CMD_MODE=0
 
 MODULES += \
 	dev/keys \
@@ -26,6 +25,7 @@
 	dev/pmic/pm8x41 \
 	dev/panel/msm \
 	dev/gcdb/display \
+	dev/vib \
 	lib/libfdt
 
 DEFINES += \
diff --git a/target/msm8226/target_display.c b/target/msm8226/target_display.c
index c89c1ac..2e608c8 100755
--- a/target/msm8226/target_display.c
+++ b/target/msm8226/target_display.c
@@ -341,13 +341,13 @@
 	return ret;
 }
 
-void display_init(void)
+void target_display_init(const char *panel_name)
 {
         uint32_t panel_loop = 0;
         uint32_t ret = 0;
 
 	do {
-		ret = gcdb_display_init(MDP_REV_50, MIPI_FB_ADDR);
+		ret = gcdb_display_init(panel_name, MDP_REV_50, MIPI_FB_ADDR);
 		if (!ret || ret == ERR_NOT_SUPPORTED) {
 			break;
 		} else {
@@ -359,7 +359,7 @@
 
 }
 
-void display_shutdown(void)
+void target_display_shutdown(void)
 {
 	gcdb_display_shutdown();
 }
diff --git a/target/msm8610/init.c b/target/msm8610/init.c
index bf6cb45..fb6d24c 100644
--- a/target/msm8610/init.c
+++ b/target/msm8610/init.c
@@ -163,11 +163,6 @@
 	target_keystatus();
 
 	target_sdc_init();
-
-	/* Display splash screen if enabled */
-	dprintf(SPEW, "Display Init: Start\n");
-	display_init();
-	dprintf(SPEW, "Display Init: Done\n");
 }
 
 void target_uninit(void)
diff --git a/target/msm8610/oem_panel.c b/target/msm8610/oem_panel.c
index 8ea0a5e..e1fad7c 100644
--- a/target/msm8610/oem_panel.c
+++ b/target/msm8610/oem_panel.c
@@ -221,7 +221,7 @@
 	return true;
 }
 
-bool oem_panel_select(struct panel_struct *panelstruct,
+bool oem_panel_select(const char *panel_name, struct panel_struct *panelstruct,
 			struct msm_panel_info *pinfo,
 			struct mdss_dsi_phy_ctrl *phy_db)
 {
diff --git a/target/msm8610/target_display.c b/target/msm8610/target_display.c
old mode 100644
new mode 100755
index fde805a..4b963b8
--- a/target/msm8610/target_display.c
+++ b/target/msm8610/target_display.c
@@ -162,12 +162,12 @@
 	return 0;
 }
 
-void display_init(void)
+void target_display_init(const char *panel_name)
 {
-	gcdb_display_init(MDP_REV_304, MIPI_FB_ADDR);
+	gcdb_display_init(panel_name, MDP_REV_304, MIPI_FB_ADDR);
 }
 
-void display_shutdown(void)
+void target_display_shutdown(void)
 {
 	gcdb_display_shutdown();
 }
diff --git a/target/msm8960/init.c b/target/msm8960/init.c
index 72d9463..dcee3b4 100755
--- a/target/msm8960/init.c
+++ b/target/msm8960/init.c
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 2009, Google Inc.
  * All rights reserved.
- * Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2009-2014, 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
@@ -142,12 +142,6 @@
 		dprintf(CRITICAL,"Keyboard is not supported for platform: %d\n",platform_id);
 	};
 
-	/* Display splash screen if enabled */
-#if DISPLAY_SPLASH_SCREEN
-	display_init();
-	dprintf(SPEW, "Diplay initialized\n");
-#endif
-
 	if ((platform_id == MSM8960) || (platform_id == MSM8960AB) ||
 		(platform_id == APQ8060AB) || (platform_id == MSM8260AB) ||
 		(platform_id == MSM8660AB) || (platform_id == MSM8660A) ||
diff --git a/target/msm8960/target_display.c b/target/msm8960/target_display.c
old mode 100644
new mode 100755
index 39a3aeb..2eec1ea
--- a/target/msm8960/target_display.c
+++ b/target/msm8960/target_display.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2014, 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 are
@@ -255,7 +255,7 @@
 	return 0;
 }
 
-void display_init(void)
+void target_display_init(const char *panel_name)
 {
 	int target_id = board_target_id();
 
@@ -345,7 +345,7 @@
 	display_enable = 1;
 }
 
-void display_shutdown(void)
+void target_display_shutdown(void)
 {
 	if (display_enable) {
 		msm_display_off();
diff --git a/target/msm8974/init.c b/target/msm8974/init.c
index 2e6c151..20d3b02 100644
--- a/target/msm8974/init.c
+++ b/target/msm8974/init.c
@@ -351,15 +351,6 @@
 
 	if (target_use_signed_kernel())
 		target_crypto_init_params();
-	/* Display splash screen if enabled */
-#if DISPLAY_SPLASH_SCREEN
-	dprintf(INFO, "Display Init: Start\n");
-	if (board_hardware_subtype() != HW_PLATFORM_SUBTYPE_CDP_INTERPOSER)
-	{
-		display_init();
-	}
-	dprintf(INFO, "Display Init: Done\n");
-#endif
 
 	/*
 	 * Set drive strength & pull ctrl for
diff --git a/target/msm8974/oem_panel.c b/target/msm8974/oem_panel.c
index 0bda609..1634cd4 100755
--- a/target/msm8974/oem_panel.c
+++ b/target/msm8974/oem_panel.c
@@ -232,7 +232,7 @@
 
 static uint32_t auto_pan_loop = 0;
 
-bool oem_panel_select(struct panel_struct *panelstruct,
+bool oem_panel_select(const char *panel_name, struct panel_struct *panelstruct,
 			struct msm_panel_info *pinfo,
 			struct mdss_dsi_phy_ctrl *phy_db)
 {
diff --git a/target/msm8974/target_display.c b/target/msm8974/target_display.c
old mode 100644
new mode 100755
index c32cef0..270a300
--- a/target/msm8974/target_display.c
+++ b/target/msm8974/target_display.c
@@ -330,7 +330,7 @@
 	return 0;
 }
 
-void display_init(void)
+void target_display_init(const char *panel_name)
 {
 	uint32_t hw_id = board_hardware_id();
 	uint32_t panel_loop = 0;
@@ -353,7 +353,8 @@
 		break;
 	default:
 		do {
-			ret = gcdb_display_init(MDP_REV_50, MIPI_FB_ADDR);
+			ret = gcdb_display_init(panel_name, MDP_REV_50,
+				MIPI_FB_ADDR);
 			if (!ret || ret == ERR_NOT_SUPPORTED) {
 				break;
 			} else {
@@ -366,7 +367,7 @@
 	}
 }
 
-void display_shutdown(void)
+void target_display_shutdown(void)
 {
 	uint32_t hw_id = board_hardware_id();
 	switch (hw_id) {