Merge "msm: smd_tty: Add check for platform device id" into msm-3.0
diff --git a/arch/arm/mach-msm/board-8064-display.c b/arch/arm/mach-msm/board-8064-display.c
index 144cea5..2908025 100644
--- a/arch/arm/mach-msm/board-8064-display.c
+++ b/arch/arm/mach-msm/board-8064-display.c
@@ -73,19 +73,21 @@
static int msm_fb_detect_panel(const char *name)
{
+ u32 version;
if (machine_is_apq8064_liquid()) {
- if (!strncmp(name, LVDS_CHIMEI_PANEL_NAME,
- strnlen(LVDS_CHIMEI_PANEL_NAME,
- PANEL_NAME_MAX_LEN)))
- return 0;
-
-#if !defined(CONFIG_FB_MSM_LVDS_MIPI_PANEL_DETECT) && \
- !defined(CONFIG_FB_MSM_MIPI_PANEL_DETECT)
- if (!strncmp(name, MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME,
- strnlen(MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME,
- PANEL_NAME_MAX_LEN)))
- return 0;
-#endif
+ version = socinfo_get_platform_version();
+ if ((SOCINFO_VERSION_MAJOR(version) == 1) &&
+ (SOCINFO_VERSION_MINOR(version) == 1)) {
+ if (!strncmp(name, MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME,
+ strnlen(MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME,
+ PANEL_NAME_MAX_LEN)))
+ return 0;
+ } else {
+ if (!strncmp(name, LVDS_CHIMEI_PANEL_NAME,
+ strnlen(LVDS_CHIMEI_PANEL_NAME,
+ PANEL_NAME_MAX_LEN)))
+ return 0;
+ }
} else if (machine_is_apq8064_mtp()) {
if (!strncmp(name, MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME,
strnlen(MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME,
diff --git a/arch/arm/mach-msm/board-8064-storage.c b/arch/arm/mach-msm/board-8064-storage.c
index e9c455d..cdafdfc 100644
--- a/arch/arm/mach-msm/board-8064-storage.c
+++ b/arch/arm/mach-msm/board-8064-storage.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2011-2012, 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
@@ -263,6 +263,14 @@
apq8064_sdc3_pdata->disable_cmd23 = true;
}
}
- apq8064_add_sdcc(1, apq8064_sdc1_pdata);
- apq8064_add_sdcc(3, apq8064_sdc3_pdata);
+ if (apq8064_sdc1_pdata) {
+ apq8064_sdc1_pdata->swfi_latency =
+ apq8064_rpm_get_swfi_latency();
+ apq8064_add_sdcc(1, apq8064_sdc1_pdata);
+ }
+ if (apq8064_sdc3_pdata) {
+ apq8064_sdc3_pdata->swfi_latency =
+ apq8064_rpm_get_swfi_latency();
+ apq8064_add_sdcc(3, apq8064_sdc3_pdata);
+ }
}
diff --git a/arch/arm/mach-msm/board-8064.c b/arch/arm/mach-msm/board-8064.c
index 35f17ce..2bb2702 100644
--- a/arch/arm/mach-msm/board-8064.c
+++ b/arch/arm/mach-msm/board-8064.c
@@ -1191,7 +1191,7 @@
},
};
-static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = {
+static struct msm_rpmrs_level msm_rpmrs_levels[] = {
{
MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
@@ -1255,6 +1255,19 @@
},
};
+uint32_t apq8064_rpm_get_swfi_latency(void)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(msm_rpmrs_levels); i++) {
+ if (msm_rpmrs_levels[i].sleep_mode ==
+ MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)
+ return msm_rpmrs_levels[i].latency_us;
+ }
+
+ return 0;
+}
+
static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
.mode = MSM_PM_BOOT_CONFIG_TZ,
};
diff --git a/arch/arm/mach-msm/board-8064.h b/arch/arm/mach-msm/board-8064.h
index e8c8144..c19a039 100644
--- a/arch/arm/mach-msm/board-8064.h
+++ b/arch/arm/mach-msm/board-8064.h
@@ -72,6 +72,7 @@
void apq8064_init_fb(void);
void apq8064_allocate_fb_region(void);
void apq8064_mdp_writeback(struct memtype_reserve *reserve_table);
+uint32_t apq8064_rpm_get_swfi_latency(void);
void apq8064_init_gpu(void);
void apq8064_pm8xxx_gpio_mpp_init(void);
diff --git a/arch/arm/mach-msm/board-8960-display.c b/arch/arm/mach-msm/board-8960-display.c
index 7e92266..3941e66 100644
--- a/arch/arm/mach-msm/board-8960-display.c
+++ b/arch/arm/mach-msm/board-8960-display.c
@@ -30,18 +30,22 @@
#ifdef CONFIG_FB_MSM_TRIPLE_BUFFER
#define MSM_FB_PRIM_BUF_SIZE \
- (roundup((1920 * 1200 * 4), 4096) * 3) /* 4 bpp x 3 pages */
+ (roundup((roundup(1920, 32) * roundup(1200, 32) * 4), 4096) * 3)
+ /* 4 bpp x 3 pages */
#else
#define MSM_FB_PRIM_BUF_SIZE \
- (roundup((1920 * 1200 * 4), 4096) * 2) /* 4 bpp x 2 pages */
+ (roundup((roundup(1920, 32) * roundup(1200, 32) * 4), 4096) * 2)
+ /* 4 bpp x 2 pages */
#endif
#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
#define MSM_FB_EXT_BUF_SIZE \
- (roundup((1920 * 1088 * 2), 4096) * 1) /* 2 bpp x 1 page */
+ (roundup((roundup(1920, 32) * roundup(1080, 32) * 2), 4096) * 1)
+ /* 2 bpp x 1 page */
#elif defined(CONFIG_FB_MSM_TVOUT)
#define MSM_FB_EXT_BUF_SIZE \
- (roundup((720 * 576 * 2), 4096) * 2) /* 2 bpp x 2 pages */
+ (roundup((roundup(720, 32) * roundup(576, 32) * 2), 4096) * 2)
+ /* 2 bpp x 2 pages */
#else
#define MSM_FB_EXT_BUF_SIZE 0
#endif
@@ -50,13 +54,15 @@
#define MSM_FB_SIZE roundup(MSM_FB_PRIM_BUF_SIZE + MSM_FB_EXT_BUF_SIZE, 4096)
#ifdef CONFIG_FB_MSM_OVERLAY0_WRITEBACK
-#define MSM_FB_OVERLAY0_WRITEBACK_SIZE roundup((1920 * 1200 * 3 * 2), 4096)
+#define MSM_FB_OVERLAY0_WRITEBACK_SIZE \
+ roundup((roundup(1920, 32) * roundup(1200, 32) * 3 * 2), 4096)
#else
#define MSM_FB_OVERLAY0_WRITEBACK_SIZE (0)
#endif /* CONFIG_FB_MSM_OVERLAY0_WRITEBACK */
#ifdef CONFIG_FB_MSM_OVERLAY1_WRITEBACK
-#define MSM_FB_OVERLAY1_WRITEBACK_SIZE roundup((1920 * 1088 * 3 * 2), 4096)
+#define MSM_FB_OVERLAY1_WRITEBACK_SIZE \
+ roundup((roundup(1920, 32) * roundup(1080, 32) * 3 * 2), 4096)
#else
#define MSM_FB_OVERLAY1_WRITEBACK_SIZE (0)
#endif /* CONFIG_FB_MSM_OVERLAY1_WRITEBACK */
diff --git a/arch/arm/mach-msm/board-msm7x27a.c b/arch/arm/mach-msm/board-msm7x27a.c
index 91185ea..d07703b 100644
--- a/arch/arm/mach-msm/board-msm7x27a.c
+++ b/arch/arm/mach-msm/board-msm7x27a.c
@@ -1363,12 +1363,16 @@
static void __init msm7x27a_pm_init(void)
{
- if (machine_is_msm8625_surf())
- return;
-
- msm_pm_set_platform_data(msm7x27a_pm_data,
- ARRAY_SIZE(msm7x27a_pm_data));
- BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
+ if (machine_is_msm8625_surf()) {
+ msm_pm_set_platform_data(msm8625_pm_data,
+ ARRAY_SIZE(msm8625_pm_data));
+ BUG_ON(msm_pm_boot_init(&msm_pm_8625_boot_pdata));
+ msm8x25_spm_device_init();
+ } else {
+ msm_pm_set_platform_data(msm7x27a_pm_data,
+ ARRAY_SIZE(msm7x27a_pm_data));
+ BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
+ }
}
static void __init msm7x2x_init(void)
diff --git a/arch/arm/mach-msm/board-msm7x30.c b/arch/arm/mach-msm/board-msm7x30.c
index 0dbf555..b750b7e 100644
--- a/arch/arm/mach-msm/board-msm7x30.c
+++ b/arch/arm/mach-msm/board-msm7x30.c
@@ -4295,11 +4295,24 @@
static int msm_fb_mddi_client_power(u32 client_id)
{
+ int rc;
printk(KERN_NOTICE "\n client_id = 0x%x", client_id);
/* Check if it is Quicklogic client */
if (client_id == 0xc5835800) {
printk(KERN_NOTICE "\n Quicklogic MDDI client");
other_mddi_client = 0;
+ if (IS_ERR(mddi_ldo16)) {
+ rc = PTR_ERR(mddi_ldo16);
+ pr_err("%s: gp10 vreg get failed (%d)\n", __func__, rc);
+ return rc;
+ }
+ rc = regulator_disable(mddi_ldo16);
+ if (rc) {
+ pr_err("%s: LDO16 vreg enable failed (%d)\n",
+ __func__, rc);
+ return rc;
+ }
+
} else {
printk(KERN_NOTICE "\n Non-Quicklogic MDDI client");
quickvx_mddi_client = 0;
diff --git a/arch/arm/mach-msm/board-qrd7627a.c b/arch/arm/mach-msm/board-qrd7627a.c
index fc97043..b3d7de4 100644
--- a/arch/arm/mach-msm/board-qrd7627a.c
+++ b/arch/arm/mach-msm/board-qrd7627a.c
@@ -917,7 +917,7 @@
/* T38 Object */
16, 0, 0, 0, 0, 0, 0, 0,
/* T7 Object */
- 255, 255, 10,
+ 32, 16, 50,
/* T8 Object */
30, 0, 20, 20, 0, 0, 20, 0, 50, 0,
/* T9 Object */
diff --git a/arch/arm/mach-msm/clock-8960.c b/arch/arm/mach-msm/clock-8960.c
index 39030f1..38ea570 100644
--- a/arch/arm/mach-msm/clock-8960.c
+++ b/arch/arm/mach-msm/clock-8960.c
@@ -4488,6 +4488,7 @@
static DEFINE_CLK_VOTER(dfab_sps_clk, &dfab_clk.c);
static DEFINE_CLK_VOTER(dfab_bam_dmux_clk, &dfab_clk.c);
static DEFINE_CLK_VOTER(dfab_scm_clk, &dfab_clk.c);
+static DEFINE_CLK_VOTER(dfab_qseecom_clk, &dfab_clk.c);
static DEFINE_CLK_VOTER(ebi1_msmbus_clk, &ebi1_clk.c);
static DEFINE_CLK_VOTER(ebi1_adm_clk, &ebi1_clk.c);
@@ -5143,6 +5144,7 @@
CLK_LOOKUP("dfab_clk", dfab_sps_clk.c, "msm_sps"),
CLK_LOOKUP("bus_clk", dfab_bam_dmux_clk.c, "BAM_RMNT"),
CLK_LOOKUP("bus_clk", dfab_scm_clk.c, "scm"),
+ CLK_LOOKUP("bus_clk", dfab_qseecom_clk.c, "qseecom"),
CLK_LOOKUP("alt_core_clk", usb_hsic_xcvr_fs_clk.c, "msm_hsic_host"),
CLK_LOOKUP("phy_clk", usb_hsic_hsic_clk.c, "msm_hsic_host"),
@@ -5448,6 +5450,7 @@
CLK_LOOKUP("dfab_clk", dfab_sps_clk.c, "msm_sps"),
CLK_LOOKUP("bus_clk", dfab_bam_dmux_clk.c, "BAM_RMNT"),
CLK_LOOKUP("bus_clk", dfab_scm_clk.c, "scm"),
+ CLK_LOOKUP("bus_clk", dfab_qseecom_clk.c, "qseecom"),
CLK_LOOKUP("mem_clk", ebi1_adm_clk.c, "msm_dmov"),
diff --git a/arch/arm/mach-msm/include/mach/msm_smd.h b/arch/arm/mach-msm/include/mach/msm_smd.h
index 8d3e640..183afed 100644
--- a/arch/arm/mach-msm/include/mach/msm_smd.h
+++ b/arch/arm/mach-msm/include/mach/msm_smd.h
@@ -46,6 +46,7 @@
SMD_WCNSS = SMSM_WCNSS,
SMD_DSPS = SMSM_DSPS,
SMD_MODEM_Q6_FW,
+ SMD_RPM,
NUM_SMD_SUBSYSTEMS,
};
@@ -65,6 +66,10 @@
SMD_QDSP_Q6FW,
SMD_DSPS_Q6FW,
SMD_WCNSS_Q6FW,
+ SMD_APPS_RPM,
+ SMD_MODEM_RPM,
+ SMD_QDSP_RPM,
+ SMD_WCNSS_RPM,
SMD_NUM_TYPE,
SMD_LOOPBACK_TYPE = 100,
diff --git a/arch/arm/mach-msm/pil-gss.c b/arch/arm/mach-msm/pil-gss.c
index c4477ff..78a6054 100644
--- a/arch/arm/mach-msm/pil-gss.c
+++ b/arch/arm/mach-msm/pil-gss.c
@@ -26,6 +26,8 @@
#include <mach/msm_iomap.h>
#include <mach/msm_xo.h>
#include <mach/socinfo.h>
+#include <mach/msm_bus_board.h>
+#include <mach/msm_bus.h>
#include "peripheral-loader.h"
#include "scm-pas.h"
@@ -166,6 +168,9 @@
return ret;
}
+ /* Make sure bus port is halted. */
+ msm_bus_axi_porthalt(MSM_BUS_MASTER_GSS_NAV);
+
/*
* Vote PLL on in GSS's voting register and wait for it to enable.
* The PLL must be enable to switch the GFMUX to a low-power source.
@@ -216,6 +221,14 @@
if (ret)
return ret;
+ /* Unhalt bus port. */
+ ret = msm_bus_axi_portunhalt(MSM_BUS_MASTER_GSS_NAV);
+ if (ret) {
+ dev_err(pil->dev, "Failed to unhalt bus port\n");
+ remove_gss_proxy_votes_now(drv);
+ return ret;
+ }
+
/* Vote PLL on in GSS's voting register and wait for it to enable. */
writel_relaxed(PLL5_VOTE, PLL_ENA_GSS);
while ((readl_relaxed(PLL5_STATUS) & PLL_STATUS) == 0)
@@ -278,6 +291,7 @@
return ret;
}
+ msm_bus_axi_porthalt(MSM_BUS_MASTER_GSS_NAV);
ret = pas_shutdown(PAS_GSS);
clk_disable_unprepare(drv->xo);
remove_gss_proxy_votes_now(drv);
@@ -292,11 +306,17 @@
err = make_gss_proxy_votes(pil->dev);
if (err)
- return err;
+ goto out;
+
+ err = msm_bus_axi_portunhalt(MSM_BUS_MASTER_GSS_NAV);
+ if (err) {
+ dev_err(pil->dev, "Failed to unhalt bus port\n");
+ goto remove_votes;
+ }
err = pas_auth_and_reset(PAS_GSS);
if (err)
- remove_gss_proxy_votes_now(drv);
+ goto halt_port;
if (cpu_is_apq8064() &&
((SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1) &&
@@ -314,7 +334,13 @@
*/
writel_relaxed(0x0, drv->base + GSS_CSR_RESET);
}
+ return 0;
+halt_port:
+ msm_bus_axi_porthalt(MSM_BUS_MASTER_GSS_NAV);
+remove_votes:
+ remove_gss_proxy_votes_now(drv);
+out:
return err;
}
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
old mode 100755
new mode 100644
diff --git a/drivers/media/video/msm/csi/msm_csid.c b/drivers/media/video/msm/csi/msm_csid.c
index d247467..d7abaa9 100644
--- a/drivers/media/video/msm/csi/msm_csid.c
+++ b/drivers/media/video/msm/csi/msm_csid.c
@@ -117,7 +117,8 @@
uint32_t irq;
struct csid_device *csid_dev = data;
irq = msm_io_r(csid_dev->base + CSID_IRQ_STATUS_ADDR);
- CDBG("%s CSID_IRQ_STATUS_ADDR = 0x%x\n", __func__, irq);
+ CDBG("%s CSID%d_IRQ_STATUS_ADDR = 0x%x\n",
+ __func__, csid_dev->pdev->id, irq);
msm_io_w(irq, csid_dev->base + CSID_IRQ_CLEAR_CMD_ADDR);
return IRQ_HANDLED;
}
@@ -180,11 +181,13 @@
goto clk_enable_failed;
}
+ csid_dev->hw_version =
+ msm_io_r(csid_dev->base + CSID_HW_VERSION_ADDR);
+ *csid_version = csid_dev->hw_version;
+
#if DBG_CSID
enable_irq(csid_dev->irq->start);
#endif
-
- *csid_version = csid_dev->hw_version;
return 0;
clk_enable_failed:
@@ -223,19 +226,27 @@
static long msm_csid_subdev_ioctl(struct v4l2_subdev *sd,
unsigned int cmd, void *arg)
{
+ int rc = -ENOIOCTLCMD;
struct csid_cfg_params cfg_params;
+ struct csid_device *csid_dev = v4l2_get_subdevdata(sd);
+ mutex_lock(&csid_dev->mutex);
switch (cmd) {
case VIDIOC_MSM_CSID_CFG:
cfg_params.subdev = sd;
cfg_params.parms = arg;
- return msm_csid_config((struct csid_cfg_params *)&cfg_params);
+ rc = msm_csid_config((struct csid_cfg_params *)&cfg_params);
+ break;
case VIDIOC_MSM_CSID_INIT:
- return msm_csid_init(sd, (uint32_t *)arg);
+ rc = msm_csid_init(sd, (uint32_t *)arg);
+ break;
case VIDIOC_MSM_CSID_RELEASE:
- return msm_csid_release(sd);
+ rc = msm_csid_release(sd);
+ break;
default:
- return -ENOIOCTLCMD;
+ pr_err("%s: command not found\n", __func__);
}
+ mutex_unlock(&csid_dev->mutex);
+ return rc;
}
static struct v4l2_subdev_core_ops msm_csid_subdev_core_ops = {
@@ -296,17 +307,6 @@
}
disable_irq(new_csid_dev->irq->start);
- new_csid_dev->base = ioremap(new_csid_dev->mem->start,
- resource_size(new_csid_dev->mem));
- if (!new_csid_dev->base) {
- rc = -ENOMEM;
- goto csid_no_resource;
- }
-
- new_csid_dev->hw_version =
- msm_io_r(new_csid_dev->base + CSID_HW_VERSION_ADDR);
- iounmap(new_csid_dev->base);
-
new_csid_dev->pdev = pdev;
return 0;
diff --git a/drivers/media/video/msm/csi/msm_csiphy.c b/drivers/media/video/msm/csi/msm_csiphy.c
index 315cca7..a30dc29 100644
--- a/drivers/media/video/msm/csi/msm_csiphy.c
+++ b/drivers/media/video/msm/csi/msm_csiphy.c
@@ -108,19 +108,24 @@
struct csiphy_device *csiphy_dev = data;
irq = msm_io_r(csiphy_dev->base + MIPI_CSIPHY_INTERRUPT_STATUS0_ADDR);
msm_io_w(irq, csiphy_dev->base + MIPI_CSIPHY_INTERRUPT_CLEAR0_ADDR);
- CDBG("%s MIPI_CSIPHY_INTERRUPT_STATUS0 = 0x%x\n", __func__, irq);
+ CDBG("%s MIPI_CSIPHY%d_INTERRUPT_STATUS0 = 0x%x\n",
+ __func__, csiphy_dev->pdev->id, irq);
irq = msm_io_r(csiphy_dev->base + MIPI_CSIPHY_INTERRUPT_STATUS1_ADDR);
msm_io_w(irq, csiphy_dev->base + MIPI_CSIPHY_INTERRUPT_CLEAR1_ADDR);
- CDBG("%s MIPI_CSIPHY_INTERRUPT_STATUS1 = 0x%x\n", __func__, irq);
+ CDBG("%s MIPI_CSIPHY%d_INTERRUPT_STATUS1 = 0x%x\n",
+ __func__, csiphy_dev->pdev->id, irq);
irq = msm_io_r(csiphy_dev->base + MIPI_CSIPHY_INTERRUPT_STATUS2_ADDR);
msm_io_w(irq, csiphy_dev->base + MIPI_CSIPHY_INTERRUPT_CLEAR2_ADDR);
- CDBG("%s MIPI_CSIPHY_INTERRUPT_STATUS2 = 0x%x\n", __func__, irq);
+ CDBG("%s MIPI_CSIPHY%d_INTERRUPT_STATUS2 = 0x%x\n",
+ __func__, csiphy_dev->pdev->id, irq);
irq = msm_io_r(csiphy_dev->base + MIPI_CSIPHY_INTERRUPT_STATUS3_ADDR);
msm_io_w(irq, csiphy_dev->base + MIPI_CSIPHY_INTERRUPT_CLEAR3_ADDR);
- CDBG("%s MIPI_CSIPHY_INTERRUPT_STATUS3 = 0x%x\n", __func__, irq);
+ CDBG("%s MIPI_CSIPHY%d_INTERRUPT_STATUS3 = 0x%x\n",
+ __func__, csiphy_dev->pdev->id, irq);
irq = msm_io_r(csiphy_dev->base + MIPI_CSIPHY_INTERRUPT_STATUS4_ADDR);
msm_io_w(irq, csiphy_dev->base + MIPI_CSIPHY_INTERRUPT_CLEAR4_ADDR);
- CDBG("%s MIPI_CSIPHY_INTERRUPT_STATUS4 = 0x%x\n", __func__, irq);
+ CDBG("%s MIPI_CSIPHY%d_INTERRUPT_STATUS4 = 0x%x\n",
+ __func__, csiphy_dev->pdev->id, irq);
msm_io_w(0x1, csiphy_dev->base + 0x164);
msm_io_w(0x0, csiphy_dev->base + 0x164);
return IRQ_HANDLED;
@@ -184,12 +189,12 @@
msm_io_w(0x0, csiphy_dev->base + MIPI_CSIPHY_LNCK_CFG2_ADDR);
msm_io_w(0x0, csiphy_dev->base + MIPI_CSIPHY_GLBL_PWR_CFG_ADDR);
- msm_cam_clk_enable(&csiphy_dev->pdev->dev, csiphy_clk_info,
- csiphy_dev->csiphy_clk, ARRAY_SIZE(csiphy_clk_info), 0);
-
#if DBG_CSIPHY
disable_irq(csiphy_dev->irq->start);
#endif
+ msm_cam_clk_enable(&csiphy_dev->pdev->dev, csiphy_clk_info,
+ csiphy_dev->csiphy_clk, ARRAY_SIZE(csiphy_clk_info), 0);
+
iounmap(csiphy_dev->base);
return 0;
}
@@ -197,20 +202,28 @@
static long msm_csiphy_subdev_ioctl(struct v4l2_subdev *sd,
unsigned int cmd, void *arg)
{
+ int rc = -ENOIOCTLCMD;
struct csiphy_cfg_params cfg_params;
+ struct csiphy_device *csiphy_dev = v4l2_get_subdevdata(sd);
+ mutex_lock(&csiphy_dev->mutex);
switch (cmd) {
case VIDIOC_MSM_CSIPHY_CFG:
cfg_params.subdev = sd;
cfg_params.parms = arg;
- return msm_csiphy_config(
+ rc = msm_csiphy_config(
(struct csiphy_cfg_params *)&cfg_params);
+ break;
case VIDIOC_MSM_CSIPHY_INIT:
- return msm_csiphy_init(sd);
+ rc = msm_csiphy_init(sd);
+ break;
case VIDIOC_MSM_CSIPHY_RELEASE:
- return msm_csiphy_release(sd);
+ rc = msm_csiphy_release(sd);
+ break;
default:
- return -ENOIOCTLCMD;
+ pr_err("%s: command not found\n", __func__);
}
+ mutex_unlock(&csiphy_dev->mutex);
+ return rc;
}
static struct v4l2_subdev_core_ops msm_csiphy_subdev_core_ops = {
diff --git a/drivers/media/video/msm/csi/msm_ispif.c b/drivers/media/video/msm/csi/msm_ispif.c
index 86d62c9..f4dde2a 100644
--- a/drivers/media/video/msm/csi/msm_ispif.c
+++ b/drivers/media/video/msm/csi/msm_ispif.c
@@ -525,16 +525,16 @@
struct ispif_device *ispif =
(struct ispif_device *)v4l2_get_subdevdata(sd);
+ CDBG("%s, free_irq\n", __func__);
+ free_irq(ispif->irq->start, 0);
+ tasklet_kill(&ispif_tasklet);
+
if (ispif->csid_version == CSID_VERSION_V2)
msm_cam_clk_enable(&ispif->pdev->dev, ispif_clk_info,
ispif->ispif_clk, ARRAY_SIZE(ispif_clk_info), 0);
else
msm_cam_clk_enable(&ispif->pdev->dev, ispif_clk_info,
ispif->ispif_clk, 2, 0);
-
- CDBG("%s, free_irq\n", __func__);
- free_irq(ispif->irq->start, 0);
- tasklet_kill(&ispif_tasklet);
}
void msm_ispif_vfe_get_cid(uint8_t intftype, char *cids, int *num)
diff --git a/drivers/media/video/msm/msm_vfe32.c b/drivers/media/video/msm/msm_vfe32.c
index e9201ea..f9c960a 100644
--- a/drivers/media/video/msm/msm_vfe32.c
+++ b/drivers/media/video/msm/msm_vfe32.c
@@ -3949,6 +3949,9 @@
void msm_vfe_subdev_release(struct platform_device *pdev)
{
struct msm_sync *sync = vfe_syncdata;
+ CDBG("%s, free_irq\n", __func__);
+ disable_irq(vfe32_ctrl->vfeirq->start);
+ tasklet_kill(&vfe32_tasklet);
msm_cam_clk_enable(&vfe32_ctrl->pdev->dev, vfe32_clk_info,
vfe32_ctrl->vfe_clk, ARRAY_SIZE(vfe32_clk_info), 0);
if (vfe32_ctrl->fs_vfe) {
@@ -3956,9 +3959,6 @@
regulator_put(vfe32_ctrl->fs_vfe);
vfe32_ctrl->fs_vfe = NULL;
}
- CDBG("%s, free_irq\n", __func__);
- disable_irq(vfe32_ctrl->vfeirq->start);
- tasklet_kill(&vfe32_tasklet);
iounmap(vfe32_ctrl->vfebase);
if (atomic_read(&irq_cnt))
diff --git a/drivers/media/video/msm/msm_vpe.c b/drivers/media/video/msm/msm_vpe.c
index 7186e58..5919553 100644
--- a/drivers/media/video/msm/msm_vpe.c
+++ b/drivers/media/video/msm/msm_vpe.c
@@ -529,14 +529,14 @@
}
spin_unlock_irqrestore(&vpe_ctrl->lock, flags);
+ disable_irq(vpe_ctrl->vpeirq->start);
+ tasklet_kill(&vpe_tasklet);
msm_cam_clk_enable(&vpe_ctrl->pdev->dev, vpe_clk_info,
vpe_ctrl->vpe_clk, ARRAY_SIZE(vpe_clk_info), 0);
regulator_disable(vpe_ctrl->fs_vpe);
regulator_put(vpe_ctrl->fs_vpe);
vpe_ctrl->fs_vpe = NULL;
- disable_irq(vpe_ctrl->vpeirq->start);
- tasklet_kill(&vpe_tasklet);
spin_lock_irqsave(&vpe_ctrl->lock, flags);
vpe_ctrl->state = VPE_STATE_IDLE;
spin_unlock_irqrestore(&vpe_ctrl->lock, flags);
diff --git a/drivers/mfd/pmic8901.c b/drivers/mfd/pmic8901.c
index 080a3e3..aec382a 100644
--- a/drivers/mfd/pmic8901.c
+++ b/drivers/mfd/pmic8901.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2010-2012, 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
@@ -270,7 +270,7 @@
return rc;
}
-static int pm8901_probe(struct platform_device *pdev)
+static int __devinit pm8901_probe(struct platform_device *pdev)
{
int rc;
struct pm8901_platform_data *pdata = pdev->dev.platform_data;
diff --git a/drivers/misc/qseecom.c b/drivers/misc/qseecom.c
index a8f9f35..495a986 100644
--- a/drivers/misc/qseecom.c
+++ b/drivers/misc/qseecom.c
@@ -1137,6 +1137,10 @@
if (!qsee_perf_client)
return -EINVAL;
+ /* Check if the clk is valid */
+ if (IS_ERR_OR_NULL(qseecom_bus_clk))
+ return -EINVAL;
+
mutex_lock(&qsee_bw_mutex);
if (!qsee_bw_count) {
ret = msm_bus_scale_client_update_request(
@@ -1160,8 +1164,13 @@
static void qsee_disable_clock_vote(void)
{
+
if (!qsee_perf_client)
- return ;
+ return;
+
+ /* Check if the clk is valid */
+ if (IS_ERR_OR_NULL(qseecom_bus_clk))
+ return;
mutex_lock(&qsee_bw_mutex);
if (qsee_bw_count > 0) {
@@ -1341,6 +1350,8 @@
}
}
kfree(data);
+ qsee_disable_clock_vote();
+
return ret;
}
@@ -1384,7 +1395,6 @@
static int __init qseecom_init(void)
{
int rc;
- int ret = 0;
struct device *class_dev;
char qsee_not_legacy = 0;
uint32_t system_call_id = QSEOS_CHECK_VERSION_CMD;
@@ -1448,22 +1458,21 @@
}
/* register client for bus scaling */
- qsee_perf_client = msm_bus_scale_register_client(&qsee_bus_pdata);
- if (!qsee_perf_client)
+ qsee_perf_client = msm_bus_scale_register_client(
+ &qsee_bus_pdata);
+ if (!qsee_perf_client) {
pr_err("Unable to register bus client\n");
- qseecom_bus_clk = clk_get_sys("scm", "bus_clk");
- if (!IS_ERR(qseecom_bus_clk)) {
- ret = clk_set_rate(qseecom_bus_clk, 64000000);
- if (ret) {
+ qseecom_bus_clk = clk_get(class_dev, "qseecom");
+ if (IS_ERR(qseecom_bus_clk)) {
qseecom_bus_clk = NULL;
- pr_err("Unable to set clock rate\n");
+ } else if (qseecom_bus_clk != NULL) {
+ pr_debug("Enabled DFAB clock");
+ clk_set_rate(qseecom_bus_clk, 64000000);
}
- } else {
- qseecom_bus_clk = NULL;
- pr_warn("Unable to get bus clk\n");
}
return 0;
+
err:
device_destroy(driver_class, qseecom_device_no);
class_destroy:
@@ -1475,6 +1484,8 @@
static void __exit qseecom_exit(void)
{
+ clk_put(qseecom_bus_clk);
+
device_destroy(driver_class, qseecom_device_no);
class_destroy(driver_class);
unregister_chrdev_region(qseecom_device_no, 1);
diff --git a/drivers/regulator/pm8xxx-regulator.c b/drivers/regulator/pm8xxx-regulator.c
index fa17449..fd691f0 100644
--- a/drivers/regulator/pm8xxx-regulator.c
+++ b/drivers/regulator/pm8xxx-regulator.c
@@ -3105,7 +3105,7 @@
if (vreg->rdesc.name == NULL) {
pr_err("regulator name missing\n");
return -EINVAL;
- } else if (vreg->type < 0 || vreg->type > PM8XXX_REGULATOR_TYPE_MAX) {
+ } else if (vreg->type < 0 || vreg->type >= PM8XXX_REGULATOR_TYPE_MAX) {
pr_err("%s: regulator type=%d is invalid\n", vreg->rdesc.name,
vreg->type);
return -EINVAL;
diff --git a/drivers/video/msm/Kconfig b/drivers/video/msm/Kconfig
index 032cdfe..a064d11 100644
--- a/drivers/video/msm/Kconfig
+++ b/drivers/video/msm/Kconfig
@@ -183,6 +183,10 @@
select FB_MSM_MIPI_DSI
default n
+config FB_MSM_MIPI_DSI_NT35516
+ bool
+ select FB_MSM_MIPI_DSI
+
config FB_MSM_MIPI_DSI_TC358764_DSI2LVDS
bool
select FB_MSM_MIPI_DSI
@@ -320,6 +324,17 @@
select FB_MSM_MIPI_DSI_NT35510
default n
+config FB_MSM_MIPI_NT35516_VIDEO_QHD_PT
+ bool
+ select FB_MSM_MIPI_DSI_NT35516
+ default n
+
+config FB_MSM_MIPI_NT35516_CMD_QHD_PT
+ bool
+ select FB_MSM_MIPI_DSI_NT35516
+ default n
+
+
config FB_MSM_MIPI_CHIMEI_WXGA
bool "LVDS Chimei WXGA Panel using Toshiba MIPI DSI-to-LVDS bridge."
select FB_MSM_MIPI_DSI_TC358764_DSI2LVDS
@@ -476,6 +491,8 @@
select FB_MSM_MIPI_NT35510_CMD_WVGA_PT
select FB_MSM_MIPI_ORISE_VIDEO_720P_PT
select FB_MSM_MIPI_ORISE_CMD_720P_PT
+ select FB_MSM_MIPI_NT35516_VIDEO_QHD_PT
+ select FB_MSM_MIPI_NT35516_CMD_QHD_PT
select FB_MSM_MIPI_SIMULATOR_VIDEO
select FB_MSM_MIPI_CHIMEI_WXGA
select FB_MSM_MIPI_CHIMEI_WUXGA
@@ -514,6 +531,8 @@
select FB_MSM_MIPI_NOVATEK_CMD_QHD_PT
select FB_MSM_MIPI_NT35510_VIDEO_WVGA_PT
select FB_MSM_MIPI_NT35510_CMD_WVGA_PT
+ select FB_MSM_MIPI_NT35516_VIDEO_QHD_PT
+ select FM_MSM_MIPI_NT35516_CMD_QHD_PT
select FB_MSM_MIPI_SIMULATOR_VIDEO
---help---
Support for LCDC + MIPI panel auto detect
@@ -625,6 +644,14 @@
bool "MIPI NT35510 Command WVGA PT Panel"
select FB_MSM_MIPI_NT35510_CMD_WVGA_PT
+config FB_MSM_MIPI_NT35516_VIDEO_QHD_PT_PANEL
+ bool "MIPI NT35516 Video qHD PT Panel"
+ select FB_MSM_MIPI_NT35516_VIDEO_QHD_PT
+
+config FB_MSM_MIPI_NT35516_CMD_QHD_PT_PANEL
+ bool "MIPI NT35516 Command qHD PT Panel"
+ select FB_MSM_MIPI_NT35516_CMD_QHD_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 eae79a2..aabe490 100644
--- a/drivers/video/msm/Makefile
+++ b/drivers/video/msm/Makefile
@@ -78,6 +78,7 @@
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_NT35510) += mipi_NT35510.o
+obj-$(CONFIG_FB_MSM_MIPI_DSI_NT35516) += mipi_truly_tft540960_1_e.o
obj-$(CONFIG_FB_MSM_MIPI_DSI_SIMULATOR) += mipi_simulator.o
# MIPI Bridge
@@ -120,6 +121,7 @@
obj-y += mipi_orise_video_720p_pt.o mipi_orise_cmd_720p_pt.o
obj-y += mipi_renesas_video_fwvga_pt.o mipi_renesas_cmd_fwvga_pt.o
obj-y += mipi_NT35510_video_wvga_pt.o mipi_NT35510_cmd_wvga_pt.o
+obj-y += mipi_truly_tft540960_1_e_video_qhd_pt.o mipi_truly_tft540960_1_e_cmd_qhd_pt.o
obj-y += mipi_chimei_wxga_pt.o
obj-y += mipi_chimei_wuxga.o
obj-y += mipi_truly_video_wvga_pt.o
@@ -137,6 +139,8 @@
obj-$(CONFIG_FB_MSM_MIPI_TRULY_VIDEO_WVGA_PT) += mipi_truly_video_wvga_pt.o
obj-$(CONFIG_FB_MSM_MIPI_NT35510_CMD_WVGA_PT) += mipi_NT35510_cmd_wvga_pt.o
obj-$(CONFIG_FB_MSM_MIPI_NT35510_VIDEO_WVGA_PT) += mipi_NT35510_video_wvga_pt.o
+obj-$(CONFIG_FB_MSM_MIPI_NT35516_CMD_QHD_PT) += mipi_truly_tft540960_1_e_cmd_qhd_pt.o
+obj-$(CONFIG_FB_MSM_MIPI_NT35516_VIDEO_QHD_PT) += mipi_truly_tft540960_1_e_video_qhd_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
obj-$(CONFIG_FB_MSM_MIPI_CHIMEI_WUXGA) += mipi_chimei_wuxga.o
diff --git a/drivers/video/msm/mdp4_overlay_atv.c b/drivers/video/msm/mdp4_overlay_atv.c
index 0b707d7..35d5769 100644
--- a/drivers/video/msm/mdp4_overlay_atv.c
+++ b/drivers/video/msm/mdp4_overlay_atv.c
@@ -38,16 +38,13 @@
{
uint8 *buf;
int bpp, ptype;
- int yres, remainder;
struct fb_info *fbi;
struct fb_var_screeninfo *var;
struct msm_fb_data_type *mfd;
struct mdp4_overlay_pipe *pipe;
- struct msm_panel_info *panel_info;
int ret;
mfd = (struct msm_fb_data_type *)platform_get_drvdata(pdev);
- panel_info = &mfd->panel_info;
if (!mfd)
return -ENODEV;
@@ -58,28 +55,9 @@
fbi = mfd->fbi;
var = &fbi->var;
- if (panel_info->mode2_yres != 0) {
- yres = panel_info->mode2_yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- } else {
- yres = panel_info->yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- }
-
- if (!remainder)
- remainder = PAGE_SIZE;
-
bpp = fbi->var.bits_per_pixel / 8;
buf = (uint8 *) fbi->fix.smem_start;
- if (fbi->var.yoffset < yres) {
- buf += fbi->var.xoffset * bpp;
- } else if (fbi->var.yoffset >= yres && fbi->var.yoffset < 2 * yres) {
- buf += fbi->var.xoffset * bpp + yres *
- fbi->fix.line_length + PAGE_SIZE - remainder;
- } else {
- buf += fbi->var.xoffset * bpp + 2 * yres *
- fbi->fix.line_length + 2 * (PAGE_SIZE - remainder);
- }
+ buf += calc_fb_offset(mfd, fbi, bpp);
if (atv_pipe == NULL) {
ptype = mdp4_overlay_format2type(mfd->fb_imgType);
@@ -171,36 +149,15 @@
uint8 *buf;
int bpp;
unsigned long flag;
- int yres, remainder;
struct mdp4_overlay_pipe *pipe;
- struct msm_panel_info *panel_info = &mfd->panel_info;
if (!mfd->panel_power_on)
return;
- if (panel_info->mode2_yres != 0) {
- yres = panel_info->mode2_yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- } else {
- yres = panel_info->yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- }
-
- if (!remainder)
- remainder = PAGE_SIZE;
-
/* no need to power on cmd block since it's lcdc mode */
bpp = fbi->var.bits_per_pixel / 8;
buf = (uint8 *) fbi->fix.smem_start;
- if (fbi->var.yoffset < yres) {
- buf += fbi->var.xoffset * bpp;
- } else if (fbi->var.yoffset >= yres && fbi->var.yoffset < 2 * yres) {
- buf += fbi->var.xoffset * bpp + yres *
- fbi->fix.line_length + PAGE_SIZE - remainder;
- } else {
- buf += fbi->var.xoffset * bpp + 2 * yres *
- fbi->fix.line_length + 2 * (PAGE_SIZE - remainder);
- }
+ buf += calc_fb_offset(mfd, fbi, bpp);
mutex_lock(&mfd->dma->ov_mutex);
diff --git a/drivers/video/msm/mdp4_overlay_dsi_video.c b/drivers/video/msm/mdp4_overlay_dsi_video.c
index a3be2af..53b541e 100644
--- a/drivers/video/msm/mdp4_overlay_dsi_video.c
+++ b/drivers/video/msm/mdp4_overlay_dsi_video.c
@@ -96,16 +96,13 @@
int hsync_end_x;
uint8 *buf;
int bpp, ptype;
- int yres, remainder;
struct fb_info *fbi;
struct fb_var_screeninfo *var;
struct msm_fb_data_type *mfd;
struct mdp4_overlay_pipe *pipe;
- struct msm_panel_info *panel_info;
int ret;
mfd = (struct msm_fb_data_type *)platform_get_drvdata(pdev);
- panel_info = &mfd->panel_info;
if (!mfd)
return -ENODEV;
@@ -118,28 +115,9 @@
fbi = mfd->fbi;
var = &fbi->var;
- if (panel_info->mode2_yres != 0) {
- yres = panel_info->mode2_yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- } else {
- yres = panel_info->yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- }
-
- if (!remainder)
- remainder = PAGE_SIZE;
-
bpp = fbi->var.bits_per_pixel / 8;
buf = (uint8 *) fbi->fix.smem_start;
- if (fbi->var.yoffset < yres) {
- buf += fbi->var.xoffset * bpp;
- } else if (fbi->var.yoffset >= yres && fbi->var.yoffset < 2 * yres) {
- buf += fbi->var.xoffset * bpp + yres *
- fbi->fix.line_length + PAGE_SIZE - remainder;
- } else {
- buf += fbi->var.xoffset * bpp + 2 * yres *
- fbi->fix.line_length + 2 * (PAGE_SIZE - remainder);
- }
+ buf += calc_fb_offset(mfd, fbi, bpp);
if (dsi_pipe == NULL) {
ptype = mdp4_overlay_format2type(mfd->fb_imgType);
@@ -316,9 +294,7 @@
{
struct fb_info *fbi;
struct mdp4_overlay_pipe *pipe;
- struct msm_panel_info *panel_info = &mfd->panel_info;
int bpp;
- int yres, remainder;
uint8 *buf = NULL;
if (dsi_pipe == NULL)
@@ -337,28 +313,9 @@
fbi = mfd->fbi;
- if (panel_info->mode2_yres != 0) {
- yres = panel_info->mode2_yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- } else {
- yres = panel_info->yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- }
-
- if (!remainder)
- remainder = PAGE_SIZE;
-
bpp = fbi->var.bits_per_pixel / 8;
buf = (uint8 *) fbi->fix.smem_start;
- if (fbi->var.yoffset < yres) {
- buf += fbi->var.xoffset * bpp;
- } else if (fbi->var.yoffset >= yres && fbi->var.yoffset < 2 * yres) {
- buf += fbi->var.xoffset * bpp + yres *
- fbi->fix.line_length + PAGE_SIZE - remainder;
- } else {
- buf += fbi->var.xoffset * bpp + 2 * yres *
- fbi->fix.line_length + 2 * (PAGE_SIZE - remainder);
- }
+ buf += calc_fb_offset(mfd, fbi, bpp);
if (pipe->is_3d) {
pipe->src_height = pipe->src_height_3d;
@@ -689,36 +646,15 @@
struct fb_info *fbi = mfd->fbi;
uint8 *buf;
int bpp;
- int yres, remainder;
struct mdp4_overlay_pipe *pipe;
- struct msm_panel_info *panel_info = &mfd->panel_info;
if (!mfd->panel_power_on)
return;
- if (panel_info->mode2_yres != 0) {
- yres = panel_info->mode2_yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- } else {
- yres = panel_info->yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- }
-
- if (!remainder)
- remainder = PAGE_SIZE;
-
/* no need to power on cmd block since it's dsi video mode */
bpp = fbi->var.bits_per_pixel / 8;
buf = (uint8 *) fbi->fix.smem_start;
- if (fbi->var.yoffset < yres) {
- buf += fbi->var.xoffset * bpp;
- } else if (fbi->var.yoffset >= yres && fbi->var.yoffset < 2 * yres) {
- buf += fbi->var.xoffset * bpp + yres *
- fbi->fix.line_length + PAGE_SIZE - remainder;
- } else {
- buf += fbi->var.xoffset * bpp + 2 * yres *
- fbi->fix.line_length + 2 * (PAGE_SIZE - remainder);
- }
+ buf += calc_fb_offset(mfd, fbi, bpp);
mutex_lock(&mfd->dma->ov_mutex);
diff --git a/drivers/video/msm/mdp4_overlay_lcdc.c b/drivers/video/msm/mdp4_overlay_lcdc.c
index ae498fc..1755bcc 100644
--- a/drivers/video/msm/mdp4_overlay_lcdc.c
+++ b/drivers/video/msm/mdp4_overlay_lcdc.c
@@ -84,11 +84,8 @@
struct msm_fb_data_type *mfd;
struct mdp4_overlay_pipe *pipe;
int ret;
- int yres, remainder;
- struct msm_panel_info *panel_info;
mfd = (struct msm_fb_data_type *)platform_get_drvdata(pdev);
- panel_info = &mfd->panel_info;
if (!mfd)
return -ENODEV;
@@ -101,17 +98,6 @@
fbi = mfd->fbi;
var = &fbi->var;
- if (panel_info->mode2_yres != 0) {
- yres = panel_info->mode2_yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- } else {
- yres = panel_info->yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- }
-
- if (!remainder)
- remainder = PAGE_SIZE;
-
/* MDP cmd block enable */
mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
if (is_mdp4_hw_reset()) {
@@ -121,15 +107,7 @@
bpp = fbi->var.bits_per_pixel / 8;
buf = (uint8 *) fbi->fix.smem_start;
- if (fbi->var.yoffset < yres) {
- buf += fbi->var.xoffset * bpp;
- } else if (fbi->var.yoffset >= yres && fbi->var.yoffset < 2 * yres) {
- buf += fbi->var.xoffset * bpp + yres *
- fbi->fix.line_length + PAGE_SIZE - remainder;
- } else {
- buf += fbi->var.xoffset * bpp + 2 * yres *
- fbi->fix.line_length + 2 * (PAGE_SIZE - remainder);
- }
+ buf += calc_fb_offset(mfd, fbi, bpp);
if (lcdc_pipe == NULL) {
ptype = mdp4_overlay_format2type(mfd->fb_imgType);
@@ -573,36 +551,15 @@
struct fb_info *fbi = mfd->fbi;
uint8 *buf;
int bpp;
- int yres, remainder;
struct mdp4_overlay_pipe *pipe;
- struct msm_panel_info *panel_info = &mfd->panel_info;
if (!mfd->panel_power_on)
return;
- if (panel_info->mode2_yres != 0) {
- yres = panel_info->mode2_yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- } else {
- yres = panel_info->yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- }
-
- if (!remainder)
- remainder = PAGE_SIZE;
-
/* no need to power on cmd block since it's lcdc mode */
bpp = fbi->var.bits_per_pixel / 8;
buf = (uint8 *) fbi->fix.smem_start;
- if (fbi->var.yoffset < yres) {
- buf += fbi->var.xoffset * bpp;
- } else if (fbi->var.yoffset >= yres && fbi->var.yoffset < 2 * yres) {
- buf += fbi->var.xoffset * bpp + yres *
- fbi->fix.line_length + PAGE_SIZE - remainder;
- } else {
- buf += fbi->var.xoffset * bpp + 2 * yres *
- fbi->fix.line_length + 2 * (PAGE_SIZE - remainder);
- }
+ buf += calc_fb_offset(mfd, fbi, bpp);
mutex_lock(&mfd->dma->ov_mutex);
diff --git a/drivers/video/msm/mdp_dma.c b/drivers/video/msm/mdp_dma.c
index e8b288f..ab5abf5 100644
--- a/drivers/video/msm/mdp_dma.c
+++ b/drivers/video/msm/mdp_dma.c
@@ -523,36 +523,15 @@
{
struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par;
struct fb_info *fbi = mfd->fbi;
- struct msm_panel_info *panel_info = &mfd->panel_info;
MDPIBUF *iBuf;
int bpp = info->var.bits_per_pixel / 8;
- int yres, remainder;
-
- if (panel_info->mode2_yres != 0) {
- yres = panel_info->mode2_yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- } else {
- yres = panel_info->yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- }
-
- if (!remainder)
- remainder = PAGE_SIZE;
down(&mfd->sem);
iBuf = &mfd->ibuf;
iBuf->buf = (uint8 *) info->fix.smem_start;
- if (fbi->var.yoffset < yres) {
- iBuf->buf += fbi->var.xoffset * bpp;
- } else if (fbi->var.yoffset >= yres && fbi->var.yoffset < 2 * yres) {
- iBuf->buf += fbi->var.xoffset * bpp + yres *
- fbi->fix.line_length + PAGE_SIZE - remainder;
- } else {
- iBuf->buf += fbi->var.xoffset * bpp + 2 * yres *
- fbi->fix.line_length + 2 * (PAGE_SIZE - remainder);
- }
+ iBuf->buf += calc_fb_offset(mfd, fbi, bpp);
iBuf->ibuf_width = info->var.xres_virtual;
iBuf->bpp = bpp;
diff --git a/drivers/video/msm/mdp_dma_dsi_video.c b/drivers/video/msm/mdp_dma_dsi_video.c
index 3c89d8b..e1d7acc 100644
--- a/drivers/video/msm/mdp_dma_dsi_video.c
+++ b/drivers/video/msm/mdp_dma_dsi_video.c
@@ -67,18 +67,15 @@
int hsync_end_x;
uint8 *buf;
uint32 dma2_cfg_reg;
- int yres, remainder;
int bpp;
struct fb_info *fbi;
struct fb_var_screeninfo *var;
struct msm_fb_data_type *mfd;
- struct msm_panel_info *panel_info;
int ret;
uint32 mask, curr;
mfd = (struct msm_fb_data_type *)platform_get_drvdata(pdev);
- panel_info = &mfd->panel_info;
if (!mfd)
return -ENODEV;
@@ -89,29 +86,10 @@
fbi = mfd->fbi;
var = &fbi->var;
- if (panel_info->mode2_yres != 0) {
- yres = panel_info->mode2_yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- } else {
- yres = panel_info->yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- }
-
- if (!remainder)
- remainder = PAGE_SIZE;
-
bpp = fbi->var.bits_per_pixel / 8;
buf = (uint8 *) fbi->fix.smem_start;
- if (fbi->var.yoffset < yres) {
- buf += fbi->var.xoffset * bpp;
- } else if (fbi->var.yoffset >= yres && fbi->var.yoffset < 2 * yres) {
- buf += fbi->var.xoffset * bpp + yres *
- fbi->fix.line_length + PAGE_SIZE - remainder;
- } else {
- buf += fbi->var.xoffset * bpp + 2 * yres *
- fbi->fix.line_length + 2 * (PAGE_SIZE - remainder);
- }
+ buf += calc_fb_offset(mfd, fbi, bpp);
dma2_cfg_reg = DMA_PACK_ALIGN_LSB | DMA_OUT_SEL_DSI_VIDEO;
@@ -265,38 +243,18 @@
uint8 *buf;
int bpp;
unsigned long flag;
- int yres, remainder;
- struct msm_panel_info *panel_info = &mfd->panel_info;
int irq_block = MDP_DMA2_TERM;
if (!mfd->panel_power_on)
return;
- if (panel_info->mode2_yres != 0) {
- yres = panel_info->mode2_yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- } else {
- yres = panel_info->yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- }
-
- if (!remainder)
- remainder = PAGE_SIZE;
-
down(&mfd->dma->mutex);
bpp = fbi->var.bits_per_pixel / 8;
buf = (uint8 *) fbi->fix.smem_start;
- if (fbi->var.yoffset < yres) {
- buf += fbi->var.xoffset * bpp;
- } else if (fbi->var.yoffset >= yres && fbi->var.yoffset < 2 * yres) {
- buf += fbi->var.xoffset * bpp + yres *
- fbi->fix.line_length + PAGE_SIZE - remainder;
- } else {
- buf += fbi->var.xoffset * bpp + 2 * yres *
- fbi->fix.line_length + 2 * (PAGE_SIZE - remainder);
- }
+ buf += calc_fb_offset(mfd, fbi, bpp);
+
/* no need to power on cmd block since it's dsi mode */
/* starting address */
MDP_OUTP(MDP_BASE + DMA_P_BASE + 0x8, (uint32) buf);
diff --git a/drivers/video/msm/mdp_dma_lcdc.c b/drivers/video/msm/mdp_dma_lcdc.c
index 5dada35..7350d91 100644
--- a/drivers/video/msm/mdp_dma_lcdc.c
+++ b/drivers/video/msm/mdp_dma_lcdc.c
@@ -89,15 +89,12 @@
struct fb_info *fbi;
struct fb_var_screeninfo *var;
struct msm_fb_data_type *mfd;
- struct msm_panel_info *panel_info;
uint32 dma_base;
uint32 timer_base = LCDC_BASE;
uint32 block = MDP_DMA2_BLOCK;
int ret;
- int yres, remainder;
mfd = (struct msm_fb_data_type *)platform_get_drvdata(pdev);
- panel_info = &mfd->panel_info;
if (!mfd)
return -ENODEV;
@@ -108,32 +105,13 @@
fbi = mfd->fbi;
var = &fbi->var;
- if (panel_info->mode2_yres != 0) {
- yres = panel_info->mode2_yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- } else {
- yres = panel_info->yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- }
-
- if (!remainder)
- remainder = PAGE_SIZE;
-
/* MDP cmd block enable */
mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
bpp = fbi->var.bits_per_pixel / 8;
buf = (uint8 *) fbi->fix.smem_start;
- if (fbi->var.yoffset < yres) {
- buf += fbi->var.xoffset * bpp;
- } else if (fbi->var.yoffset >= yres && fbi->var.yoffset < 2 * yres) {
- buf += fbi->var.xoffset * bpp + yres *
- fbi->fix.line_length + PAGE_SIZE - remainder;
- } else {
- buf += fbi->var.xoffset * bpp + 2 * yres *
- fbi->fix.line_length + 2 * (PAGE_SIZE - remainder);
- }
+ buf += calc_fb_offset(mfd, fbi, bpp);
dma2_cfg_reg = DMA_PACK_ALIGN_LSB | DMA_OUT_SEL_LCDC;
@@ -342,28 +320,15 @@
void mdp_lcdc_update(struct msm_fb_data_type *mfd)
{
struct fb_info *fbi = mfd->fbi;
- struct msm_panel_info *panel_info = &mfd->panel_info;
uint8 *buf;
int bpp;
unsigned long flag;
uint32 dma_base;
- int yres, remainder;
int irq_block = MDP_DMA2_TERM;
#ifdef CONFIG_FB_MSM_MDP40
int intr = INTR_DMA_P_DONE;
#endif
- if (panel_info->mode2_yres != 0) {
- yres = panel_info->mode2_yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- } else {
- yres = panel_info->yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- }
-
- if (!remainder)
- remainder = PAGE_SIZE;
-
if (!mfd->panel_power_on)
return;
@@ -372,15 +337,7 @@
bpp = fbi->var.bits_per_pixel / 8;
buf = (uint8 *) fbi->fix.smem_start;
- if (fbi->var.yoffset < yres) {
- buf += fbi->var.xoffset * bpp;
- } else if (fbi->var.yoffset >= yres && fbi->var.yoffset < 2 * yres) {
- buf += fbi->var.xoffset * bpp + yres *
- fbi->fix.line_length + PAGE_SIZE - remainder;
- } else {
- buf += fbi->var.xoffset * bpp + 2 * yres *
- fbi->fix.line_length + 2 * (PAGE_SIZE - remainder);
- }
+ buf += calc_fb_offset(mfd, fbi, bpp);
dma_base = DMA_P_BASE;
diff --git a/drivers/video/msm/mdp_dma_tv.c b/drivers/video/msm/mdp_dma_tv.c
index 1305e03..b578ba2 100644
--- a/drivers/video/msm/mdp_dma_tv.c
+++ b/drivers/video/msm/mdp_dma_tv.c
@@ -39,15 +39,12 @@
int mdp_dma3_on(struct platform_device *pdev)
{
struct msm_fb_data_type *mfd;
- struct msm_panel_info *panel_info;
struct fb_info *fbi;
uint8 *buf;
int bpp;
int ret = 0;
- int yres, remainder;
mfd = (struct msm_fb_data_type *)platform_get_drvdata(pdev);
- panel_info = &mfd->panel_info;
if (!mfd)
return -ENODEV;
@@ -57,32 +54,13 @@
fbi = mfd->fbi;
- if (panel_info->mode2_yres != 0) {
- yres = panel_info->mode2_yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- } else {
- yres = panel_info->yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- }
-
- if (!remainder)
- remainder = PAGE_SIZE;
-
/* MDP cmd block enable */
mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
bpp = fbi->var.bits_per_pixel / 8;
buf = (uint8 *) fbi->fix.smem_start;
- if (fbi->var.yoffset < yres) {
- buf += fbi->var.xoffset * bpp;
- } else if (fbi->var.yoffset >= yres && fbi->var.yoffset < 2 * yres) {
- buf += fbi->var.xoffset * bpp + yres *
- fbi->fix.line_length + PAGE_SIZE - remainder;
- } else {
- buf += fbi->var.xoffset * bpp + 2 * yres *
- fbi->fix.line_length + 2 * (PAGE_SIZE - remainder);
- }
+ buf += calc_fb_offset(mfd, fbi, bpp);
/* starting address[31..8] of Video frame buffer is CS0 */
MDP_OUTP(MDP_BASE + 0xC0008, (uint32) buf >> 3);
@@ -135,36 +113,15 @@
uint8 *buf;
int bpp;
unsigned long flag;
- int yres, remainder;
- struct msm_panel_info *panel_info = &mfd->panel_info;
if (!mfd->panel_power_on)
return;
- if (panel_info->mode2_yres != 0) {
- yres = panel_info->mode2_yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- } else {
- yres = panel_info->yres;
- remainder = (fbi->fix.line_length*yres)%PAGE_SIZE;
- }
-
- if (!remainder)
- remainder = PAGE_SIZE;
-
/* no need to power on cmd block since dma3 is running */
bpp = fbi->var.bits_per_pixel / 8;
buf = (uint8 *) fbi->fix.smem_start;
- if (fbi->var.yoffset < yres) {
- buf += fbi->var.xoffset * bpp;
- } else if (fbi->var.yoffset >= yres && fbi->var.yoffset < 2 * yres) {
- buf += fbi->var.xoffset * bpp + yres *
- fbi->fix.line_length + PAGE_SIZE - remainder;
- } else {
- buf += fbi->var.xoffset * bpp + 2 * yres *
- fbi->fix.line_length + 2 * (PAGE_SIZE - remainder);
- }
+ buf += calc_fb_offset(mfd, fbi, bpp);
MDP_OUTP(MDP_BASE + 0xC0008, (uint32) buf >> 3);
diff --git a/drivers/video/msm/mipi_truly_tft540960_1_e.c b/drivers/video/msm/mipi_truly_tft540960_1_e.c
new file mode 100644
index 0000000..937a598
--- /dev/null
+++ b/drivers/video/msm/mipi_truly_tft540960_1_e.c
@@ -0,0 +1,806 @@
+/* Copyright (c) 2012, 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_tft540960_1_e.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 MIPI_SETTING_DELAY 10
+#define TRULY_SLEEP_OFF_DELAY 150
+#define TRULY_DISPLAY_ON_DELAY 150
+
+/* common setting */
+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 char write_ram[2] = {0x2c, 0x00}; /* write ram */
+
+static struct dsi_cmd_desc truly_display_off_cmds[] = {
+ {DTYPE_DCS_WRITE, 1, 0, 0, 150, sizeof(display_off), display_off},
+ {DTYPE_DCS_WRITE, 1, 0, 0, 150, sizeof(enter_sleep), enter_sleep}
+};
+
+
+/* TFT540960_1_E CMD mode */
+static char cmd0[5] = {
+ 0xFF, 0xAA, 0x55, 0x25,
+ 0x01,
+};
+
+static char cmd2[5] = {
+ 0xF3, 0x02, 0x03, 0x07,
+ 0x45,
+};
+
+static char cmd3[6] = {
+ 0xF0, 0x55, 0xAA, 0x52,
+ 0x08, 0x00,
+};
+
+static char cmd4[2] = {
+ 0xB1, 0xeC,
+};
+
+/* add 0X BD command */
+static char cmd26_2[6] = {
+ 0xBD, 0x01, 0x60, 0x10, 0x38, 0x01 /* 55 HZ */
+};
+
+static char cmd5[5] = {
+ 0xB8, 0x01, 0x02, 0x02,
+ 0x02,
+};
+
+static char cmd6[4] = {
+ 0xBC, 0x05, 0x05, 0x05,
+};
+
+static char cmd7[2] = {
+ 0x4C, 0x11,
+};
+
+static char cmd8[6] = {
+ 0xF0, 0x55, 0xAA, 0x52,
+ 0x08, 0x01,
+};
+
+static char cmd9[4] = {
+ 0xB0, 0x05, 0x05, 0x05,
+};
+
+static char cmd10[4] = {
+ 0xB6, 0x44, 0x44, 0x44,
+};
+static char cmd11[4] = {
+ 0xB1, 0x05, 0x05, 0x05,
+};
+
+static char cmd12[4] = {
+ 0xB7, 0x34, 0x34, 0x34,
+};
+
+static char cmd13[4] = {
+ 0xB3, 0x10, 0x10, 0x10,
+};
+
+static char cmd14[4] = {
+ 0xB9, 0x34, 0x34, 0x34,
+};
+
+static char cmd15[4] = {
+ 0xB4, 0x0A, 0x0A, 0x0A,
+};
+
+static char cmd16[4] = {
+ 0xBA, 0x14, 0x14, 0x14,
+};
+static char cmd17[4] = {
+ 0xBC, 0x00, 0xA0, 0x00,
+};
+
+static char cmd18[4] = {
+ 0xBD, 0x00, 0xA0, 0x00,
+};
+
+static char cmd19[2] = {
+ 0xBE, 0x45,
+};
+
+static char cmd20[17] = {
+ 0xD1, 0x00, 0x32, 0x00,
+ 0x41, 0x00, 0x54, 0x00,
+ 0x67, 0x00, 0x7A, 0x00,
+ 0x98, 0x00, 0xB0, 0x00,
+ 0xDB,
+};
+
+static char cmd21[17] = {
+ 0xD2, 0x01, 0x01, 0x01,
+ 0x3F, 0x01, 0x70, 0x01,
+ 0xB4, 0x01, 0xEC, 0x01,
+ 0xED, 0x02, 0x1E, 0x02,
+ 0x51,
+};
+
+static char cmd22[17] = {
+ 0xD3, 0x02, 0x6C, 0x02,
+ 0x8D, 0x02, 0xA5, 0x02,
+ 0xC9, 0x02, 0xEA, 0x03,
+ 0x19, 0x03, 0x45, 0x03,
+ 0x7A,
+};
+
+static char cmd23[5] = {
+ 0xD4, 0x03, 0xB0, 0x03,
+ 0xF4,
+};
+
+static char cmd24[17] = {
+ 0xD5, 0x00, 0x32, 0x00,
+ 0x41, 0x00, 0x54, 0x00,
+ 0x67, 0x00, 0x7A, 0x00,
+ 0x98, 0x00, 0xB0, 0x00,
+ 0xDB,
+};
+static char cmd25[17] = {
+ 0xD6, 0x01, 0x01, 0x01,
+ 0x3F, 0x01, 0x70, 0x01,
+ 0xB4, 0x01, 0xEC, 0x01,
+ 0xED, 0x02, 0x1E, 0x02,
+ 0x51,
+};
+
+static char cmd26[17] = {
+ 0xD7, 0x02, 0x6C, 0x02,
+ 0x8D, 0x02, 0xA5, 0x02,
+ 0xC9, 0x02, 0xEA, 0x03,
+ 0x19, 0x03, 0x45, 0x03,
+ 0x7A,
+};
+static char cmd27[5] = {
+ 0xD8, 0x03, 0xB0, 0x03,
+ 0xF4,
+};
+
+
+static char cmd28[17] = {
+ 0xD9, 0x00, 0x32, 0x00,
+ 0x41, 0x00, 0x54, 0x00,
+ 0x67, 0x00, 0x7A, 0x00,
+ 0x98, 0x00, 0xB0, 0x00,
+ 0xDB,
+};
+
+static char cmd29[17] = {
+ 0xDD, 0x01, 0x01, 0x01,
+ 0x3F, 0x01, 0x70, 0x01,
+ 0xB4, 0x01, 0xEC, 0x01,
+ 0xED, 0x02, 0x1E, 0x02,
+ 0x51,
+};
+static char cmd30[17] = {
+ 0xDE, 0x02, 0x6C, 0x02,
+ 0x8D, 0x02, 0xA5, 0x02,
+ 0xC9, 0x02, 0xEA, 0x03,
+ 0x19, 0x03, 0x45, 0x03,
+ 0x7A,
+};
+
+static char cmd31[5] = {
+ 0xDF, 0x03, 0xB0, 0x03,
+ 0xF4,
+};
+
+static char cmd32[17] = {
+ 0xE0, 0x00, 0x32, 0x00,
+ 0x41, 0x00, 0x54, 0x00,
+ 0x67, 0x00, 0x7A, 0x00,
+ 0x98, 0x00, 0xB0, 0x00,
+ 0xDB,
+};
+
+static char cmd33[17] = {
+ 0xE1, 0x01, 0x01, 0x01,
+ 0x3F, 0x01, 0x70, 0x01,
+ 0xB4, 0x01, 0xEC, 0x01,
+ 0xED, 0x02, 0x1E, 0x02,
+ 0x51,
+};
+
+static char cmd34[17] = {
+ 0xE2, 0x02, 0x6C, 0x02,
+ 0x8D, 0x02, 0xA5, 0x02,
+ 0xC9, 0x02, 0xEA, 0x03,
+ 0x19, 0x03, 0x45, 0x03,
+ 0x7A,
+};
+
+static char cmd35[5] = {
+ 0xE3, 0x03, 0xB0, 0x03,
+ 0xF4,
+};
+
+static char cmd36[17] = {
+ 0xE4, 0x00, 0x32, 0x00,
+ 0x41, 0x00, 0x54, 0x00,
+ 0x67, 0x00, 0x7A, 0x00,
+ 0x98, 0x00, 0xB0, 0x00,
+ 0xDB,
+};
+static char cmd37[17] = {
+ 0xE5, 0x01, 0x01, 0x01,
+ 0x3F, 0x01, 0x70, 0x01,
+ 0xB4, 0x01, 0xEC, 0x01,
+ 0xED, 0x02, 0x1E, 0x02,
+ 0x51,
+};
+
+static char cmd38[17] = {
+ 0xE6, 0x02, 0x6C, 0x02,
+ 0x8D, 0x02, 0xA5, 0x02,
+ 0xC9, 0x02, 0xEA, 0x03,
+ 0x19, 0x03, 0x45, 0x03,
+ 0x7A,
+};
+
+static char cmd39[5] = {
+ 0xE7, 0x03, 0xB0, 0x03,
+ 0xF4,
+};
+
+static char cmd40[17] = {
+ 0xE8, 0x00, 0x32, 0x00,
+ 0x41, 0x00, 0x54, 0x00,
+ 0x67, 0x00, 0x7A, 0x00,
+ 0x98, 0x00, 0xB0, 0x00,
+ 0xDB,
+};
+
+static char cmd41[17] = {
+ 0xE9, 0x01, 0x01, 0x01,
+ 0x3F, 0x01, 0x70, 0x01,
+ 0xB4, 0x01, 0xEC, 0x01,
+ 0xED, 0x02, 0x1E, 0x02,
+ 0x51,
+};
+
+static char cmd42[17] = {
+ 0xEA, 0x02, 0x6C, 0x02,
+ 0x8D, 0x02, 0xA5, 0x02,
+ 0xC9, 0x02, 0xEA, 0x03,
+ 0x19, 0x03, 0x45, 0x03,
+ 0x7A,
+};
+
+static char cmd43[5] = {
+ 0xEB, 0x03, 0xB0, 0x03,
+ 0xF4,
+};
+
+static char cmd44[2] = {
+ 0x3A, 0x07,
+};
+
+static char cmd45[2] = {
+ 0x35, 0x00,
+};
+
+
+static struct dsi_cmd_desc truly_cmd_display_on_cmds[] = {
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd0), cmd0},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd2), cmd2},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd3), cmd3},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd4), cmd4},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd26_2), cmd26_2},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd5), cmd5},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd6), cmd6},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd7), cmd7},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd8), cmd8},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd9), cmd9},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd10), cmd10},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd11), cmd11},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd12), cmd12},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd13), cmd13},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd14), cmd14},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd15), cmd15},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd16), cmd16},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd17), cmd17},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd18), cmd18},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd19), cmd19},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd20), cmd20},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd21), cmd21},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd22), cmd22},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd23), cmd23},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd24), cmd24},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd25), cmd25},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd26), cmd26},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd27), cmd27},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd28), cmd28},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd29), cmd29},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd30), cmd30},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd31), cmd31},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd32), cmd32},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd33), cmd33},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd34), cmd34},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd35), cmd35},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd36), cmd36},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd37), cmd37},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd38), cmd38},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd39), cmd39},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd40), cmd40},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd41), cmd41},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd42), cmd42},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd43), cmd43},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd44), cmd44},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(cmd45), cmd45},
+ {DTYPE_DCS_WRITE, 1, 0, 0, TRULY_SLEEP_OFF_DELAY, sizeof(exit_sleep),
+ exit_sleep},
+ {DTYPE_DCS_WRITE, 1, 0, 0, TRULY_CMD_DELAY, sizeof(display_on),
+ display_on},
+ {DTYPE_DCS_WRITE, 1, 0, 0, TRULY_CMD_DELAY, sizeof(write_ram),
+ write_ram},
+
+};
+
+/* TFT540960_1_E VIDEO mode */
+static char video0[5] = {
+ 0xFF, 0xAA, 0x55, 0x25,
+ 0x01,
+};
+
+static char video2[5] = {
+ 0xF3, 0x02, 0x03, 0x07,
+ 0x15,
+};
+
+static char video3[6] = {
+ 0xF0, 0x55, 0xAA, 0x52,
+ 0x08, 0x00,
+};
+
+static char video4[2] = {
+ 0xB1, 0xFC,
+};
+
+static char video5[5] = {
+ 0xB8, 0x01, 0x02, 0x02,
+ 0x02,
+};
+
+static char video6[4] = {
+ 0xBC, 0x05, 0x05, 0x05,
+};
+
+static char video7[2] = {
+ 0x4C, 0x11,
+};
+
+static char video8[6] = {
+ 0xF0, 0x55, 0xAA, 0x52,
+ 0x08, 0x01,
+};
+
+static char video9[4] = {
+ 0xB0, 0x05, 0x05, 0x05,
+};
+
+static char video10[4] = {
+ 0xB6, 0x44, 0x44, 0x44,
+};
+
+static char video11[4] = {
+ 0xB1, 0x05, 0x05, 0x05,
+};
+
+static char video12[4] = {
+ 0xB7, 0x34, 0x34, 0x34,
+};
+
+static char video13[4] = {
+ 0xB3, 0x10, 0x10, 0x10,
+};
+
+static char video14[4] = {
+ 0xB9, 0x34, 0x34, 0x34,
+};
+
+static char video15[4] = {
+ 0xB4, 0x0A, 0x0A, 0x0A,
+};
+
+static char video16[4] = {
+ 0xBA, 0x14, 0x14, 0x14,
+};
+
+static char video17[4] = {
+ 0xBC, 0x00, 0xA0, 0x00,
+};
+
+static char video18[4] = {
+ 0xBD, 0x00, 0xA0, 0x00,
+};
+
+static char video19[2] = {
+ 0xBE, 0x45,
+};
+
+static char video20[17] = {
+ 0xD1, 0x00, 0x32, 0x00,
+ 0x41, 0x00, 0x54, 0x00,
+ 0x67, 0x00, 0x7A, 0x00,
+ 0x98, 0x00, 0xB0, 0x00,
+ 0xDB,
+};
+
+static char video21[17] = {
+ 0xD2, 0x01, 0x01, 0x01,
+ 0x3F, 0x01, 0x70, 0x01,
+ 0xB4, 0x01, 0xEC, 0x01,
+ 0xED, 0x02, 0x1E, 0x02,
+ 0x51,
+};
+
+static char video22[17] = {
+ 0xD3, 0x02, 0x6C, 0x02,
+ 0x8D, 0x02, 0xA5, 0x02,
+ 0xC9, 0x02, 0xEA, 0x03,
+ 0x19, 0x03, 0x45, 0x03,
+ 0x7A,
+};
+
+static char video23[5] = {
+ 0xD4, 0x03, 0xB0, 0x03,
+ 0xF4,
+};
+
+static char video24[17] = {
+ 0xD5, 0x00, 0x32, 0x00,
+ 0x41, 0x00, 0x54, 0x00,
+ 0x67, 0x00, 0x7A, 0x00,
+ 0x98, 0x00, 0xB0, 0x00,
+ 0xDB,
+};
+
+static char video25[17] = {
+ 0xD6, 0x01, 0x01, 0x01,
+ 0x3F, 0x01, 0x70, 0x01,
+ 0xB4, 0x01, 0xEC, 0x01,
+ 0xED, 0x02, 0x1E, 0x02,
+ 0x51,
+};
+
+static char video26[17] = {
+ 0xD7, 0x02, 0x6C, 0x02,
+ 0x8D, 0x02, 0xA5, 0x02,
+ 0xC9, 0x02, 0xEA, 0x03,
+ 0x19, 0x03, 0x45, 0x03,
+ 0x7A,
+};
+
+static char video27[5] = {
+ 0xD8, 0x03, 0xB0, 0x03,
+ 0xF4,
+};
+
+static char video28[17] = {
+ 0xD9, 0x00, 0x32, 0x00,
+ 0x41, 0x00, 0x54, 0x00,
+ 0x67, 0x00, 0x7A, 0x00,
+ 0x98, 0x00, 0xB0, 0x00,
+ 0xDB,
+};
+
+static char video29[17] = {
+ 0xDD, 0x01, 0x01, 0x01,
+ 0x3F, 0x01, 0x70, 0x01,
+ 0xB4, 0x01, 0xEC, 0x01,
+ 0xED, 0x02, 0x1E, 0x02,
+ 0x51,
+};
+
+static char video30[17] = {
+ 0xDE, 0x02, 0x6C, 0x02,
+ 0x8D, 0x02, 0xA5, 0x02,
+ 0xC9, 0x02, 0xEA, 0x03,
+ 0x19, 0x03, 0x45, 0x03,
+ 0x7A,
+};
+
+static char video31[5] = {
+ 0xDF, 0x03, 0xB0, 0x03,
+ 0xF4,
+};
+
+static char video32[17] = {
+ 0xE0, 0x00, 0x32, 0x00,
+ 0x41, 0x00, 0x54, 0x00,
+ 0x67, 0x00, 0x7A, 0x00,
+ 0x98, 0x00, 0xB0, 0x00,
+ 0xDB,
+};
+
+static char video33[17] = {
+ 0xE1, 0x01, 0x01, 0x01,
+ 0x3F, 0x01, 0x70, 0x01,
+ 0xB4, 0x01, 0xEC, 0x01,
+ 0xED, 0x02, 0x1E, 0x02,
+ 0x51,
+};
+
+static char video34[17] = {
+ 0xE2, 0x02, 0x6C, 0x02,
+ 0x8D, 0x02, 0xA5, 0x02,
+ 0xC9, 0x02, 0xEA, 0x03,
+ 0x19, 0x03, 0x45, 0x03,
+ 0x7A,
+};
+
+static char video35[5] = {
+ 0xE3, 0x03, 0xB0, 0x03,
+ 0xF4,
+};
+
+static char video36[17] = {
+ 0xE4, 0x00, 0x32, 0x00,
+ 0x41, 0x00, 0x54, 0x00,
+ 0x67, 0x00, 0x7A, 0x00,
+ 0x98, 0x00, 0xB0, 0x00,
+ 0xDB,
+};
+
+static char video37[17] = {
+ 0xE5, 0x01, 0x01, 0x01,
+ 0x3F, 0x01, 0x70, 0x01,
+ 0xB4, 0x01, 0xEC, 0x01,
+ 0xED, 0x02, 0x1E, 0x02,
+ 0x51,
+};
+
+static char video38[17] = {
+ 0xE6, 0x02, 0x6C, 0x02,
+ 0x8D, 0x02, 0xA5, 0x02,
+ 0xC9, 0x02, 0xEA, 0x03,
+ 0x19, 0x03, 0x45, 0x03,
+ 0x7A,
+};
+
+static char video39[5] = {
+ 0xE7, 0x03, 0xB0, 0x03,
+ 0xF4,
+};
+
+static char video40[17] = {
+ 0xE8, 0x00, 0x32, 0x00,
+ 0x41, 0x00, 0x54, 0x00,
+ 0x67, 0x00, 0x7A, 0x00,
+ 0x98, 0x00, 0xB0, 0x00,
+ 0xDB,
+};
+
+static char video41[17] = {
+ 0xE9, 0x01, 0x01, 0x01,
+ 0x3F, 0x01, 0x70, 0x01,
+ 0xB4, 0x01, 0xEC, 0x01,
+ 0xED, 0x02, 0x1E, 0x02,
+ 0x51,
+};
+
+static char video42[17] = {
+ 0xEA, 0x02, 0x6C, 0x02,
+ 0x8D, 0x02, 0xA5, 0x02,
+ 0xC9, 0x02, 0xEA, 0x03,
+ 0x19, 0x03, 0x45, 0x03,
+ 0x7A,
+};
+
+static char video43[5] = {
+ 0xEB, 0x03, 0xB0, 0x03,
+ 0xF4,
+};
+
+static char video44[2] = {
+ 0x3A, 0x07,
+};
+
+static char video45[2] = {
+ 0x35, 0x00,
+};
+
+static struct dsi_cmd_desc truly_video_display_on_cmds[] = {
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video0), video0},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video2), video2},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video3), video3},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video4), video4},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video5), video5},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video6), video6},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video7), video7},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video8), video8},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video9), video9},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video10), video10},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video11), video11},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video12), video12},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video13), video13},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video14), video14},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video15), video15},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video16), video16},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video17), video17},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video18), video18},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video19), video19},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video20), video20},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video21), video21},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video22), video22},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video23), video23},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video24), video24},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video25), video25},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video26), video26},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video27), video27},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video28), video28},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video29), video29},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video30), video30},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video31), video31},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video32), video32},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video33), video33},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video34), video34},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video35), video35},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video36), video36},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video37), video37},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video38), video38},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video39), video39},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video40), video40},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video41), video41},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video42), video42},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video43), video43},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video44), video44},
+ {DTYPE_GEN_LWRITE, 1, 0, 0, 0, sizeof(video45), video45},
+
+ {DTYPE_DCS_WRITE, 1, 0, 0, 150, sizeof(exit_sleep), exit_sleep},
+ {DTYPE_DCS_WRITE, 1, 0, 0, 50, sizeof(display_on), display_on},
+};
+
+static int mipi_truly_lcd_on(struct platform_device *pdev)
+{
+ struct msm_fb_data_type *mfd;
+ struct mipi_panel_info *mipi;
+
+ mfd = platform_get_drvdata(pdev);
+
+ if (!mfd)
+ return -ENODEV;
+
+ if (mfd->key != MFD_KEY)
+ return -EINVAL;
+
+ mipi = &mfd->panel_info.mipi;
+ pr_info("%s: mode = %d\n", __func__, mipi->mode);
+ msleep(120);
+
+ if (mipi->mode == DSI_VIDEO_MODE) {
+ mipi_dsi_cmds_tx(mfd, &truly_tx_buf,
+ truly_video_display_on_cmds,
+ ARRAY_SIZE(truly_video_display_on_cmds));
+ } else if (mipi->mode == DSI_CMD_MODE) {
+ mipi_dsi_cmds_tx(mfd, &truly_tx_buf,
+ truly_cmd_display_on_cmds,
+ ARRAY_SIZE(truly_cmd_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;
+}
+
+static int __devinit mipi_truly_lcd_probe(struct platform_device *pdev)
+{
+ int rc = 0;
+
+ if (pdev->id == 0) {
+ mipi_truly_pdata = pdev->dev.platform_data;
+ return rc;
+ }
+
+ msm_fb_add_device(pdev);
+
+ return rc;
+}
+
+static struct platform_driver this_driver = {
+ .probe = mipi_truly_lcd_probe,
+ .driver = {
+ .name = "mipi_truly_tft540960_1_e",
+ },
+};
+
+static void mipi_truly_set_backlight(struct msm_fb_data_type *mfd)
+{
+ return;
+}
+
+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];
+
+static int mipi_truly_tft540960_1_e_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);
+}
+int mipi_truly_tft540960_1_e_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;
+
+ ret = mipi_truly_tft540960_1_e_lcd_init();
+ if (ret) {
+ pr_err("%s: platform_device_register failed!\n", __func__);
+ return ret;
+ }
+
+ pdev = platform_device_alloc("mipi_truly_tft540960_1_e",
+ (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;
+}
diff --git a/drivers/video/msm/mipi_truly_tft540960_1_e.h b/drivers/video/msm/mipi_truly_tft540960_1_e.h
new file mode 100644
index 0000000..8cbfb80
--- /dev/null
+++ b/drivers/video/msm/mipi_truly_tft540960_1_e.h
@@ -0,0 +1,20 @@
+/* Copyright (c) 2012, 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
+
+int mipi_truly_tft540960_1_e_device_register(struct msm_panel_info *pinfo,
+ u32 channel, u32 panel);
+
+#endif /* MIPI_TRULY_H */
diff --git a/drivers/video/msm/mipi_truly_tft540960_1_e_cmd_qhd_pt.c b/drivers/video/msm/mipi_truly_tft540960_1_e_cmd_qhd_pt.c
new file mode 100644
index 0000000..82efbef
--- /dev/null
+++ b/drivers/video/msm/mipi_truly_tft540960_1_e_cmd_qhd_pt.c
@@ -0,0 +1,98 @@
+/* Copyright (c) 2012, 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_tft540960_1_e.h"
+
+static struct msm_panel_info pinfo;
+
+static struct mipi_dsi_phy_ctrl dsi_cmd_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 */
+ {0x01, 0xec, 0x31, 0xd2, 0x00, 0x40, 0x37, 0x62,
+ 0x01, 0x0f, 0x07,
+ 0x05, 0x14, 0x03, 0x0, 0x0, 0x0, 0x20, 0x0, 0x02, 0x0},
+};
+
+static int mipi_cmd_truly_qhd_pt_init(void)
+{
+ int ret;
+ if (msm_fb_detect_client("mipi_cmd_truly_qhd"))
+ return 0;
+
+ pinfo.xres = 540;
+ pinfo.yres = 960;
+ pinfo.type = MIPI_CMD_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 */
+ pinfo.lcdc.hsync_skew = 0;
+ pinfo.bl_max = 16;
+ pinfo.bl_min = 1;
+ pinfo.fb_num = 2;
+
+ pinfo.clk_rate = 499000000;
+
+ pinfo.lcd.vsync_enable = TRUE;
+ pinfo.lcd.hw_vsync_mode = TRUE;
+ pinfo.lcd.refx100 = 6000; /* adjust refx100 to prevent tearing */
+
+ pinfo.mipi.mode = DSI_CMD_MODE;
+ pinfo.mipi.dst_format = DSI_CMD_DST_FORMAT_RGB888;
+ pinfo.mipi.vc = 0;
+ pinfo.mipi.rgb_swap = DSI_RGB_SWAP_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_SW_TE;
+ pinfo.mipi.dma_trigger = DSI_CMD_TRIGGER_SW;
+ pinfo.mipi.te_sel = 1; /* TE from vsync gpio */
+ pinfo.mipi.interleave_max = 1;
+ pinfo.mipi.insert_dcs_cmd = TRUE;
+ pinfo.mipi.wr_mem_continue = 0x3c;
+ pinfo.mipi.wr_mem_start = 0x2c;
+ pinfo.mipi.dsi_phy_db = &dsi_cmd_mode_phy_db;
+ pinfo.mipi.tx_eot_append = 0x01;
+ pinfo.mipi.rx_eot_ignore = 0x0;
+ pinfo.mipi.dlane_swap = 0x01;
+
+ ret = mipi_truly_tft540960_1_e_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_cmd_truly_qhd_pt_init);
diff --git a/drivers/video/msm/mipi_truly_tft540960_1_e_video_qhd_pt.c b/drivers/video/msm/mipi_truly_tft540960_1_e_video_qhd_pt.c
new file mode 100644
index 0000000..0e12813
--- /dev/null
+++ b/drivers/video/msm/mipi_truly_tft540960_1_e_video_qhd_pt.c
@@ -0,0 +1,107 @@
+/* Copyright (c) 2012, 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_tft540960_1_e.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 mipi_video_truly_qhd_pt_init(void)
+{
+ int ret;
+ if (msm_fb_detect_client("mipi_video_truly_qhd"))
+ return 0;
+
+ pinfo.xres = 540;
+ pinfo.yres = 960;
+ 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 = 699000000;
+ pinfo.lcd.refx100 = 6000; /* FB driver calc FPS based on this value */
+ pinfo.bl_max = 16;
+ pinfo.bl_min = 1;
+ pinfo.fb_num = 2;
+
+ pinfo.mipi.mode = DSI_VIDEO_MODE;
+ /* send HSA and HE following VS/VE packet */
+ pinfo.mipi.pulse_mode_hsa_he = TRUE;
+ 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;
+
+ pinfo.mipi.dsi_phy_db = &dsi_video_mode_phy_db;
+ pinfo.mipi.dlane_swap = 0x01;
+ /* append EOT at the end of data burst */
+ pinfo.mipi.tx_eot_append = 0x01;
+
+ ret = mipi_truly_tft540960_1_e_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_qhd_pt_init);
diff --git a/drivers/video/msm/msm_fb.c b/drivers/video/msm/msm_fb.c
index 8ff1c75..bacc085 100644
--- a/drivers/video/msm/msm_fb.c
+++ b/drivers/video/msm/msm_fb.c
@@ -802,6 +802,36 @@
return ret;
}
+int calc_fb_offset(struct msm_fb_data_type *mfd, struct fb_info *fbi, int bpp)
+{
+ struct msm_panel_info *panel_info = &mfd->panel_info;
+ int remainder, yres, offset;
+
+ if (panel_info->mode2_yres != 0) {
+ yres = panel_info->mode2_yres;
+ remainder = (fbi->fix.line_length*yres) & (PAGE_SIZE - 1);
+ } else {
+ yres = panel_info->yres;
+ remainder = (fbi->fix.line_length*yres) & (PAGE_SIZE - 1);
+ }
+
+ if (!remainder)
+ remainder = PAGE_SIZE;
+
+ if (fbi->var.yoffset < yres) {
+ offset = (fbi->var.xoffset * bpp);
+ /* iBuf->buf += fbi->var.xoffset * bpp + 0 *
+ yres * fbi->fix.line_length; */
+ } else if (fbi->var.yoffset >= yres && fbi->var.yoffset < 2 * yres) {
+ offset = (fbi->var.xoffset * bpp + yres *
+ fbi->fix.line_length + PAGE_SIZE - remainder);
+ } else {
+ offset = (fbi->var.xoffset * bpp + 2 * yres *
+ fbi->fix.line_length + 2 * (PAGE_SIZE - remainder));
+ }
+ return offset;
+}
+
static void msm_fb_fillrect(struct fb_info *info,
const struct fb_fillrect *rect)
{
@@ -1119,11 +1149,12 @@
/* Make sure all buffers can be addressed on a page boundary by an x
* and y offset */
- remainder = (fix->line_length * panel_info->yres) % PAGE_SIZE;
+ remainder = (fix->line_length * panel_info->yres) & (PAGE_SIZE - 1);
+ /* PAGE_SIZE is a power of 2 */
if (!remainder)
remainder = PAGE_SIZE;
remainder_mode2 = (fix->line_length *
- panel_info->mode2_yres) % PAGE_SIZE;
+ panel_info->mode2_yres) & (PAGE_SIZE - 1);
if (!remainder_mode2)
remainder_mode2 = PAGE_SIZE;
diff --git a/drivers/video/msm/msm_fb.h b/drivers/video/msm/msm_fb.h
index a4b46ea..90fa9b3 100644
--- a/drivers/video/msm/msm_fb.h
+++ b/drivers/video/msm/msm_fb.h
@@ -197,6 +197,7 @@
int msm_fb_writeback_stop(struct fb_info *info);
int msm_fb_writeback_terminate(struct fb_info *info);
int msm_fb_detect_client(const char *name);
+int calc_fb_offset(struct msm_fb_data_type *mfd, struct fb_info *fbi, int bpp);
#ifdef CONFIG_FB_BACKLIGHT
void msm_fb_config_backlight(struct msm_fb_data_type *mfd);
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 154dc58..deba87c 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1533,7 +1533,7 @@
BT_DBG("%s status %d", hdev->name, status);
- if (!lmp_le_capable(hdev))
+ if (!hdev->disco_state)
clear_bit(HCI_INQUIRY, &hdev->flags);
hci_req_complete(hdev, HCI_OP_INQUIRY, status);
diff --git a/sound/soc/codecs/wcd9310.c b/sound/soc/codecs/wcd9310.c
index 0ae9680..d79af8c 100644
--- a/sound/soc/codecs/wcd9310.c
+++ b/sound/soc/codecs/wcd9310.c
@@ -5216,13 +5216,13 @@
struct tabla_reg_address *reg_addr = &priv->reg_addr;
if (TABLA_IS_1_X(tabla_core->version)) {
+ reg_addr->micb_4_mbhc = TABLA_1_A_MICB_4_MBHC;
+ reg_addr->micb_4_int_rbias = TABLA_1_A_MICB_4_INT_RBIAS;
reg_addr->micb_4_ctl = TABLA_1_A_MICB_4_CTL;
- reg_addr->micb_4_int_rbias = TABLA_1_A_MICB_4_INT_RBIAS;
- reg_addr->micb_4_int_rbias = TABLA_1_A_MICB_4_INT_RBIAS;
} else if (TABLA_IS_2_0(tabla_core->version)) {
+ reg_addr->micb_4_mbhc = TABLA_2_A_MICB_4_MBHC;
+ reg_addr->micb_4_int_rbias = TABLA_2_A_MICB_4_INT_RBIAS;
reg_addr->micb_4_ctl = TABLA_2_A_MICB_4_CTL;
- reg_addr->micb_4_int_rbias = TABLA_2_A_MICB_4_INT_RBIAS;
- reg_addr->micb_4_int_rbias = TABLA_2_A_MICB_4_INT_RBIAS;
}
}