Merge "msm: board-msm7x27a: Enable combo device support for 7x27A target" into msm-3.0
diff --git a/arch/arm/mach-msm/acpuclock-8960.c b/arch/arm/mach-msm/acpuclock-8960.c
index d74db47..cfc7dd0 100644
--- a/arch/arm/mach-msm/acpuclock-8960.c
+++ b/arch/arm/mach-msm/acpuclock-8960.c
@@ -401,6 +401,10 @@
 	/* Wait for switch to complete. */
 	mb();
 	udelay(1);
+
+	/* Re-enable secondary source clock gating. */
+	regval &= ~SECCLKAGD;
+	set_l2_indirect_reg(sc->l2cpmr_iaddr, regval);
 }
 
 /* Enable an already-configured HFPLL. */
diff --git a/arch/arm/mach-msm/qdsp6v2/lpa_if_hdmi.c b/arch/arm/mach-msm/qdsp6v2/lpa_if_hdmi.c
index 11fff28..cd1fe4c 100644
--- a/arch/arm/mach-msm/qdsp6v2/lpa_if_hdmi.c
+++ b/arch/arm/mach-msm/qdsp6v2/lpa_if_hdmi.c
@@ -28,17 +28,6 @@
 #include <sound/dai.h>
 #include "q6core.h"
 
-#define NUM_FRA_IN_BLOCK		192
-#define NUM_SAMP_PER_CH_PER_AC3_FRAME	1536
-#define AC3_REP_PER			1536	/* num of 60958 Frames */
-#define FRAME_60958_SZ			8	/* bytes */
-#define PREABLE_61937_SZ_16_BIT		4	/* in 16 bit words */
-
-
-#define MAX_AC3_FRA_SZ_16_BIT		1920  /* in 16 bit words */
-#define DMA_PERIOD_SZ			(AC3_REP_PER * FRAME_60958_SZ)
-#define DMA_BUF_SZ			(DMA_PERIOD_SZ * 2)
-#define USER_BUF_SZ			DMA_PERIOD_SZ
 #define DMA_ALLOC_BUF_SZ		(SZ_4K * 6)
 
 #define HDMI_AUDIO_FIFO_WATER_MARK	4
@@ -62,6 +51,7 @@
 	u32 dma_ch;
 	wait_queue_head_t wait;
 	u32 config;
+	u32 dma_period_sz;
 };
 
 static struct lpa_if  *lpa_if_ptr;
@@ -127,12 +117,11 @@
 
 	dma_params.src_start = lpa_if->buffer_phys;
 	dma_params.buffer = lpa_if->buffer;
-	dma_params.buffer_size = DMA_BUF_SZ;
-	dma_params.period_size = DMA_PERIOD_SZ;
+	dma_params.buffer_size = lpa_if->dma_period_sz * 2;
+	dma_params.period_size = lpa_if->dma_period_sz;
 	dma_params.channels = 2;
 
 	lpa_if->dma_ch = 0;
-
 	dai_set_params(lpa_if->dma_ch, &dma_params);
 
 	register_dma_irq_handler(lpa_if->dma_ch, lpa_if_irq, (void *)lpa_if);
@@ -195,7 +184,33 @@
 			rc = -EFAULT;
 		}
 		break;
+	case AUDIO_SET_CONFIG:
+		pr_debug("AUDIO_SET_CONFIG\n");
+		if (copy_from_user(&lpa_if->dma_period_sz, (void *) arg,
+				sizeof(unsigned int))) {
+			pr_debug("%s:failed to copy from user\n", __func__);
+			rc = -EFAULT;
+		}
+		if (lpa_if->dma_period_sz > DMA_ALLOC_BUF_SZ) {
+			pr_err("Dma buffer size greater than allocated size\n");
+			return -EINVAL;
+		}
+		pr_debug("Dma_period_sz %d\n", lpa_if->dma_period_sz);
+		lpa_if->cfg.buffer_count = 2;
+		lpa_if->cfg.buffer_size = lpa_if->dma_period_sz * 2;
 
+		lpa_if->audio_buf[0].phys = lpa_if->buffer_phys;
+		lpa_if->audio_buf[0].data = lpa_if->buffer;
+		lpa_if->audio_buf[0].size = lpa_if->dma_period_sz;
+		lpa_if->audio_buf[0].used = 0;
+
+		lpa_if->audio_buf[1].phys =
+				lpa_if->buffer_phys + lpa_if->dma_period_sz;
+		lpa_if->audio_buf[1].data =
+				lpa_if->buffer + lpa_if->dma_period_sz;
+		lpa_if->audio_buf[1].size = lpa_if->dma_period_sz;
+		lpa_if->audio_buf[1].used = 0;
+		break;
 	default:
 		pr_err("UnKnown Ioctl\n");
 		rc = -EINVAL;
@@ -209,26 +224,9 @@
 
 static int lpa_if_open(struct inode *inode, struct file *file)
 {
-	struct lpa_if *lpa_if;
-
 	pr_debug("\n");
 
 	file->private_data = lpa_if_ptr;
-	lpa_if = lpa_if_ptr;
-
-	lpa_if->cfg.buffer_count = 2;
-	lpa_if->cfg.buffer_size = USER_BUF_SZ;
-
-	lpa_if->audio_buf[0].phys = lpa_if->buffer_phys;
-	lpa_if->audio_buf[0].data = lpa_if->buffer;
-	lpa_if->audio_buf[0].size = DMA_PERIOD_SZ;
-	lpa_if->audio_buf[0].used = 0;
-
-	lpa_if->audio_buf[1].phys = lpa_if->buffer_phys + DMA_PERIOD_SZ;
-	lpa_if->audio_buf[1].data = lpa_if->buffer + DMA_PERIOD_SZ;
-	lpa_if->audio_buf[1].size = DMA_PERIOD_SZ;
-	lpa_if->audio_buf[1].used = 0;
-
 	dma_buf_index = 0;
 
 	core_req_bus_bandwith(AUDIO_IF_BUS_ID, 100000, 0);
@@ -287,8 +285,8 @@
 
 		xfer = count;
 
-		if (xfer > USER_BUF_SZ)
-			xfer = USER_BUF_SZ;
+		if (xfer > lpa_if->dma_period_sz)
+			xfer = lpa_if->dma_period_sz;
 
 		if (copy_from_user(ab->data, buf, xfer)) {
 			pr_err("copy from user failed\n");
diff --git a/drivers/char/diag/diagfwd.c b/drivers/char/diag/diagfwd.c
index 226e5b5..caf3901 100644
--- a/drivers/char/diag/diagfwd.c
+++ b/drivers/char/diag/diagfwd.c
@@ -70,7 +70,7 @@
 #define CHK_OVERFLOW(bufStart, start, end, length) \
 ((bufStart <= start) && (end - start >= length)) ? 1 : 0
 
-int chk_config_get_id()
+int chk_config_get_id(void)
 {
 	switch (socinfo_get_id()) {
 	case APQ8060_MACHINE_ID:
@@ -78,6 +78,23 @@
 		return APQ8060_TOOLS_ID;
 	case AO8960_MACHINE_ID:
 		return AO8960_TOOLS_ID;
+	case APQ8064_MACHINE_ID:
+		return APQ8064_TOOLS_ID;
+	default:
+		return 0;
+	}
+}
+
+/*
+ * This will return TRUE for targets which support apps only mode.
+ * This applies to 8960 and newer targets.
+ */
+int chk_apps_only(void)
+{
+	switch (socinfo_get_id()) {
+	case AO8960_MACHINE_ID:
+	case APQ8064_MACHINE_ID:
+		return 1;
 	default:
 		return 0;
 	}
@@ -576,8 +593,8 @@
 		diag_update_event_mask(buf+1, 0, 0);
 		diag_update_userspace_clients(EVENT_MASKS_TYPE);
 #if defined(CONFIG_DIAG_OVER_USB)
-		/* Check for Apps Only 8960 */
-		if (!(driver->ch) && (chk_config_get_id() == AO8960_TOOLS_ID)) {
+		/* Check for Apps Only */
+		if (!(driver->ch) && chk_apps_only()) {
 			/* echo response back for apps only DIAG */
 			driver->apps_rsp_buf[0] = 0x60;
 			driver->apps_rsp_buf[1] = 0x0;
@@ -594,8 +611,8 @@
 		diag_update_log_mask(*(int *)buf, buf+8, *(int *)(buf+4));
 		diag_update_userspace_clients(LOG_MASKS_TYPE);
 #if defined(CONFIG_DIAG_OVER_USB)
-		/* Check for Apps Only 8960 */
-		if (!(driver->ch) && (chk_config_get_id() == AO8960_TOOLS_ID)) {
+		/* Check for Apps Only */
+		if (!(driver->ch) && chk_apps_only()) {
 			/* echo response back for Apps only DIAG */
 			driver->apps_rsp_buf[0] = 0x73;
 			*(int *)(driver->apps_rsp_buf + 4) = 0x3; /* op. ID */
@@ -617,7 +634,7 @@
 		diag_update_msg_mask(ssid_first, ssid_last , buf + 8);
 		diag_update_userspace_clients(MSG_MASKS_TYPE);
 #if defined(CONFIG_DIAG_OVER_USB)
-		if (!(driver->ch) && (chk_config_get_id() == AO8960_TOOLS_ID)) {
+		if (!(driver->ch) && chk_apps_only()) {
 			/* echo response back for apps only DIAG */
 			for (i = 0; i < 8 + ssid_range; i++)
 				*(driver->apps_rsp_buf + i) = *(buf+i);
@@ -627,9 +644,8 @@
 #endif
 	}
 #if defined(CONFIG_DIAG_OVER_USB)
-	/* Check for Apps Only 8960 & get event mask request */
-	else if (!(driver->ch) && (chk_config_get_id() == AO8960_TOOLS_ID)
-			  && *buf == 0x81) {
+	/* Check for Apps Only & get event mask request */
+	else if (!(driver->ch) && chk_apps_only() && *buf == 0x81) {
 		driver->apps_rsp_buf[0] = 0x81;
 		driver->apps_rsp_buf[1] = 0x0;
 		*(uint16_t *)(driver->apps_rsp_buf + 2) = 0x0;
@@ -639,8 +655,8 @@
 		ENCODE_RSP_AND_SEND(6 + EVENT_LAST_ID/8);
 		return 0;
 	}
-	/* Get log ID range & Check for Apps Only 8960 */
-	else if (!(driver->ch) && (chk_config_get_id() == AO8960_TOOLS_ID)
+	/* Get log ID range & Check for Apps Only */
+	else if (!(driver->ch) && chk_apps_only()
 			  && (*buf == 0x73) && *(int *)(buf+4) == 1) {
 		driver->apps_rsp_buf[0] = 0x73;
 		*(int *)(driver->apps_rsp_buf + 4) = 0x1; /* operation ID */
@@ -665,7 +681,7 @@
 		return 0;
 	}
 	/* Respond to Get SSID Range request message */
-	else if (!(driver->ch) && (chk_config_get_id() == AO8960_TOOLS_ID)
+	else if (!(driver->ch) && chk_apps_only()
 			 && (*buf == 0x7d) && (*(buf+1) == 0x1)) {
 		driver->apps_rsp_buf[0] = 0x7d;
 		driver->apps_rsp_buf[1] = 0x1;
@@ -713,8 +729,8 @@
 		ENCODE_RSP_AND_SEND(83);
 		return 0;
 	}
-	/* Check for AO8960 Respond to Get Subsys Build mask */
-	else if (!(driver->ch) && (chk_config_get_id() == AO8960_TOOLS_ID)
+	/* Check for Apps Only Respond to Get Subsys Build mask */
+	else if (!(driver->ch) && chk_apps_only()
 			 && (*buf == 0x7d) && (*(buf+1) == 0x2)) {
 		ssid_first = *(uint16_t *)(buf + 2);
 		ssid_last = *(uint16_t *)(buf + 4);
@@ -901,13 +917,13 @@
 		driver->debug_flag = 0;
 	}
 	/* send error responses from APPS for Central Routing */
-	if (type == 1 && chk_config_get_id() == AO8960_TOOLS_ID) {
+	if (type == 1 && chk_apps_only()) {
 		diag_send_error_rsp(hdlc.dest_idx);
 		type = 0;
 	}
 	/* implies this packet is NOT meant for apps */
 	if (!(driver->ch) && type == 1) {
-		if (chk_config_get_id() == AO8960_TOOLS_ID) {
+		if (chk_apps_only()) {
 			diag_send_error_rsp(hdlc.dest_idx);
 		} else { /* APQ 8060, Let Q6 respond */
 			if (driver->chqdsp)
diff --git a/drivers/char/diag/diagfwd.h b/drivers/char/diag/diagfwd.h
index 0a271dd..6dacab7 100644
--- a/drivers/char/diag/diagfwd.h
+++ b/drivers/char/diag/diagfwd.h
@@ -26,8 +26,8 @@
 long diagchar_ioctl(struct file *, unsigned int, unsigned long);
 int diag_device_write(void *, int, struct diag_request *);
 int mask_request_validate(unsigned char mask_buf[]);
-int chk_config_get_id(void);
 void diag_clear_reg(int);
+int chk_apps_only(void);
 /* State for diag forwarding */
 #ifdef CONFIG_DIAG_OVER_USB
 int diagfwd_connect(void);
diff --git a/drivers/char/diag/diagfwd_cntl.c b/drivers/char/diag/diagfwd_cntl.c
index 2b88a9f..534c016 100644
--- a/drivers/char/diag/diagfwd_cntl.c
+++ b/drivers/char/diag/diagfwd_cntl.c
@@ -138,7 +138,7 @@
 	int r = 0;
 
 	/* open control ports only on 8960 */
-	if (chk_config_get_id() == AO8960_TOOLS_ID) {
+	if (chk_apps_only()) {
 		if (pdev->id == SMD_APPS_MODEM)
 			r = smd_open("DIAG_CNTL", &driver->ch_cntl, driver,
 							diag_smd_cntl_notify);
diff --git a/drivers/video/msm/Kconfig b/drivers/video/msm/Kconfig
index c33919d..34b564f 100644
--- a/drivers/video/msm/Kconfig
+++ b/drivers/video/msm/Kconfig
@@ -156,6 +156,10 @@
 	select FB_MSM_MIPI_DSI
 	default n
 
+config FB_MSM_MIPI_DSI_TRULY
+	bool
+	select FB_MSM_MIPI_DSI
+
 config FB_MSM_MIPI_DSI_SIMULATOR
 	bool
 	select FB_MSM_MIPI_DSI
@@ -282,6 +286,10 @@
 	  The panel is connected to the host
 	  via Toshiba DSI-to-LVDS bridge.
 
+config FB_MSM_MIPI_TRULY_VIDEO_WVGA_PT
+	bool
+	select FB_MSM_MIPI_DSI_TRULY
+
 config FB_MSM_MIPI_SIMULATOR_VIDEO
 	bool
 	select FB_MSM_MIPI_DSI_SIMULATOR
@@ -390,6 +398,7 @@
 	select FB_MSM_MIPI_TOSHIBA_VIDEO_WSVGA_PT
 	select FB_MSM_MIPI_RENESAS_VIDEO_FWVGA_PT
 	select FB_MSM_MIPI_RENESAS_CMD_FWVGA_PT
+	select FB_MSM_MIPI_TRULY_VIDEO_WVGA_PT
 	select FB_MSM_MIPI_NOVATEK_VIDEO_QHD_PT
 	select FB_MSM_MIPI_NOVATEK_CMD_QHD_PT
 	select FB_MSM_MIPI_SIMULATOR_VIDEO
@@ -489,6 +498,10 @@
 	bool "MIPI Chimei WXGA PT Panel"
 	select FB_MSM_MIPI_CHIMEI_WXGA
 
+config FB_MSM_MIPI_TRULY_VIDEO_WVGA_PT_PANEL
+	bool "MIPI Truly Video WVGA PT Panel"
+	select FB_MSM_MIPI_TRULY_VIDEO_WVGA_PT
+
 config FB_MSM_MIPI_SIMULATOR_VIDEO_PANEL
 	bool "MIPI Simulator Video Panel"
 	select FB_MSM_MIPI_SIMULATOR_VIDEO
diff --git a/drivers/video/msm/Makefile b/drivers/video/msm/Makefile
index 3e89f0b..d6e8ced 100644
--- a/drivers/video/msm/Makefile
+++ b/drivers/video/msm/Makefile
@@ -71,6 +71,7 @@
 obj-$(CONFIG_FB_MSM_MIPI_DSI_TOSHIBA) += mipi_toshiba.o
 obj-$(CONFIG_FB_MSM_MIPI_DSI_NOVATEK) += mipi_novatek.o
 obj-$(CONFIG_FB_MSM_MIPI_DSI_RENESAS) += mipi_renesas.o
+obj-$(CONFIG_FB_MSM_MIPI_DSI_TRULY) += mipi_truly.o
 obj-$(CONFIG_FB_MSM_MIPI_DSI_SIMULATOR) += mipi_simulator.o
 
 # MIPI Bridge
@@ -107,14 +108,23 @@
 obj-$(CONFIG_FB_MSM_MDDI_QUICKVX) += mddi_quickvx.o
 endif
 
+ifeq ($(CONFIG_FB_MSM_MIPI_PANEL_DETECT),y)
+obj-y += mipi_toshiba_video_wvga_pt.o mipi_toshiba_video_wsvga_pt.o
+obj-y += mipi_novatek_video_qhd_pt.o mipi_novatek_cmd_qhd_pt.o
+obj-y += mipi_renesas_video_fwvga_pt.o mipi_renesas_cmd_fwvga_pt.o
+obj-y += mipi_chimei_wxga_pt.o
+obj-y += mipi_truly_video_wvga_pt.o
+else
 obj-$(CONFIG_FB_MSM_MIPI_TOSHIBA_VIDEO_WVGA_PT) += mipi_toshiba_video_wvga_pt.o
 obj-$(CONFIG_FB_MSM_MIPI_TOSHIBA_VIDEO_WSVGA_PT) += mipi_toshiba_video_wsvga_pt.o
 obj-$(CONFIG_FB_MSM_MIPI_NOVATEK_VIDEO_QHD_PT) += mipi_novatek_video_qhd_pt.o
 obj-$(CONFIG_FB_MSM_MIPI_NOVATEK_CMD_QHD_PT) += mipi_novatek_cmd_qhd_pt.o
 obj-$(CONFIG_FB_MSM_MIPI_RENESAS_VIDEO_FWVGA_PT) += mipi_renesas_video_fwvga_pt.o
 obj-$(CONFIG_FB_MSM_MIPI_RENESAS_CMD_FWVGA_PT) += mipi_renesas_cmd_fwvga_pt.o
+obj-$(CONFIG_FB_MSM_MIPI_TRULY_VIDEO_WVGA_PT) += mipi_truly_video_wvga_pt.o
 obj-$(CONFIG_FB_MSM_MIPI_SIMULATOR_VIDEO) += mipi_simulator_video.o
 obj-$(CONFIG_FB_MSM_MIPI_CHIMEI_WXGA) += mipi_chimei_wxga_pt.o
+endif
 
 obj-$(CONFIG_FB_MSM_LCDC_PANEL) += lcdc_panel.o
 obj-$(CONFIG_FB_MSM_LCDC_PRISM_WVGA) += lcdc_prism.o
diff --git a/drivers/video/msm/mipi_truly.c b/drivers/video/msm/mipi_truly.c
new file mode 100644
index 0000000..a2060f0
--- /dev/null
+++ b/drivers/video/msm/mipi_truly.c
@@ -0,0 +1,259 @@
+/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include "msm_fb.h"
+#include "mipi_dsi.h"
+#include "mipi_truly.h"
+
+static struct msm_panel_common_pdata *mipi_truly_pdata;
+static struct dsi_buf truly_tx_buf;
+static struct dsi_buf truly_rx_buf;
+
+#define TRULY_CMD_DELAY		0
+#define TRULY_SLEEP_OFF_DELAY	150
+#define TRULY_DISPLAY_ON_DELAY	150
+#define GPIO_TRULY_LCD_RESET	129
+
+static int prev_bl = 17;
+
+static char extend_cmd_enable[4] = {0xB9, 0xFF, 0x83, 0x69};
+static char display_setting[16] = {
+	0xB2, 0x00, 0x23, 0x62,
+	0x62, 0x70, 0x00, 0xFF,
+	0x00, 0x00, 0x00, 0x00,
+	0x03, 0x03, 0x00, 0x01,
+};
+static char wave_cycle_setting[6] = {0xB4, 0x00, 0x1D, 0x5F, 0x0E, 0x06};
+static char gip_setting[27] = {
+	0xD5, 0x00, 0x04, 0x03,
+	0x00, 0x01, 0x05, 0x1C,
+	0x70, 0x01, 0x03, 0x00,
+	0x00, 0x40, 0x06, 0x51,
+	0x07, 0x00, 0x00, 0x41,
+	0x06, 0x50, 0x07, 0x07,
+	0x0F, 0x04, 0x00,
+};
+static char power_setting[20] = {
+	0xB1, 0x01, 0x00, 0x34,
+	0x06, 0x00, 0x0F, 0x0F,
+	0x2A, 0x32, 0x3F, 0x3F,
+	0x07, 0x3A, 0x01, 0xE6,
+	0xE6, 0xE6, 0xE6, 0xE6,
+};
+static char vcom_setting[3] = {0xB6, 0x56, 0x56};
+static char pannel_setting[2] = {0xCC, 0x02};
+static char gamma_setting[35] = {
+	0xE0, 0x00, 0x1D, 0x22,
+	0x38, 0x3D, 0x3F, 0x2E,
+	0x4A, 0x06, 0x0D, 0x0F,
+	0x13, 0x15, 0x13, 0x16,
+	0x10, 0x19, 0x00, 0x1D,
+	0x22, 0x38, 0x3D, 0x3F,
+	0x2E, 0x4A, 0x06, 0x0D,
+	0x0F, 0x13, 0x15, 0x13,
+	0x16, 0x10, 0x19,
+};
+static char mipi_setting[14] = {
+	0xBA, 0x00, 0xA0, 0xC6,
+	0x00, 0x0A, 0x00, 0x10,
+	0x30, 0x6F, 0x02, 0x11,
+	0x18, 0x40,
+};
+static char exit_sleep[2] = {0x11, 0x00};
+static char display_on[2] = {0x29, 0x00};
+static char display_off[2] = {0x28, 0x00};
+static char enter_sleep[2] = {0x10, 0x00};
+
+static struct dsi_cmd_desc truly_display_off_cmds[] = {
+	{DTYPE_DCS_WRITE, 1, 0, 0, 10, sizeof(display_off), display_off},
+	{DTYPE_DCS_WRITE, 1, 0, 0, 120, sizeof(enter_sleep), enter_sleep}
+};
+
+static struct dsi_cmd_desc truly_display_on_cmds[] = {
+	{DTYPE_GEN_LWRITE, 1, 0, 0, TRULY_CMD_DELAY,
+			sizeof(extend_cmd_enable), extend_cmd_enable},
+	{DTYPE_GEN_LWRITE, 1, 0, 0, TRULY_CMD_DELAY,
+			sizeof(display_setting), display_setting},
+	{DTYPE_GEN_LWRITE, 1, 0, 0, TRULY_CMD_DELAY,
+			sizeof(wave_cycle_setting), wave_cycle_setting},
+	{DTYPE_GEN_LWRITE, 1, 0, 0, TRULY_CMD_DELAY,
+			sizeof(gip_setting), gip_setting},
+	{DTYPE_GEN_LWRITE, 1, 0, 0, TRULY_CMD_DELAY,
+			sizeof(power_setting), power_setting},
+	{DTYPE_GEN_LWRITE, 1, 0, 0, TRULY_CMD_DELAY,
+			sizeof(vcom_setting), vcom_setting},
+	{DTYPE_GEN_LWRITE, 1, 0, 0, TRULY_CMD_DELAY,
+			sizeof(pannel_setting), pannel_setting},
+	{DTYPE_GEN_LWRITE, 1, 0, 0, TRULY_CMD_DELAY,
+			sizeof(gamma_setting), gamma_setting},
+	{DTYPE_GEN_LWRITE, 1, 0, 0, TRULY_CMD_DELAY,
+			sizeof(mipi_setting), mipi_setting},
+	{DTYPE_DCS_WRITE, 1, 0, 0, TRULY_SLEEP_OFF_DELAY,
+			sizeof(exit_sleep), exit_sleep},
+	{DTYPE_DCS_WRITE, 1, 0, 0, TRULY_DISPLAY_ON_DELAY,
+			sizeof(display_on), display_on},
+};
+
+static int mipi_truly_lcd_on(struct platform_device *pdev)
+{
+	struct msm_fb_data_type *mfd;
+
+	mfd = platform_get_drvdata(pdev);
+
+	if (!mfd)
+		return -ENODEV;
+	if (mfd->key != MFD_KEY)
+		return -EINVAL;
+
+	msleep(20);
+	mipi_dsi_cmds_tx(mfd, &truly_tx_buf, truly_display_on_cmds,
+			ARRAY_SIZE(truly_display_on_cmds));
+
+	return 0;
+}
+
+static int mipi_truly_lcd_off(struct platform_device *pdev)
+{
+	struct msm_fb_data_type *mfd;
+
+	mfd = platform_get_drvdata(pdev);
+
+	if (!mfd)
+		return -ENODEV;
+	if (mfd->key != MFD_KEY)
+		return -EINVAL;
+
+	mipi_dsi_cmds_tx(mfd, &truly_tx_buf, truly_display_off_cmds,
+			ARRAY_SIZE(truly_display_off_cmds));
+
+	return 0;
+}
+
+#define BL_LEVEL	17
+static void mipi_truly_set_backlight(struct msm_fb_data_type *mfd)
+{
+	int step = 0, i = 0;
+	int bl_level = mfd->bl_level;
+
+	/* real backlight level, 1 - max, 16 - min, 17 - off */
+	bl_level = BL_LEVEL - bl_level;
+
+	if (bl_level > prev_bl) {
+		step = bl_level - prev_bl;
+		if (bl_level == BL_LEVEL)
+			step--;
+	} else if (bl_level < prev_bl) {
+		step = bl_level + 16 - prev_bl;
+	} else {
+		pr_debug("%s: no change\n", __func__);
+		return;
+	}
+
+	if (bl_level == BL_LEVEL) {
+		/* turn off backlight */
+		mipi_truly_pdata->pmic_backlight(0);
+	} else {
+		if (prev_bl == BL_LEVEL) {
+			/* turn on backlight */
+			mipi_truly_pdata->pmic_backlight(1);
+			udelay(30);
+		}
+		/* adjust backlight level */
+		for (i = 0; i < step; i++) {
+			mipi_truly_pdata->pmic_backlight(0);
+			udelay(1);
+			mipi_truly_pdata->pmic_backlight(1);
+			udelay(1);
+		}
+	}
+	msleep(20);
+	prev_bl = bl_level;
+
+	return;
+}
+
+static int __devinit mipi_truly_lcd_probe(struct platform_device *pdev)
+{
+	if (pdev->id == 0) {
+		mipi_truly_pdata = pdev->dev.platform_data;
+		return 0;
+	}
+
+	msm_fb_add_device(pdev);
+
+	return 0;
+}
+
+static struct platform_driver this_driver = {
+	.probe  = mipi_truly_lcd_probe,
+	.driver = {
+		.name   = "mipi_truly",
+	},
+};
+
+static struct msm_fb_panel_data truly_panel_data = {
+	.on		= mipi_truly_lcd_on,
+	.off		= mipi_truly_lcd_off,
+	.set_backlight	= mipi_truly_set_backlight,
+};
+
+static int ch_used[3];
+
+int mipi_truly_device_register(struct msm_panel_info *pinfo,
+					u32 channel, u32 panel)
+{
+	struct platform_device *pdev = NULL;
+	int ret;
+
+	if ((channel >= 3) || ch_used[channel])
+		return -ENODEV;
+
+	ch_used[channel] = TRUE;
+
+	pdev = platform_device_alloc("mipi_truly", (panel << 8)|channel);
+
+	if (!pdev)
+		return -ENOMEM;
+
+	truly_panel_data.panel_info = *pinfo;
+
+	ret = platform_device_add_data(pdev, &truly_panel_data,
+				sizeof(truly_panel_data));
+	if (ret) {
+		pr_err("%s: platform_device_add_data failed!\n", __func__);
+		goto err_device_put;
+	}
+
+	ret = platform_device_add(pdev);
+
+	if (ret) {
+		pr_err("%s: platform_device_register failed!\n", __func__);
+		goto err_device_put;
+	}
+
+	return 0;
+
+err_device_put:
+	platform_device_put(pdev);
+	return ret;
+}
+
+static int __init mipi_truly_lcd_init(void)
+{
+	mipi_dsi_buf_alloc(&truly_tx_buf, DSI_BUF_SIZE);
+	mipi_dsi_buf_alloc(&truly_rx_buf, DSI_BUF_SIZE);
+
+	return platform_driver_register(&this_driver);
+}
+
+module_init(mipi_truly_lcd_init);
diff --git a/drivers/video/msm/mipi_truly.h b/drivers/video/msm/mipi_truly.h
new file mode 100644
index 0000000..900e6f6
--- /dev/null
+++ b/drivers/video/msm/mipi_truly.h
@@ -0,0 +1,21 @@
+/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef MIPI_TRULY_H
+#define MIPI_TRULY_H
+
+/* #define MIPI_TRULY_FAKE_PANEL */	/* FAKE PANEL for test */
+
+int mipi_truly_device_register(struct msm_panel_info *pinfo,
+		u32 channel, u32 panel);
+
+#endif  /* MIPI_TRULY_H */
diff --git a/drivers/video/msm/mipi_truly_video_wvga_pt.c b/drivers/video/msm/mipi_truly_video_wvga_pt.c
new file mode 100644
index 0000000..931c564
--- /dev/null
+++ b/drivers/video/msm/mipi_truly_video_wvga_pt.c
@@ -0,0 +1,110 @@
+/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include "msm_fb.h"
+#include "mipi_dsi.h"
+#include "mipi_truly.h"
+
+static struct msm_panel_info pinfo;
+
+static struct mipi_dsi_phy_ctrl dsi_video_mode_phy_db = {
+	/* DSI Bit Clock at 500 MHz, 2 lane, RGB888 */
+	/* regulator */
+	{0x03, 0x01, 0x01, 0x00},
+	/* timing   */
+	{0xb9, 0x8e, 0x1f, 0x00, 0x98, 0x9c, 0x22, 0x90,
+	0x18, 0x03, 0x04},
+	/* phy ctrl */
+	{0x7f, 0x00, 0x00, 0x00},
+	/* strength */
+	{0xbb, 0x02, 0x06, 0x00},
+	/* pll control */
+	{0x00, 0xec, 0x31, 0xd2, 0x00, 0x40, 0x37, 0x62,
+	0x01, 0x0f, 0x07,
+	0x05, 0x14, 0x03, 0x0, 0x0, 0x0, 0x20, 0x0, 0x02, 0x0},
+};
+
+static int __init mipi_video_truly_wvga_pt_init(void)
+{
+	int ret;
+
+#ifdef CONFIG_FB_MSM_MIPI_PANEL_DETECT
+	if (msm_fb_detect_client("mipi_video_truly_wvga"))
+		return 0;
+#endif
+
+	pinfo.xres = 480;
+	pinfo.yres = 800;
+	pinfo.type = MIPI_VIDEO_PANEL;
+	pinfo.pdest = DISPLAY_1;
+	pinfo.wait_cycle = 0;
+	pinfo.bpp = 24;
+	pinfo.lcdc.h_back_porch = 100;
+	pinfo.lcdc.h_front_porch = 100;
+	pinfo.lcdc.h_pulse_width = 8;
+	pinfo.lcdc.v_back_porch = 20;
+	pinfo.lcdc.v_front_porch = 20;
+	pinfo.lcdc.v_pulse_width = 1;
+	pinfo.lcdc.border_clr = 0;	/* blk */
+	pinfo.lcdc.underflow_clr = 0xff;	/* blue */
+	/* number of dot_clk cycles HSYNC active edge
+	   is delayed from VSYNC active edge */
+	pinfo.lcdc.hsync_skew = 0;
+	pinfo.clk_rate = 499000000;
+	pinfo.bl_max = 15;
+	pinfo.bl_min = 1;
+	pinfo.fb_num = 2;
+
+	pinfo.mipi.mode = DSI_VIDEO_MODE;
+	pinfo.mipi.pulse_mode_hsa_he = TRUE; /* send HSA and HE following
+						VS/VE packet */
+	pinfo.mipi.hfp_power_stop = TRUE; /* LP-11 during the HFP period */
+	pinfo.mipi.hbp_power_stop = TRUE; /* LP-11 during the HBP period */
+	pinfo.mipi.hsa_power_stop = TRUE; /* LP-11 during the HSA period */
+	/* LP-11 or let Command Mode Engine send packets in
+	HS or LP mode for the BLLP of the last line of a frame */
+	pinfo.mipi.eof_bllp_power_stop = TRUE;
+	/* LP-11 or let Command Mode Engine send packets in
+	HS or LP mode for packets sent during BLLP period */
+	pinfo.mipi.bllp_power_stop = TRUE;
+
+	pinfo.mipi.traffic_mode = DSI_BURST_MODE;
+	pinfo.mipi.dst_format =  DSI_VIDEO_DST_FORMAT_RGB888;
+	pinfo.mipi.vc = 0;
+	pinfo.mipi.rgb_swap = DSI_RGB_SWAP_RGB; /* RGB */
+	pinfo.mipi.data_lane0 = TRUE;
+	pinfo.mipi.data_lane1 = TRUE;
+
+	pinfo.mipi.t_clk_post = 0x20;
+	pinfo.mipi.t_clk_pre = 0x2f;
+
+	pinfo.mipi.stream = 0; /* dma_p */
+	pinfo.mipi.mdp_trigger = DSI_CMD_TRIGGER_NONE;
+	pinfo.mipi.dma_trigger = DSI_CMD_TRIGGER_SW;
+	pinfo.mipi.frame_rate = 60; /* FIXME */
+
+	pinfo.mipi.dsi_phy_db = &dsi_video_mode_phy_db;
+	pinfo.mipi.dlane_swap = 0x01;
+	pinfo.mipi.tx_eot_append = 0x01; /* append EOT at the end
+					    of data burst */
+
+	ret = mipi_truly_device_register(&pinfo, MIPI_DSI_PRIM,
+						MIPI_DSI_PANEL_WVGA_PT);
+
+	if (ret)
+		pr_err("%s: failed to register device!\n", __func__);
+
+	return ret;
+}
+
+module_init(mipi_video_truly_wvga_pt_init);
diff --git a/include/linux/diagchar.h b/include/linux/diagchar.h
index 91d67d5..5c94a3c 100644
--- a/include/linux/diagchar.h
+++ b/include/linux/diagchar.h
@@ -40,8 +40,10 @@
 #define APQ8060_MACHINE_ID	86
 #define AO8960_MACHINE_ID	87
 #define MSM8660_MACHINE_ID	71
+#define APQ8064_MACHINE_ID	109
 #define APQ8060_TOOLS_ID	4062
 #define AO8960_TOOLS_ID		4064
+#define APQ8064_TOOLS_ID	4072
 
 #define MSG_MASK_0			(0x00000001)
 #define MSG_MASK_1			(0x00000002)
diff --git a/sound/soc/codecs/wcd9310.c b/sound/soc/codecs/wcd9310.c
index ff66566..0000869 100644
--- a/sound/soc/codecs/wcd9310.c
+++ b/sound/soc/codecs/wcd9310.c
@@ -2012,21 +2012,6 @@
 	return 0;
 }
 
-static int tabla_digital_mute(struct snd_soc_dai *codec_dai, int mute)
-{
-	struct snd_soc_codec *codec = codec_dai->codec;
-
-	pr_debug("%s %d\n", __func__, mute);
-
-	/* TODO mute TX */
-	if (mute)
-		snd_soc_update_bits(codec, TABLA_A_CDC_RX1_B6_CTL, 0x01, 0x01);
-	else
-		snd_soc_update_bits(codec, TABLA_A_CDC_RX1_B6_CTL, 0x01, 0x00);
-
-	return 0;
-}
-
 static int tabla_set_dai_sysclk(struct snd_soc_dai *dai,
 		int clk_id, unsigned int freq, int dir)
 {
@@ -2137,7 +2122,6 @@
 	.hw_params = tabla_hw_params,
 	.set_sysclk = tabla_set_dai_sysclk,
 	.set_fmt = tabla_set_dai_fmt,
-	.digital_mute = tabla_digital_mute,
 };
 
 static struct snd_soc_dai_driver tabla_dai[] = {
diff --git a/sound/soc/msm/msm-pcm-q6.c b/sound/soc/msm/msm-pcm-q6.c
index 367a3e7..49324a9 100644
--- a/sound/soc/msm/msm-pcm-q6.c
+++ b/sound/soc/msm/msm-pcm-q6.c
@@ -71,9 +71,9 @@
 	.rate_max =             48000,
 	.channels_min =         1,
 	.channels_max =         2,
-	.buffer_bytes_max =     4096 * 8,
-	.period_bytes_min =	4096,
-	.period_bytes_max =     4096,
+	.buffer_bytes_max =     2048 * 8,
+	.period_bytes_min =	2048,
+	.period_bytes_max =     2048,
 	.periods_min =          8,
 	.periods_max =          8,
 	.fifo_size =            0,
diff --git a/sound/soc/msm/qdsp6/q6asm.c b/sound/soc/msm/qdsp6/q6asm.c
index 9c54548..052286b 100644
--- a/sound/soc/msm/qdsp6/q6asm.c
+++ b/sound/soc/msm/qdsp6/q6asm.c
@@ -790,7 +790,7 @@
 				do_gettimeofday(&in_cont_tv);
 				pr_err("In_CONT:previous read buffer done \
 				at %ld sec %ld microsec\n",\
-				out_cont_tv.tv_sec, out_cont_tv.tv_usec);
+				in_cont_tv.tv_sec, in_cont_tv.tv_usec);
 			}
 		}
 #endif