Merge "msm: bam_dmux: Handle DMA Mapping Failure" into msm-3.0
diff --git a/arch/arm/configs/msm8960-perf_defconfig b/arch/arm/configs/msm8960-perf_defconfig
index 0780d20..21800fb 100644
--- a/arch/arm/configs/msm8960-perf_defconfig
+++ b/arch/arm/configs/msm8960-perf_defconfig
@@ -303,6 +303,7 @@
CONFIG_MSM_CAMERA_FLASH_SC628A=y
CONFIG_MSM_CAMERA_SENSOR=y
CONFIG_MSM_ACTUATOR=y
+CONFIG_S5K3L1YX=y
CONFIG_MSM_GEMINI=y
CONFIG_RADIO_IRIS=y
CONFIG_RADIO_IRIS_TRANSPORT=m
diff --git a/arch/arm/configs/msm8960_defconfig b/arch/arm/configs/msm8960_defconfig
index 5f9bd89..6be8772 100644
--- a/arch/arm/configs/msm8960_defconfig
+++ b/arch/arm/configs/msm8960_defconfig
@@ -309,6 +309,7 @@
CONFIG_MSM_CAMERA_FLASH_SC628A=y
CONFIG_MSM_CAMERA_SENSOR=y
CONFIG_MSM_ACTUATOR=y
+CONFIG_S5K3L1YX=y
CONFIG_MSM_GEMINI=y
CONFIG_RADIO_IRIS=y
CONFIG_RADIO_IRIS_TRANSPORT=m
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index 8b866d8..53b7dab 100644
--- a/arch/arm/mach-msm/Makefile
+++ b/arch/arm/mach-msm/Makefile
@@ -219,10 +219,10 @@
obj-$(CONFIG_MACH_MSM7X27_SURF) += board-msm7x27.o devices-msm7x27.o
obj-$(CONFIG_MACH_MSM7X27_FFA) += board-msm7x27.o devices-msm7x27.o
obj-$(CONFIG_ARCH_MSM7X27A) += clock-pcom-lookup.o devices-msm7x27a.o
-obj-$(CONFIG_MACH_MSM7X27A_RUMI3) += board-msm7x27a.o board-msm7627a-storage.o board-msm7627a-bt.o board-msm7627a-camera.o
-obj-$(CONFIG_MACH_MSM7X27A_SURF) += board-msm7x27a.o board-msm7627a-storage.o board-msm7627a-bt.o board-msm7627a-camera.o
-obj-$(CONFIG_MACH_MSM7X27A_FFA) += board-msm7x27a.o board-msm7627a-storage.o board-msm7627a-bt.o board-msm7627a-camera.o
-obj-$(CONFIG_MACH_MSM7627A_QRD1) += board-qrd7627a.o board-msm7627a-storage.o board-msm7627a-bt.o board-msm7627a-camera.o
+obj-$(CONFIG_MACH_MSM7X27A_RUMI3) += board-msm7x27a.o board-msm7627a-storage.o board-msm7627a-bt.o board-msm7627a-camera.o board-msm7627a-display.o
+obj-$(CONFIG_MACH_MSM7X27A_SURF) += board-msm7x27a.o board-msm7627a-storage.o board-msm7627a-bt.o board-msm7627a-camera.o board-msm7627a-display.o
+obj-$(CONFIG_MACH_MSM7X27A_FFA) += board-msm7x27a.o board-msm7627a-storage.o board-msm7627a-bt.o board-msm7627a-camera.o board-msm7627a-display.o
+obj-$(CONFIG_MACH_MSM7627A_QRD1) += board-qrd7627a.o board-msm7627a-storage.o board-msm7627a-bt.o board-msm7627a-camera.o board-msm7627a-display.o
obj-$(CONFIG_ARCH_MSM7X30) += board-msm7x30.o devices-msm7x30.o memory_topology.o
obj-$(CONFIG_ARCH_MSM7X30) += clock-local.o clock-7x30.o acpuclock-7x30.o
obj-$(CONFIG_MACH_MSM7X25_SURF) += board-msm7x27.o devices-msm7x25.o
diff --git a/arch/arm/mach-msm/board-8064.c b/arch/arm/mach-msm/board-8064.c
index a582260..0f1550d 100644
--- a/arch/arm/mach-msm/board-8064.c
+++ b/arch/arm/mach-msm/board-8064.c
@@ -23,6 +23,7 @@
#include <linux/dma-mapping.h>
#include <linux/platform_data/qcom_crypto_device.h>
#include <linux/ion.h>
+#include <linux/memory.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/hardware/gic.h>
@@ -62,9 +63,12 @@
#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
#define MSM_PMEM_KERNEL_EBI1_SIZE 0xB0C000
#define MSM_ION_SF_SIZE MSM_PMEM_SIZE
+#define MSM_ION_MM_FW_SIZE 0x200000 /* (2MB) */
#define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE
+#define MSM_ION_QSECOM_SIZE 0x100000 /* (1MB) */
#define MSM_ION_MFC_SIZE SZ_8K
-#define MSM_ION_HEAP_NUM 5
+#define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE
+#define MSM_ION_HEAP_NUM 8
#else
#define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000
#define MSM_ION_HEAP_NUM 1
@@ -198,13 +202,22 @@
#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
static struct ion_cp_heap_pdata cp_mm_ion_pdata = {
.permission_type = IPT_TYPE_MM_CARVEOUT,
+ .align = PAGE_SIZE,
};
static struct ion_cp_heap_pdata cp_mfc_ion_pdata = {
.permission_type = IPT_TYPE_MFC_SHAREDMEM,
+ .align = PAGE_SIZE,
};
static struct ion_co_heap_pdata co_ion_pdata = {
+ .adjacent_mem_id = INVALID_HEAP_ID,
+ .align = PAGE_SIZE,
+};
+
+static struct ion_co_heap_pdata fw_co_ion_pdata = {
+ .adjacent_mem_id = ION_CP_MM_HEAP_ID,
+ .align = SZ_128K,
};
#endif
static struct ion_platform_data ion_pdata = {
@@ -233,6 +246,14 @@
.extra_data = (void *) &cp_mm_ion_pdata,
},
{
+ .id = ION_MM_FIRMWARE_HEAP_ID,
+ .type = ION_HEAP_TYPE_CARVEOUT,
+ .name = ION_MM_FIRMWARE_HEAP_NAME,
+ .size = MSM_ION_MM_FW_SIZE,
+ .memory_type = ION_EBI_TYPE,
+ .extra_data = (void *) &fw_co_ion_pdata,
+ },
+ {
.id = ION_CP_MFC_HEAP_ID,
.type = ION_HEAP_TYPE_CP,
.name = ION_MFC_HEAP_NAME,
@@ -245,6 +266,22 @@
.type = ION_HEAP_TYPE_IOMMU,
.name = ION_IOMMU_HEAP_NAME,
},
+ {
+ .id = ION_QSECOM_HEAP_ID,
+ .type = ION_HEAP_TYPE_CARVEOUT,
+ .name = ION_QSECOM_HEAP_NAME,
+ .size = MSM_ION_QSECOM_SIZE,
+ .memory_type = ION_EBI_TYPE,
+ .extra_data = (void *) &co_ion_pdata,
+ },
+ {
+ .id = ION_AUDIO_HEAP_ID,
+ .type = ION_HEAP_TYPE_CARVEOUT,
+ .name = ION_AUDIO_HEAP_NAME,
+ .size = MSM_ION_AUDIO_SIZE,
+ .memory_type = ION_EBI_TYPE,
+ .extra_data = (void *) &co_ion_pdata,
+ },
#endif
}
};
@@ -260,8 +297,11 @@
{
#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_SIZE;
+ apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_FW_SIZE;
apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_SF_SIZE;
apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MFC_SIZE;
+ apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_QSECOM_SIZE;
+ apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_AUDIO_SIZE;
#endif
}
@@ -292,12 +332,19 @@
bank_size = apq8064_memory_bank_size();
low = meminfo.bank[0].start;
high = mb->start + mb->size;
+
+ /* Check if 32 bit overflow occured */
+ if (high < mb->start)
+ high = ~0UL;
+
low &= ~(bank_size - 1);
if (high - low <= bank_size)
return;
- apq8064_reserve_info.low_unstable_address = low + bank_size;
- apq8064_reserve_info.max_unstable_size = high - low - bank_size;
+ apq8064_reserve_info.low_unstable_address = mb->start -
+ MIN_MEMORY_BLOCK_SIZE + mb->size;
+ apq8064_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE;
+
apq8064_reserve_info.bank_size = bank_size;
pr_info("low unstable address %lx max size %lx bank size %lx\n",
apq8064_reserve_info.low_unstable_address,
diff --git a/arch/arm/mach-msm/board-8930-regulator.c b/arch/arm/mach-msm/board-8930-regulator.c
index fc9b58f..765bd45 100644
--- a/arch/arm/mach-msm/board-8930-regulator.c
+++ b/arch/arm/mach-msm/board-8930-regulator.c
@@ -76,6 +76,7 @@
};
VREG_CONSUMERS(L14) = {
REGULATOR_SUPPLY("8038_l14", NULL),
+ REGULATOR_SUPPLY("pa_therm", "pm8xxx-adc"),
};
VREG_CONSUMERS(L15) = {
REGULATOR_SUPPLY("8038_l15", NULL),
diff --git a/arch/arm/mach-msm/board-msm7627a-display.c b/arch/arm/mach-msm/board-msm7627a-display.c
new file mode 100644
index 0000000..32d29b2
--- /dev/null
+++ b/arch/arm/mach-msm/board-msm7627a-display.c
@@ -0,0 +1,701 @@
+/* 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 <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/platform_device.h>
+#include <linux/bootmem.h>
+#include <linux/regulator/consumer.h>
+#include <asm/mach-types.h>
+#include <asm/io.h>
+#include <mach/msm_bus_board.h>
+#include <mach/msm_memtypes.h>
+#include <mach/board.h>
+#include <mach/gpio.h>
+#include <mach/gpiomux.h>
+#include <mach/socinfo.h>
+#include <mach/rpc_pmapp.h>
+#include "devices.h"
+#include "board-msm7627a.h"
+
+#ifdef CONFIG_FB_MSM_TRIPLE_BUFFER
+#define MSM_FB_SIZE 0x260000
+#define MSM7x25A_MSM_FB_SIZE 0xE1000
+#else
+#define MSM_FB_SIZE 0x195000
+#define MSM7x25A_MSM_FB_SIZE 0x96000
+#endif
+
+static unsigned fb_size = MSM_FB_SIZE;
+static int __init fb_size_setup(char *p)
+{
+ fb_size = memparse(p, NULL);
+ return 0;
+}
+
+early_param("fb_size", fb_size_setup);
+
+static struct regulator_bulk_data regs_lcdc[] = {
+ { .supply = "gp2", .min_uV = 2850000, .max_uV = 2850000 },
+ { .supply = "msme1", .min_uV = 1800000, .max_uV = 1800000 },
+};
+static uint32_t lcdc_gpio_initialized;
+
+static void lcdc_toshiba_gpio_init(void)
+{
+ int rc = 0;
+ if (!lcdc_gpio_initialized) {
+ if (gpio_request(GPIO_SPI_CLK, "spi_clk")) {
+ pr_err("failed to request gpio spi_clk\n");
+ return;
+ }
+ if (gpio_request(GPIO_SPI_CS0_N, "spi_cs")) {
+ pr_err("failed to request gpio spi_cs0_N\n");
+ goto fail_gpio6;
+ }
+ if (gpio_request(GPIO_SPI_MOSI, "spi_mosi")) {
+ pr_err("failed to request gpio spi_mosi\n");
+ goto fail_gpio5;
+ }
+ if (gpio_request(GPIO_SPI_MISO, "spi_miso")) {
+ pr_err("failed to request gpio spi_miso\n");
+ goto fail_gpio4;
+ }
+ if (gpio_request(GPIO_DISPLAY_PWR_EN, "gpio_disp_pwr")) {
+ pr_err("failed to request gpio_disp_pwr\n");
+ goto fail_gpio3;
+ }
+ if (gpio_request(GPIO_BACKLIGHT_EN, "gpio_bkl_en")) {
+ pr_err("failed to request gpio_bkl_en\n");
+ goto fail_gpio2;
+ }
+ pmapp_disp_backlight_init();
+
+ rc = regulator_bulk_get(NULL, ARRAY_SIZE(regs_lcdc),
+ regs_lcdc);
+ if (rc) {
+ pr_err("%s: could not get regulators: %d\n",
+ __func__, rc);
+ goto fail_gpio1;
+ }
+
+ rc = regulator_bulk_set_voltage(ARRAY_SIZE(regs_lcdc),
+ regs_lcdc);
+ if (rc) {
+ pr_err("%s: could not set voltages: %d\n",
+ __func__, rc);
+ goto fail_vreg;
+ }
+ lcdc_gpio_initialized = 1;
+ }
+ return;
+fail_vreg:
+ regulator_bulk_free(ARRAY_SIZE(regs_lcdc), regs_lcdc);
+fail_gpio1:
+ gpio_free(GPIO_BACKLIGHT_EN);
+fail_gpio2:
+ gpio_free(GPIO_DISPLAY_PWR_EN);
+fail_gpio3:
+ gpio_free(GPIO_SPI_MISO);
+fail_gpio4:
+ gpio_free(GPIO_SPI_MOSI);
+fail_gpio5:
+ gpio_free(GPIO_SPI_CS0_N);
+fail_gpio6:
+ gpio_free(GPIO_SPI_CLK);
+ lcdc_gpio_initialized = 0;
+}
+
+static uint32_t lcdc_gpio_table[] = {
+ GPIO_SPI_CLK,
+ GPIO_SPI_CS0_N,
+ GPIO_SPI_MOSI,
+ GPIO_DISPLAY_PWR_EN,
+ GPIO_BACKLIGHT_EN,
+ GPIO_SPI_MISO,
+};
+
+static void config_lcdc_gpio_table(uint32_t *table, int len, unsigned enable)
+{
+ int n;
+
+ if (lcdc_gpio_initialized) {
+ /* All are IO Expander GPIOs */
+ for (n = 0; n < (len - 1); n++)
+ gpio_direction_output(table[n], 1);
+ }
+}
+
+static void lcdc_toshiba_config_gpios(int enable)
+{
+ config_lcdc_gpio_table(lcdc_gpio_table,
+ ARRAY_SIZE(lcdc_gpio_table), enable);
+}
+
+static int msm_fb_lcdc_power_save(int on)
+{
+ int rc = 0;
+ /* Doing the init of the LCDC GPIOs very late as they are from
+ an I2C-controlled IO Expander */
+ lcdc_toshiba_gpio_init();
+
+ if (lcdc_gpio_initialized) {
+ gpio_set_value_cansleep(GPIO_DISPLAY_PWR_EN, on);
+ gpio_set_value_cansleep(GPIO_BACKLIGHT_EN, on);
+
+ rc = on ? regulator_bulk_enable(
+ ARRAY_SIZE(regs_lcdc), regs_lcdc) :
+ regulator_bulk_disable(
+ ARRAY_SIZE(regs_lcdc), regs_lcdc);
+
+ if (rc)
+ pr_err("%s: could not %sable regulators: %d\n",
+ __func__, on ? "en" : "dis", rc);
+ }
+
+ return rc;
+}
+
+static int lcdc_toshiba_set_bl(int level)
+{
+ int ret;
+
+ ret = pmapp_disp_backlight_set_brightness(level);
+ if (ret)
+ pr_err("%s: can't set lcd backlight!\n", __func__);
+
+ return ret;
+}
+
+static struct lcdc_platform_data lcdc_pdata = {
+ .lcdc_gpio_config = NULL,
+ .lcdc_power_save = msm_fb_lcdc_power_save,
+};
+
+static int lcd_panel_spi_gpio_num[] = {
+ GPIO_SPI_MOSI, /* spi_sdi */
+ GPIO_SPI_MISO, /* spi_sdoi */
+ GPIO_SPI_CLK, /* spi_clk */
+ GPIO_SPI_CS0_N, /* spi_cs */
+};
+
+static struct msm_panel_common_pdata lcdc_toshiba_panel_data = {
+ .panel_config_gpio = lcdc_toshiba_config_gpios,
+ .pmic_backlight = lcdc_toshiba_set_bl,
+ .gpio_num = lcd_panel_spi_gpio_num,
+};
+
+static struct platform_device lcdc_toshiba_panel_device = {
+ .name = "lcdc_toshiba_fwvga_pt",
+ .id = 0,
+ .dev = {
+ .platform_data = &lcdc_toshiba_panel_data,
+ }
+};
+
+static struct resource msm_fb_resources[] = {
+ {
+ .flags = IORESOURCE_DMA,
+ }
+};
+
+#define PANEL_NAME_MAX_LEN 30
+#define LCDC_TOSHIBA_FWVGA_PANEL_NAME "lcdc_toshiba_fwvga_pt"
+#define MIPI_CMD_RENESAS_FWVGA_PANEL_NAME "mipi_cmd_renesas_fwvga"
+
+static int msm_fb_detect_panel(const char *name)
+{
+ int ret = -ENODEV;
+
+ if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf()) {
+ if (!strncmp(name, "lcdc_toshiba_fwvga_pt", 21) ||
+ !strncmp(name, "mipi_cmd_renesas_fwvga", 22))
+ ret = 0;
+ } else if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()) {
+ if (!strncmp(name, "mipi_cmd_renesas_fwvga", 22))
+ ret = 0;
+ } else if (machine_is_msm7627a_qrd1()) {
+ if (!strncmp(name, "mipi_video_truly_wvga", 21))
+ ret = 0;
+ }
+
+#if !defined(CONFIG_FB_MSM_LCDC_AUTO_DETECT) && \
+ !defined(CONFIG_FB_MSM_MIPI_PANEL_AUTO_DETECT) && \
+ !defined(CONFIG_FB_MSM_LCDC_MIPI_PANEL_AUTO_DETECT)
+ if (machine_is_msm7x27a_surf() ||
+ machine_is_msm7625a_surf()) {
+ if (!strncmp(name, LCDC_TOSHIBA_FWVGA_PANEL_NAME,
+ strnlen(LCDC_TOSHIBA_FWVGA_PANEL_NAME,
+ PANEL_NAME_MAX_LEN)))
+ return 0;
+ }
+#endif
+
+ return ret;
+}
+
+static int mipi_truly_set_bl(int on)
+{
+ gpio_set_value_cansleep(QRD_GPIO_BACKLIGHT_EN, !!on);
+
+ return 1;
+}
+
+static struct msm_fb_platform_data msm_fb_pdata = {
+ .detect_client = msm_fb_detect_panel,
+};
+
+static struct platform_device msm_fb_device = {
+ .name = "msm_fb",
+ .id = 0,
+ .num_resources = ARRAY_SIZE(msm_fb_resources),
+ .resource = msm_fb_resources,
+ .dev = {
+ .platform_data = &msm_fb_pdata,
+ }
+};
+
+#ifdef CONFIG_FB_MSM_MIPI_DSI
+static int mipi_renesas_set_bl(int level)
+{
+ int ret;
+
+ ret = pmapp_disp_backlight_set_brightness(level);
+
+ if (ret)
+ pr_err("%s: can't set lcd backlight!\n", __func__);
+
+ return ret;
+}
+
+static struct msm_panel_common_pdata mipi_renesas_pdata = {
+ .pmic_backlight = mipi_renesas_set_bl,
+};
+
+
+static struct platform_device mipi_dsi_renesas_panel_device = {
+ .name = "mipi_renesas",
+ .id = 0,
+ .dev = {
+ .platform_data = &mipi_renesas_pdata,
+ }
+};
+#endif
+
+static struct msm_panel_common_pdata mipi_truly_pdata = {
+ .pmic_backlight = mipi_truly_set_bl,
+};
+
+static struct platform_device mipi_dsi_truly_panel_device = {
+ .name = "mipi_truly",
+ .id = 0,
+ .dev = {
+ .platform_data = &mipi_truly_pdata,
+ }
+};
+
+static struct platform_device *msm_fb_devices[] __initdata = {
+ &msm_fb_device,
+ &lcdc_toshiba_panel_device,
+#ifdef CONFIG_FB_MSM_MIPI_DSI
+ &mipi_dsi_renesas_panel_device,
+#endif
+};
+
+static struct platform_device *qrd_fb_devices[] __initdata = {
+ &msm_fb_device,
+ &mipi_dsi_truly_panel_device,
+};
+
+void __init msm_msm7627a_allocate_memory_regions(void)
+{
+ void *addr;
+ unsigned long fb_size;
+
+ if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa())
+ fb_size = MSM7x25A_MSM_FB_SIZE;
+ else
+ fb_size = MSM_FB_SIZE;
+ addr = alloc_bootmem_align(fb_size, 0x1000);
+ msm_fb_resources[0].start = __pa(addr);
+ msm_fb_resources[0].end = msm_fb_resources[0].start + fb_size - 1;
+ pr_info("allocating %lu bytes at %p (%lx physical) for fb\n", fb_size,
+ addr, __pa(addr));
+}
+
+static struct msm_panel_common_pdata mdp_pdata = {
+ .gpio = 97,
+ .mdp_rev = MDP_REV_303,
+};
+
+#define GPIO_LCDC_BRDG_PD 128
+#define GPIO_LCDC_BRDG_RESET_N 129
+#define GPIO_LCD_DSI_SEL 125
+#define LCDC_RESET_PHYS 0x90008014
+
+static void __iomem *lcdc_reset_ptr;
+
+static unsigned mipi_dsi_gpio[] = {
+ GPIO_CFG(GPIO_LCDC_BRDG_RESET_N, 0, GPIO_CFG_OUTPUT,
+ GPIO_CFG_NO_PULL, GPIO_CFG_2MA), /* LCDC_BRDG_RESET_N */
+ GPIO_CFG(GPIO_LCDC_BRDG_PD, 0, GPIO_CFG_OUTPUT,
+ GPIO_CFG_NO_PULL, GPIO_CFG_2MA), /* LCDC_BRDG_PD */
+};
+
+static unsigned lcd_dsi_sel_gpio[] = {
+ GPIO_CFG(GPIO_LCD_DSI_SEL, 0, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP,
+ GPIO_CFG_2MA),
+};
+
+enum {
+ DSI_SINGLE_LANE = 1,
+ DSI_TWO_LANES,
+};
+
+static int msm_fb_get_lane_config(void)
+{
+ /* For MSM7627A SURF/FFA and QRD */
+ int rc = DSI_TWO_LANES;
+ if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa()) {
+ rc = DSI_SINGLE_LANE;
+ pr_info("DSI_SINGLE_LANES\n");
+ } else {
+ pr_info("DSI_TWO_LANES\n");
+ }
+ return rc;
+}
+
+static int msm_fb_dsi_client_msm_reset(void)
+{
+ int rc = 0;
+
+ rc = gpio_request(GPIO_LCDC_BRDG_RESET_N, "lcdc_brdg_reset_n");
+ if (rc < 0) {
+ pr_err("failed to request lcd brdg reset_n\n");
+ return rc;
+ }
+
+ rc = gpio_request(GPIO_LCDC_BRDG_PD, "lcdc_brdg_pd");
+ if (rc < 0) {
+ pr_err("failed to request lcd brdg pd\n");
+ return rc;
+ }
+
+ rc = gpio_tlmm_config(mipi_dsi_gpio[0], GPIO_CFG_ENABLE);
+ if (rc) {
+ pr_err("Failed to enable LCDC Bridge reset enable\n");
+ goto gpio_error;
+ }
+
+ rc = gpio_tlmm_config(mipi_dsi_gpio[1], GPIO_CFG_ENABLE);
+ if (rc) {
+ pr_err("Failed to enable LCDC Bridge pd enable\n");
+ goto gpio_error2;
+ }
+
+ rc = gpio_direction_output(GPIO_LCDC_BRDG_RESET_N, 1);
+ rc |= gpio_direction_output(GPIO_LCDC_BRDG_PD, 1);
+ gpio_set_value_cansleep(GPIO_LCDC_BRDG_PD, 0);
+
+ if (!rc) {
+ if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf()) {
+ lcdc_reset_ptr = ioremap_nocache(LCDC_RESET_PHYS,
+ sizeof(uint32_t));
+
+ if (!lcdc_reset_ptr)
+ return 0;
+ }
+ return rc;
+ } else {
+ goto gpio_error;
+ }
+
+gpio_error2:
+ pr_err("Failed GPIO bridge pd\n");
+ gpio_free(GPIO_LCDC_BRDG_PD);
+
+gpio_error:
+ pr_err("Failed GPIO bridge reset\n");
+ gpio_free(GPIO_LCDC_BRDG_RESET_N);
+ return rc;
+}
+
+static int mipi_truly_sel_mode(int video_mode)
+{
+ int rc = 0;
+
+ rc = gpio_request(GPIO_LCD_DSI_SEL, "lcd_dsi_sel");
+ if (rc < 0)
+ goto gpio_error;
+
+ rc = gpio_tlmm_config(lcd_dsi_sel_gpio[0], GPIO_CFG_ENABLE);
+ if (rc)
+ goto gpio_error;
+
+ rc = gpio_direction_output(GPIO_LCD_DSI_SEL, 1);
+ if (!rc) {
+ gpio_set_value_cansleep(GPIO_LCD_DSI_SEL, video_mode);
+ return rc;
+ } else {
+ goto gpio_error;
+ }
+
+gpio_error:
+ pr_err("mipi_truly_sel_mode failed\n");
+ gpio_free(GPIO_LCD_DSI_SEL);
+ return rc;
+}
+
+static int msm_fb_dsi_client_qrd1_reset(void)
+{
+ int rc = 0;
+
+ rc = gpio_request(GPIO_LCDC_BRDG_RESET_N, "lcdc_brdg_reset_n");
+ if (rc < 0) {
+ pr_err("failed to request lcd brdg reset_n\n");
+ return rc;
+ }
+
+ rc = gpio_tlmm_config(mipi_dsi_gpio[0], GPIO_CFG_ENABLE);
+ if (rc < 0) {
+ pr_err("Failed to enable LCDC Bridge reset enable\n");
+ return rc;
+ }
+
+ rc = gpio_direction_output(GPIO_LCDC_BRDG_RESET_N, 1);
+ if (rc < 0) {
+ pr_err("Failed GPIO bridge pd\n");
+ gpio_free(GPIO_LCDC_BRDG_RESET_N);
+ return rc;
+ }
+
+ mipi_truly_sel_mode(1);
+
+ return rc;
+}
+
+static int msm_fb_dsi_client_reset(void)
+{
+ int rc = 0;
+
+ if (machine_is_msm7627a_qrd1())
+ rc = msm_fb_dsi_client_qrd1_reset();
+ else
+ rc = msm_fb_dsi_client_msm_reset();
+
+ return rc;
+
+}
+
+static struct regulator_bulk_data regs_dsi[] = {
+ { .supply = "gp2", .min_uV = 2850000, .max_uV = 2850000 },
+ { .supply = "msme1", .min_uV = 1800000, .max_uV = 1800000 },
+};
+
+static int dsi_gpio_initialized;
+
+static int mipi_dsi_panel_msm_power(int on)
+{
+ int rc = 0;
+ uint32_t lcdc_reset_cfg;
+
+ /* I2C-controlled GPIO Expander -init of the GPIOs very late */
+ if (unlikely(!dsi_gpio_initialized)) {
+ pmapp_disp_backlight_init();
+
+ rc = gpio_request(GPIO_DISPLAY_PWR_EN, "gpio_disp_pwr");
+ if (rc < 0) {
+ pr_err("failed to request gpio_disp_pwr\n");
+ return rc;
+ }
+
+ if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf()) {
+ rc = gpio_direction_output(GPIO_DISPLAY_PWR_EN, 1);
+ if (rc < 0) {
+ pr_err("failed to enable display pwr\n");
+ goto fail_gpio1;
+ }
+
+ rc = gpio_request(GPIO_BACKLIGHT_EN, "gpio_bkl_en");
+ if (rc < 0) {
+ pr_err("failed to request gpio_bkl_en\n");
+ goto fail_gpio1;
+ }
+
+ rc = gpio_direction_output(GPIO_BACKLIGHT_EN, 1);
+ if (rc < 0) {
+ pr_err("failed to enable backlight\n");
+ goto fail_gpio2;
+ }
+ }
+
+ rc = regulator_bulk_get(NULL, ARRAY_SIZE(regs_dsi), regs_dsi);
+ if (rc) {
+ pr_err("%s: could not get regulators: %d\n",
+ __func__, rc);
+ goto fail_gpio2;
+ }
+
+ rc = regulator_bulk_set_voltage(ARRAY_SIZE(regs_dsi),
+ regs_dsi);
+ if (rc) {
+ pr_err("%s: could not set voltages: %d\n",
+ __func__, rc);
+ goto fail_vreg;
+ }
+ if (pmapp_disp_backlight_set_brightness(100))
+ pr_err("backlight set brightness failed\n");
+
+ dsi_gpio_initialized = 1;
+ }
+ if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf()) {
+ gpio_set_value_cansleep(GPIO_DISPLAY_PWR_EN, on);
+ gpio_set_value_cansleep(GPIO_BACKLIGHT_EN, on);
+ } else if (machine_is_msm7x27a_ffa() ||
+ machine_is_msm7625a_ffa()) {
+ if (on) {
+ /* This line drives an active low pin on FFA */
+ rc = gpio_direction_output(GPIO_DISPLAY_PWR_EN, !on);
+ if (rc < 0)
+ pr_err("failed to set direction for "
+ "display pwr\n");
+ } else {
+ gpio_set_value_cansleep(GPIO_DISPLAY_PWR_EN, !on);
+ rc = gpio_direction_input(GPIO_DISPLAY_PWR_EN);
+ if (rc < 0)
+ pr_err("failed to set direction for "
+ "display pwr\n");
+ }
+ }
+
+ if (on) {
+ gpio_set_value_cansleep(GPIO_LCDC_BRDG_PD, 0);
+
+ if (machine_is_msm7x27a_surf() ||
+ machine_is_msm7625a_surf()) {
+ lcdc_reset_cfg = readl_relaxed(lcdc_reset_ptr);
+ rmb();
+ lcdc_reset_cfg &= ~1;
+
+ writel_relaxed(lcdc_reset_cfg, lcdc_reset_ptr);
+ msleep(20);
+ wmb();
+ lcdc_reset_cfg |= 1;
+ writel_relaxed(lcdc_reset_cfg, lcdc_reset_ptr);
+ } else {
+ gpio_set_value_cansleep(GPIO_LCDC_BRDG_RESET_N, 0);
+ msleep(20);
+ gpio_set_value_cansleep(GPIO_LCDC_BRDG_RESET_N, 1);
+ }
+ } else {
+ gpio_set_value_cansleep(GPIO_LCDC_BRDG_PD, 1);
+
+ if (pmapp_disp_backlight_set_brightness(0))
+ pr_err("backlight set brightness failed\n");
+ }
+
+ rc = on ? regulator_bulk_enable(ARRAY_SIZE(regs_dsi), regs_dsi) :
+ regulator_bulk_disable(ARRAY_SIZE(regs_dsi), regs_dsi);
+
+ if (rc)
+ pr_err("%s: could not %sable regulators: %d\n",
+ __func__, on ? "en" : "dis", rc);
+
+ return rc;
+fail_vreg:
+ regulator_bulk_free(ARRAY_SIZE(regs_dsi), regs_dsi);
+fail_gpio2:
+ gpio_free(GPIO_BACKLIGHT_EN);
+fail_gpio1:
+ gpio_free(GPIO_DISPLAY_PWR_EN);
+ dsi_gpio_initialized = 0;
+ return rc;
+}
+
+static int mipi_dsi_panel_qrd1_power(int on)
+{
+ int rc = 0;
+
+ if (!dsi_gpio_initialized) {
+ rc = gpio_request(QRD_GPIO_BACKLIGHT_EN, "gpio_bkl_en");
+ if (rc < 0)
+ return rc;
+
+ rc = gpio_tlmm_config(GPIO_CFG(QRD_GPIO_BACKLIGHT_EN, 0,
+ GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
+ GPIO_CFG_ENABLE);
+ if (rc < 0) {
+ pr_err("failed GPIO_BACKLIGHT_EN tlmm config\n");
+ return rc;
+ }
+
+ rc = gpio_direction_output(QRD_GPIO_BACKLIGHT_EN, 1);
+ if (rc < 0) {
+ pr_err("failed to enable backlight\n");
+ gpio_free(QRD_GPIO_BACKLIGHT_EN);
+ return rc;
+ }
+ dsi_gpio_initialized = 1;
+ }
+
+ gpio_set_value_cansleep(QRD_GPIO_BACKLIGHT_EN, !!on);
+
+ if (!on) {
+ gpio_set_value_cansleep(GPIO_LCDC_BRDG_RESET_N, 1);
+ msleep(20);
+ gpio_set_value_cansleep(GPIO_LCDC_BRDG_RESET_N, 0);
+ msleep(20);
+ gpio_set_value_cansleep(GPIO_LCDC_BRDG_RESET_N, 1);
+
+ }
+
+ return rc;
+}
+
+static int mipi_dsi_panel_power(int on)
+{
+ int rc = 0;
+
+ if (machine_is_msm7627a_qrd1())
+ rc = mipi_dsi_panel_qrd1_power(on);
+ else
+ rc = mipi_dsi_panel_msm_power(on);
+ return rc;
+}
+
+#define MDP_303_VSYNC_GPIO 97
+
+#ifdef CONFIG_FB_MSM_MDP303
+static struct mipi_dsi_platform_data mipi_dsi_pdata = {
+ .vsync_gpio = MDP_303_VSYNC_GPIO,
+ .dsi_power_save = mipi_dsi_panel_power,
+ .dsi_client_reset = msm_fb_dsi_client_reset,
+ .get_lane_config = msm_fb_get_lane_config,
+};
+#endif
+
+void __init msm_fb_add_devices(void)
+{
+ if (machine_is_msm7627a_qrd1())
+ platform_add_devices(qrd_fb_devices,
+ ARRAY_SIZE(qrd_fb_devices));
+ else
+ platform_add_devices(msm_fb_devices,
+ ARRAY_SIZE(msm_fb_devices));
+
+ msm_fb_register_device("mdp", &mdp_pdata);
+ if (machine_is_msm7625a_surf() || machine_is_msm7x27a_surf())
+ msm_fb_register_device("lcdc", &lcdc_pdata);
+#ifdef CONFIG_FB_MSM_MDP303
+ msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata);
+#endif
+}
diff --git a/arch/arm/mach-msm/board-msm7627a.h b/arch/arm/mach-msm/board-msm7627a.h
index 7d7da4f..b0481a0 100644
--- a/arch/arm/mach-msm/board-msm7627a.h
+++ b/arch/arm/mach-msm/board-msm7627a.h
@@ -15,6 +15,9 @@
void __init msm7627a_init_mmc(void);
+void __init msm_msm7627a_allocate_memory_regions(void);
+void __init msm_fb_add_devices(void);
+
enum {
GPIO_EXPANDER_IRQ_BASE = NR_MSM_IRQS + NR_GPIO_IRQS,
GPIO_EXPANDER_GPIO_BASE = NR_MSM_GPIOS,
diff --git a/arch/arm/mach-msm/board-msm7x27a.c b/arch/arm/mach-msm/board-msm7x27a.c
index 5bcd749..77db796 100644
--- a/arch/arm/mach-msm/board-msm7x27a.c
+++ b/arch/arm/mach-msm/board-msm7x27a.c
@@ -157,16 +157,6 @@
#define MSM_PMEM_ADSP_SIZE 0x1100000
#define MSM7x25A_MSM_PMEM_ADSP_SIZE 0xB91000
-
-#ifdef CONFIG_FB_MSM_TRIPLE_BUFFER
-#define MSM_FB_SIZE 0x260000
-#define MSM7x25A_MSM_FB_SIZE 0xE1000
-#else
-#define MSM_FB_SIZE 0x195000
-#define MSM7x25A_MSM_FB_SIZE 0x96000
-
-#endif
-
#endif
static struct android_usb_platform_data android_usb_pdata = {
@@ -400,253 +390,6 @@
early_param("pmem_adsp_size", pmem_adsp_size_setup);
-static unsigned fb_size = MSM_FB_SIZE;
-static int __init fb_size_setup(char *p)
-{
- fb_size = memparse(p, NULL);
- return 0;
-}
-
-early_param("fb_size", fb_size_setup);
-
-static struct regulator_bulk_data regs_lcdc[] = {
- { .supply = "gp2", .min_uV = 2850000, .max_uV = 2850000 },
- { .supply = "msme1", .min_uV = 1800000, .max_uV = 1800000 },
-};
-
-static uint32_t lcdc_gpio_initialized;
-
-static void lcdc_toshiba_gpio_init(void)
-{
- int rc = 0;
- if (!lcdc_gpio_initialized) {
- if (gpio_request(GPIO_SPI_CLK, "spi_clk")) {
- pr_err("failed to request gpio spi_clk\n");
- return;
- }
- if (gpio_request(GPIO_SPI_CS0_N, "spi_cs")) {
- pr_err("failed to request gpio spi_cs0_N\n");
- goto fail_gpio6;
- }
- if (gpio_request(GPIO_SPI_MOSI, "spi_mosi")) {
- pr_err("failed to request gpio spi_mosi\n");
- goto fail_gpio5;
- }
- if (gpio_request(GPIO_SPI_MISO, "spi_miso")) {
- pr_err("failed to request gpio spi_miso\n");
- goto fail_gpio4;
- }
- if (gpio_request(GPIO_DISPLAY_PWR_EN, "gpio_disp_pwr")) {
- pr_err("failed to request gpio_disp_pwr\n");
- goto fail_gpio3;
- }
- if (gpio_request(GPIO_BACKLIGHT_EN, "gpio_bkl_en")) {
- pr_err("failed to request gpio_bkl_en\n");
- goto fail_gpio2;
- }
- pmapp_disp_backlight_init();
-
- rc = regulator_bulk_get(NULL, ARRAY_SIZE(regs_lcdc), regs_lcdc);
- if (rc) {
- pr_err("%s: could not get regulators: %d\n",
- __func__, rc);
- goto fail_gpio1;
- }
-
- rc = regulator_bulk_set_voltage(ARRAY_SIZE(regs_lcdc),
- regs_lcdc);
- if (rc) {
- pr_err("%s: could not set voltages: %d\n",
- __func__, rc);
- goto fail_vreg;
- }
- lcdc_gpio_initialized = 1;
- }
- return;
-fail_vreg:
- regulator_bulk_free(ARRAY_SIZE(regs_lcdc), regs_lcdc);
-fail_gpio1:
- gpio_free(GPIO_BACKLIGHT_EN);
-fail_gpio2:
- gpio_free(GPIO_DISPLAY_PWR_EN);
-fail_gpio3:
- gpio_free(GPIO_SPI_MISO);
-fail_gpio4:
- gpio_free(GPIO_SPI_MOSI);
-fail_gpio5:
- gpio_free(GPIO_SPI_CS0_N);
-fail_gpio6:
- gpio_free(GPIO_SPI_CLK);
- lcdc_gpio_initialized = 0;
-}
-
-static uint32_t lcdc_gpio_table[] = {
- GPIO_SPI_CLK,
- GPIO_SPI_CS0_N,
- GPIO_SPI_MOSI,
- GPIO_DISPLAY_PWR_EN,
- GPIO_BACKLIGHT_EN,
- GPIO_SPI_MISO,
-};
-
-static void config_lcdc_gpio_table(uint32_t *table, int len, unsigned enable)
-{
- int n;
-
- if (lcdc_gpio_initialized) {
- /* All are IO Expander GPIOs */
- for (n = 0; n < (len - 1); n++)
- gpio_direction_output(table[n], 1);
- }
-}
-
-static void lcdc_toshiba_config_gpios(int enable)
-{
- config_lcdc_gpio_table(lcdc_gpio_table,
- ARRAY_SIZE(lcdc_gpio_table), enable);
-}
-
-static int msm_fb_lcdc_power_save(int on)
-{
- int rc = 0;
- /* Doing the init of the LCDC GPIOs very late as they are from
- an I2C-controlled IO Expander */
- lcdc_toshiba_gpio_init();
-
- if (lcdc_gpio_initialized) {
- gpio_set_value_cansleep(GPIO_DISPLAY_PWR_EN, on);
- gpio_set_value_cansleep(GPIO_BACKLIGHT_EN, on);
-
- rc = on ? regulator_bulk_enable(
- ARRAY_SIZE(regs_lcdc), regs_lcdc) :
- regulator_bulk_disable(
- ARRAY_SIZE(regs_lcdc), regs_lcdc);
-
- if (rc)
- pr_err("%s: could not %sable regulators: %d\n",
- __func__, on ? "en" : "dis", rc);
- }
-
- return rc;
-}
-
-
-static int lcdc_toshiba_set_bl(int level)
-{
- int ret;
-
- ret = pmapp_disp_backlight_set_brightness(level);
- if (ret)
- pr_err("%s: can't set lcd backlight!\n", __func__);
-
- return ret;
-}
-
-
-static struct lcdc_platform_data lcdc_pdata = {
- .lcdc_gpio_config = NULL,
- .lcdc_power_save = msm_fb_lcdc_power_save,
-};
-
-static int lcd_panel_spi_gpio_num[] = {
- GPIO_SPI_MOSI, /* spi_sdi */
- GPIO_SPI_MISO, /* spi_sdoi */
- GPIO_SPI_CLK, /* spi_clk */
- GPIO_SPI_CS0_N, /* spi_cs */
-};
-
-static struct msm_panel_common_pdata lcdc_toshiba_panel_data = {
- .panel_config_gpio = lcdc_toshiba_config_gpios,
- .pmic_backlight = lcdc_toshiba_set_bl,
- .gpio_num = lcd_panel_spi_gpio_num,
-};
-
-static struct platform_device lcdc_toshiba_panel_device = {
- .name = "lcdc_toshiba_fwvga_pt",
- .id = 0,
- .dev = {
- .platform_data = &lcdc_toshiba_panel_data,
- }
-};
-
-static struct resource msm_fb_resources[] = {
- {
- .flags = IORESOURCE_DMA,
- }
-};
-
-#define PANEL_NAME_MAX_LEN 30
-#define LCDC_TOSHIBA_FWVGA_PANEL_NAME "lcdc_toshiba_fwvga_pt"
-#define MIPI_CMD_RENESAS_FWVGA_PANEL_NAME "mipi_cmd_renesas_fwvga"
-
-static int msm_fb_detect_panel(const char *name)
-{
- int ret = -ENODEV;
-
- if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf()) {
- if (!strncmp(name, "lcdc_toshiba_fwvga_pt", 21) ||
- !strncmp(name, "mipi_cmd_renesas_fwvga", 22))
- ret = 0;
- } else if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()) {
- if (!strncmp(name, "mipi_cmd_renesas_fwvga", 22))
- ret = 0;
- }
-
-#if !defined(CONFIG_FB_MSM_LCDC_AUTO_DETECT) && \
- !defined(CONFIG_FB_MSM_MIPI_PANEL_AUTO_DETECT) && \
- !defined(CONFIG_FB_MSM_LCDC_MIPI_PANEL_AUTO_DETECT)
- if (machine_is_msm7x27a_surf() ||
- machine_is_msm7625a_surf()) {
- if (!strncmp(name, LCDC_TOSHIBA_FWVGA_PANEL_NAME,
- strnlen(LCDC_TOSHIBA_FWVGA_PANEL_NAME,
- PANEL_NAME_MAX_LEN)))
- return 0;
- }
-#endif
- return ret;
-}
-
-static struct msm_fb_platform_data msm_fb_pdata = {
- .detect_client = msm_fb_detect_panel,
-};
-
-static struct platform_device msm_fb_device = {
- .name = "msm_fb",
- .id = 0,
- .num_resources = ARRAY_SIZE(msm_fb_resources),
- .resource = msm_fb_resources,
- .dev = {
- .platform_data = &msm_fb_pdata,
- }
-};
-
-#ifdef CONFIG_FB_MSM_MIPI_DSI
-static int mipi_renesas_set_bl(int level)
-{
- int ret;
-
- ret = pmapp_disp_backlight_set_brightness(level);
-
- if (ret)
- pr_err("%s: can't set lcd backlight!\n", __func__);
-
- return ret;
-}
-
-static struct msm_panel_common_pdata mipi_renesas_pdata = {
- .pmic_backlight = mipi_renesas_set_bl,
-};
-
-
-static struct platform_device mipi_dsi_renesas_panel_device = {
- .name = "mipi_renesas",
- .id = 0,
- .dev = {
- .platform_data = &mipi_renesas_pdata,
- }
-};
-#endif
-
#define SND(desc, num) { .name = #desc, .id = num }
static struct snd_endpoint snd_endpoints_list[] = {
SND(HANDSET, 0),
@@ -951,13 +694,8 @@
&android_pmem_audio_device,
&msm_device_snd,
&msm_device_adspdec,
- &msm_fb_device,
- &lcdc_toshiba_panel_device,
&msm_batt_device,
&smsc911x_device,
-#ifdef CONFIG_FB_MSM_MIPI_DSI
- &mipi_dsi_renesas_panel_device,
-#endif
&msm_kgsl_3d0,
#ifdef CONFIG_BT
&msm_bt_power_device,
@@ -983,24 +721,6 @@
}
early_param("pmem_audio_size", pmem_audio_size_setup);
-static void __init msm_msm7x2x_allocate_memory_regions(void)
-{
- void *addr;
- unsigned long size;
-
- if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa())
- fb_size = MSM7x25A_MSM_FB_SIZE;
- else
- fb_size = MSM_FB_SIZE;
-
- size = fb_size;
- addr = alloc_bootmem_align(size, 0x1000);
- msm_fb_resources[0].start = __pa(addr);
- msm_fb_resources[0].end = msm_fb_resources[0].start + size - 1;
- pr_info("allocating %lu bytes at %p (%lx physical) for fb\n",
- size, addr, __pa(addr));
-}
-
static struct memtype_reserve msm7x27a_reserve_table[] __initdata = {
[MEMTYPE_SMI] = {
},
@@ -1074,247 +794,6 @@
msm_gsbi1_qup_i2c_device.dev.platform_data = &msm_gsbi1_qup_i2c_pdata;
}
-static struct msm_panel_common_pdata mdp_pdata = {
- .gpio = 97,
- .mdp_rev = MDP_REV_303,
-};
-
-
-#ifdef CONFIG_FB_MSM
-#define GPIO_LCDC_BRDG_PD 128
-#define GPIO_LCDC_BRDG_RESET_N 129
-
-#define LCDC_RESET_PHYS 0x90008014
-
-static void __iomem *lcdc_reset_ptr;
-
-static unsigned mipi_dsi_gpio[] = {
- GPIO_CFG(GPIO_LCDC_BRDG_RESET_N, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
- GPIO_CFG_2MA), /* LCDC_BRDG_RESET_N */
- GPIO_CFG(GPIO_LCDC_BRDG_PD, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
- GPIO_CFG_2MA), /* LCDC_BRDG_RESET_N */
-};
-
-enum {
- DSI_SINGLE_LANE = 1,
- DSI_TWO_LANES,
-};
-
-static int msm_fb_get_lane_config(void)
-{
- int rc = DSI_TWO_LANES;
-
- if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa()) {
- rc = DSI_SINGLE_LANE;
- pr_info("DSI Single Lane\n");
- } else {
- pr_info("DSI Two Lanes\n");
- }
- return rc;
-}
-
-static int msm_fb_dsi_client_reset(void)
-{
- int rc = 0;
-
- rc = gpio_request(GPIO_LCDC_BRDG_RESET_N, "lcdc_brdg_reset_n");
- if (rc < 0) {
- pr_err("failed to request lcd brdg reset_n\n");
- return rc;
- }
-
- rc = gpio_request(GPIO_LCDC_BRDG_PD, "lcdc_brdg_pd");
- if (rc < 0) {
- pr_err("failed to request lcd brdg pd\n");
- return rc;
- }
-
- rc = gpio_tlmm_config(mipi_dsi_gpio[0], GPIO_CFG_ENABLE);
- if (rc) {
- pr_err("Failed to enable LCDC Bridge reset enable\n");
- goto gpio_error;
- }
-
- rc = gpio_tlmm_config(mipi_dsi_gpio[1], GPIO_CFG_ENABLE);
- if (rc) {
- pr_err("Failed to enable LCDC Bridge pd enable\n");
- goto gpio_error2;
- }
-
- rc = gpio_direction_output(GPIO_LCDC_BRDG_RESET_N, 1);
- rc |= gpio_direction_output(GPIO_LCDC_BRDG_PD, 1);
- gpio_set_value_cansleep(GPIO_LCDC_BRDG_PD, 0);
-
- if (!rc) {
- if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf()) {
- lcdc_reset_ptr = ioremap_nocache(LCDC_RESET_PHYS,
- sizeof(uint32_t));
-
- if (!lcdc_reset_ptr)
- return 0;
- }
- return rc;
- } else {
- goto gpio_error;
- }
-
-gpio_error2:
- pr_err("Failed GPIO bridge pd\n");
- gpio_free(GPIO_LCDC_BRDG_PD);
-
-gpio_error:
- pr_err("Failed GPIO bridge reset\n");
- gpio_free(GPIO_LCDC_BRDG_RESET_N);
- return rc;
-}
-
-static struct regulator_bulk_data regs_dsi[] = {
- { .supply = "gp2", .min_uV = 2850000, .max_uV = 2850000 },
- { .supply = "msme1", .min_uV = 1800000, .max_uV = 1800000 },
-};
-
-static int dsi_gpio_initialized;
-
-static int mipi_dsi_panel_power(int on)
-{
- int rc = 0;
- uint32_t lcdc_reset_cfg;
-
- /* I2C-controlled GPIO Expander -init of the GPIOs very late */
- if (unlikely(!dsi_gpio_initialized)) {
- pmapp_disp_backlight_init();
-
- rc = gpio_request(GPIO_DISPLAY_PWR_EN, "gpio_disp_pwr");
- if (rc < 0) {
- pr_err("failed to request gpio_disp_pwr\n");
- return rc;
- }
-
- if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf()) {
- rc = gpio_direction_output(GPIO_DISPLAY_PWR_EN, 1);
- if (rc < 0) {
- pr_err("failed to enable display pwr\n");
- goto fail_gpio1;
- }
-
- rc = gpio_request(GPIO_BACKLIGHT_EN, "gpio_bkl_en");
- if (rc < 0) {
- pr_err("failed to request gpio_bkl_en\n");
- goto fail_gpio1;
- }
-
- rc = gpio_direction_output(GPIO_BACKLIGHT_EN, 1);
- if (rc < 0) {
- pr_err("failed to enable backlight\n");
- goto fail_gpio2;
- }
- }
-
- rc = regulator_bulk_get(NULL, ARRAY_SIZE(regs_dsi), regs_dsi);
- if (rc) {
- pr_err("%s: could not get regulators: %d\n",
- __func__, rc);
- goto fail_gpio2;
- }
-
- rc = regulator_bulk_set_voltage(ARRAY_SIZE(regs_dsi), regs_dsi);
- if (rc) {
- pr_err("%s: could not set voltages: %d\n",
- __func__, rc);
- goto fail_vreg;
- }
- if (pmapp_disp_backlight_set_brightness(100))
- pr_err("backlight set brightness failed\n");
-
- dsi_gpio_initialized = 1;
- }
-
- if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf()) {
- gpio_set_value_cansleep(GPIO_DISPLAY_PWR_EN, on);
- gpio_set_value_cansleep(GPIO_BACKLIGHT_EN, on);
- } else if (machine_is_msm7x27a_ffa() ||
- machine_is_msm7625a_ffa()) {
- if (on) {
- /* This line drives an active low pin on FFA */
- rc = gpio_direction_output(GPIO_DISPLAY_PWR_EN, !on);
- if (rc < 0)
- pr_err("failed to set direction for "
- "display pwr\n");
- } else {
- gpio_set_value_cansleep(GPIO_DISPLAY_PWR_EN, !on);
- rc = gpio_direction_input(GPIO_DISPLAY_PWR_EN);
- if (rc < 0)
- pr_err("failed to set direction for "
- "display pwr\n");
- }
- }
-
- if (on) {
- gpio_set_value_cansleep(GPIO_LCDC_BRDG_PD, 0);
-
- if (machine_is_msm7x27a_surf() ||
- machine_is_msm7625a_surf()) {
- lcdc_reset_cfg = readl_relaxed(lcdc_reset_ptr);
- rmb();
- lcdc_reset_cfg &= ~1;
-
- writel_relaxed(lcdc_reset_cfg, lcdc_reset_ptr);
- msleep(20);
- wmb();
- lcdc_reset_cfg |= 1;
- writel_relaxed(lcdc_reset_cfg, lcdc_reset_ptr);
- } else {
- gpio_set_value_cansleep(GPIO_LCDC_BRDG_RESET_N, 0);
- msleep(20);
- gpio_set_value_cansleep(GPIO_LCDC_BRDG_RESET_N, 1);
- }
- } else {
- gpio_set_value_cansleep(GPIO_LCDC_BRDG_PD, 1);
-
- if (pmapp_disp_backlight_set_brightness(0))
- pr_err("backlight set brightness failed\n");
- }
-
- rc = on ? regulator_bulk_enable(ARRAY_SIZE(regs_dsi), regs_dsi) :
- regulator_bulk_disable(ARRAY_SIZE(regs_dsi), regs_dsi);
-
- if (rc)
- pr_err("%s: could not %sable regulators: %d\n",
- __func__, on ? "en" : "dis", rc);
-
- return rc;
-
-fail_vreg:
- regulator_bulk_free(ARRAY_SIZE(regs_dsi), regs_dsi);
-fail_gpio2:
- gpio_free(GPIO_BACKLIGHT_EN);
-fail_gpio1:
- gpio_free(GPIO_DISPLAY_PWR_EN);
- dsi_gpio_initialized = 0;
- return rc;
-}
-#endif
-
-#define MDP_303_VSYNC_GPIO 97
-
-#ifdef CONFIG_FB_MSM_MDP303
-static struct mipi_dsi_platform_data mipi_dsi_pdata = {
- .vsync_gpio = MDP_303_VSYNC_GPIO,
- .dsi_power_save = mipi_dsi_panel_power,
- .dsi_client_reset = msm_fb_dsi_client_reset,
- .get_lane_config = msm_fb_get_lane_config,
-};
-#endif
-
-static void __init msm_fb_add_devices(void)
-{
- msm_fb_register_device("mdp", &mdp_pdata);
- msm_fb_register_device("lcdc", &lcdc_pdata);
-#ifdef CONFIG_FB_MSM_MDP303
- msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata);
-#endif
-}
-
#define MSM_EBI2_PHYS 0xa0d00000
#define MSM_EBI2_XMEM_CS2_CFG1 0xa0d10030
@@ -1678,7 +1157,7 @@
static void __init msm7x2x_init_early(void)
{
- msm_msm7x2x_allocate_memory_regions();
+ msm_msm7627a_allocate_memory_regions();
}
MACHINE_START(MSM7X27A_RUMI3, "QCT MSM7x27a RUMI3")
diff --git a/arch/arm/mach-msm/board-qrd7627a.c b/arch/arm/mach-msm/board-qrd7627a.c
index 9d4818a..e3664a4 100644
--- a/arch/arm/mach-msm/board-qrd7627a.c
+++ b/arch/arm/mach-msm/board-qrd7627a.c
@@ -124,13 +124,6 @@
#ifdef CONFIG_ARCH_MSM7X27A
#define MSM_PMEM_MDP_SIZE 0x1DD1000
#define MSM_PMEM_ADSP_SIZE 0x1000000
-
-#ifdef CONFIG_FB_MSM_TRIPLE_BUFFER
-#define MSM_FB_SIZE 0x260000
-#else
-#define MSM_FB_SIZE 0x195000
-#endif
-
#endif
#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_RMI4_I2C) || \
@@ -474,66 +467,6 @@
early_param("pmem_adsp_size", pmem_adsp_size_setup);
-static unsigned fb_size = MSM_FB_SIZE;
-static int __init fb_size_setup(char *p)
-{
- fb_size = memparse(p, NULL);
- return 0;
-}
-
-early_param("fb_size", fb_size_setup);
-
-static struct resource msm_fb_resources[] = {
- {
- .flags = IORESOURCE_DMA,
- }
-};
-
-static int msm_fb_detect_panel(const char *name)
-{
- int ret;
-
- if (!strncmp(name, "mipi_video_truly_wvga", 21))
- ret = 0;
- else
- ret = -ENODEV;
-
- return ret;
-}
-
-static int mipi_truly_set_bl(int on)
-{
- gpio_set_value_cansleep(QRD_GPIO_BACKLIGHT_EN, !!on);
-
- return 1;
-}
-
-static struct msm_fb_platform_data msm_fb_pdata = {
- .detect_client = msm_fb_detect_panel,
-};
-
-static struct platform_device msm_fb_device = {
- .name = "msm_fb",
- .id = 0,
- .num_resources = ARRAY_SIZE(msm_fb_resources),
- .resource = msm_fb_resources,
- .dev = {
- .platform_data = &msm_fb_pdata,
- }
-};
-
-static struct msm_panel_common_pdata mipi_truly_pdata = {
- .pmic_backlight = mipi_truly_set_bl,
-};
-
-static struct platform_device mipi_dsi_truly_panel_device = {
- .name = "mipi_truly",
- .id = 0,
- .dev = {
- .platform_data = &mipi_truly_pdata,
- }
-};
-
#define SND(desc, num) { .name = #desc, .id = num }
static struct snd_endpoint snd_endpoints_list[] = {
SND(HANDSET, 0),
@@ -737,7 +670,6 @@
&android_usb_device,
&android_pmem_device,
&android_pmem_adsp_device,
- &msm_fb_device,
&android_pmem_audio_device,
&msm_device_snd,
&msm_device_adspdec,
@@ -746,7 +678,6 @@
#ifdef CONFIG_BT
&msm_bt_power_device,
#endif
- &mipi_dsi_truly_panel_device,
&msm_wlan_ar6000_pm_device,
&asoc_msm_pcm,
&asoc_msm_dai0,
@@ -769,19 +700,6 @@
}
early_param("pmem_audio_size", pmem_audio_size_setup);
-static void __init msm_msm7627a_allocate_memory_regions(void)
-{
- void *addr;
- unsigned long size;
-
- size = fb_size ? : MSM_FB_SIZE;
- addr = alloc_bootmem_align(size, 0x1000);
- msm_fb_resources[0].start = __pa(addr);
- msm_fb_resources[0].end = msm_fb_resources[0].start + size - 1;
- pr_info("allocating %lu bytes at %p (%lx physical) for fb\n", size,
- addr, __pa(addr));
-}
-
static struct memtype_reserve msm7627a_reserve_table[] __initdata = {
[MEMTYPE_SMI] = {
},
@@ -793,167 +711,6 @@
},
};
-static struct msm_panel_common_pdata mdp_pdata = {
- .gpio = 97,
- .mdp_rev = MDP_REV_303,
-};
-
-#define GPIO_LCDC_BRDG_PD 128
-#define GPIO_LCDC_BRDG_RESET_N 129
-#define GPIO_LCD_DSI_SEL 125
-
-static unsigned mipi_dsi_gpio[] = {
- GPIO_CFG(GPIO_LCDC_BRDG_RESET_N, 0, GPIO_CFG_OUTPUT,
- GPIO_CFG_NO_PULL, GPIO_CFG_2MA), /* LCDC_BRDG_RESET_N */
- GPIO_CFG(GPIO_LCDC_BRDG_PD, 0, GPIO_CFG_OUTPUT,
- GPIO_CFG_NO_PULL, GPIO_CFG_2MA), /* LCDC_BRDG_PD */
-};
-
-static unsigned lcd_dsi_sel_gpio[] = {
- GPIO_CFG(GPIO_LCD_DSI_SEL, 0, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP,
- GPIO_CFG_2MA),
-};
-
-enum {
- DSI_SINGLE_LANE = 1,
- DSI_TWO_LANES,
-};
-
-static int msm_fb_get_lane_config(void)
-{
- pr_info("DSI_TWO_LANES\n");
- return DSI_TWO_LANES;
-}
-
-static int mipi_truly_sel_mode(int video_mode)
-{
- int rc = 0;
-
- rc = gpio_request(GPIO_LCD_DSI_SEL, "lcd_dsi_sel");
- if (rc < 0)
- goto gpio_error;
-
- rc = gpio_tlmm_config(lcd_dsi_sel_gpio[0], GPIO_CFG_ENABLE);
- if (rc)
- goto gpio_error;
-
- rc = gpio_direction_output(GPIO_LCD_DSI_SEL, 1);
- if (!rc) {
- gpio_set_value_cansleep(GPIO_LCD_DSI_SEL, video_mode);
- return rc;
- } else {
- goto gpio_error;
- }
-
-gpio_error:
- pr_err("mipi_truly_sel_mode failed\n");
- gpio_free(GPIO_LCD_DSI_SEL);
- return rc;
-}
-
-static int msm_fb_dsi_client_qrd1_reset(void)
-{
- int rc = 0;
-
- rc = gpio_request(GPIO_LCDC_BRDG_RESET_N, "lcdc_brdg_reset_n");
- if (rc < 0) {
- pr_err("failed to request lcd brdg reset_n\n");
- return rc;
- }
-
- rc = gpio_tlmm_config(mipi_dsi_gpio[0], GPIO_CFG_ENABLE);
- if (rc < 0) {
- pr_err("Failed to enable LCDC Bridge reset enable\n");
- return rc;
- }
-
- rc = gpio_direction_output(GPIO_LCDC_BRDG_RESET_N, 1);
- if (rc < 0) {
- pr_err("Failed GPIO bridge pd\n");
- gpio_free(GPIO_LCDC_BRDG_RESET_N);
- return rc;
- }
-
- mipi_truly_sel_mode(1);
-
- return rc;
-}
-
-static int msm_fb_dsi_client_reset(void)
-{
- int rc = 0;
-
- rc = msm_fb_dsi_client_qrd1_reset();
- return rc;
-}
-
-static int dsi_gpio_initialized;
-
-static int mipi_dsi_panel_qrd1_power(int on)
-{
- int rc = 0;
-
- if (!dsi_gpio_initialized) {
- rc = gpio_request(QRD_GPIO_BACKLIGHT_EN, "gpio_bkl_en");
- if (rc < 0)
- return rc;
-
- rc = gpio_tlmm_config(GPIO_CFG(QRD_GPIO_BACKLIGHT_EN, 0,
- GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
- GPIO_CFG_ENABLE);
- if (rc < 0) {
- pr_err("failed GPIO_BACKLIGHT_EN tlmm config\n");
- return rc;
- }
-
- rc = gpio_direction_output(QRD_GPIO_BACKLIGHT_EN, 1);
- if (rc < 0) {
- pr_err("failed to enable backlight\n");
- gpio_free(QRD_GPIO_BACKLIGHT_EN);
- return rc;
- }
- dsi_gpio_initialized = 1;
- }
-
- gpio_set_value_cansleep(QRD_GPIO_BACKLIGHT_EN, !!on);
-
- if (!on) {
- gpio_set_value_cansleep(GPIO_LCDC_BRDG_RESET_N, 1);
- msleep(20);
- gpio_set_value_cansleep(GPIO_LCDC_BRDG_RESET_N, 0);
- msleep(20);
- gpio_set_value_cansleep(GPIO_LCDC_BRDG_RESET_N, 1);
-
- }
-
- return rc;
-}
-
-static int mipi_dsi_panel_power(int on)
-{
- int rc = 0;
-
- rc = mipi_dsi_panel_qrd1_power(on);
- return rc;
-}
-
-#define MDP_303_VSYNC_GPIO 97
-
-#ifdef CONFIG_FB_MSM_MDP303
-static struct mipi_dsi_platform_data mipi_dsi_pdata = {
- .vsync_gpio = MDP_303_VSYNC_GPIO,
- .dsi_power_save = mipi_dsi_panel_power,
- .dsi_client_reset = msm_fb_dsi_client_reset,
- .get_lane_config = msm_fb_get_lane_config,
-};
-#endif
-
-static void __init msm_fb_add_devices(void)
-{
- msm_fb_register_device("mdp", &mdp_pdata);
- msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata);
-}
-
static void __init size_pmem_devices(void)
{
#ifdef CONFIG_ANDROID_PMEM
diff --git a/arch/arm/mach-msm/footswitch-8x60.c b/arch/arm/mach-msm/footswitch-8x60.c
index 7f63dc8..cd6e582 100644
--- a/arch/arm/mach-msm/footswitch-8x60.c
+++ b/arch/arm/mach-msm/footswitch-8x60.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
@@ -103,7 +103,8 @@
clock->name, clock->rate);
for (clock--; clock >= fs->clk_data; clock--) {
if (clock->enabled)
- clk_disable(clock->clk);
+ clk_disable_unprepare(
+ clock->clk);
clk_set_rate(clock->clk, clock->rate);
}
return rc;
@@ -115,7 +116,7 @@
* we don't try to disable them later and crash due to
* unbalanced calls.
*/
- clock->enabled = !clk_enable(clock->clk);
+ clock->enabled = !clk_prepare_enable(clock->clk);
}
return 0;
@@ -128,7 +129,7 @@
/* Restore clocks to their orignal states before setup_clocks(). */
for (clock = fs->clk_data; clock->clk; clock++) {
if (clock->enabled)
- clk_disable(clock->clk);
+ clk_disable_unprepare(clock->clk);
if (clock->rate && clk_set_rate(clock->clk, clock->rate))
pr_err("Failed to restore %s rate to %lu Hz.\n",
clock->name, clock->rate);
@@ -327,7 +328,7 @@
}
/* Disable core clock. */
- clk_disable(fs->core_clk);
+ clk_disable_unprepare(fs->core_clk);
/*
* (Re-)Assert resets for all clocks in the clock domain, since
@@ -357,7 +358,7 @@
udelay(RESET_DELAY_US);
/* Re-enable core clock. */
- clk_enable(fs->core_clk);
+ clk_prepare_enable(fs->core_clk);
/* Return clocks to their state before this function. */
restore_clocks(fs);
@@ -396,7 +397,7 @@
}
/* Disable core clock. */
- clk_disable(fs->core_clk);
+ clk_disable_unprepare(fs->core_clk);
/*
* Assert resets for all clocks in the clock domain so that
@@ -421,7 +422,7 @@
writel_relaxed(regval, fs->gfs_ctl_reg);
/* Re-enable core clock. */
- clk_enable(fs->core_clk);
+ clk_prepare_enable(fs->core_clk);
/* Return clocks to their state before this function. */
restore_clocks(fs);
diff --git a/arch/arm/mach-msm/footswitch-pcom.c b/arch/arm/mach-msm/footswitch-pcom.c
index 8eec807..c48c141 100644
--- a/arch/arm/mach-msm/footswitch-pcom.c
+++ b/arch/arm/mach-msm/footswitch-pcom.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
@@ -92,10 +92,10 @@
fs->is_rate_set = !!(clk_get_rate(fs->src_clk));
if (!fs->is_rate_set)
clk_set_rate(fs->src_clk, fs->src_clk_init_rate);
- clk_enable(fs->core_clk);
+ clk_prepare_enable(fs->core_clk);
if (fs->ahb_clk)
- clk_enable(fs->ahb_clk);
+ clk_prepare_enable(fs->ahb_clk);
return 0;
}
@@ -103,8 +103,8 @@
static void disable_clocks(struct footswitch *fs)
{
if (fs->ahb_clk)
- clk_disable(fs->ahb_clk);
- clk_disable(fs->core_clk);
+ clk_disable_unprepare(fs->ahb_clk);
+ clk_disable_unprepare(fs->core_clk);
}
static int footswitch_is_enabled(struct regulator_dev *rdev)
diff --git a/arch/arm/mach-msm/qdsp6v2/board-msm8x60-audio.c b/arch/arm/mach-msm/qdsp6v2/board-msm8x60-audio.c
index 51a209d..997fdf8 100644
--- a/arch/arm/mach-msm/qdsp6v2/board-msm8x60-audio.c
+++ b/arch/arm/mach-msm/qdsp6v2/board-msm8x60-audio.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
@@ -2699,7 +2699,10 @@
platform_add_devices(snd_devices_fluid,
ARRAY_SIZE(snd_devices_fluid));
- } else if (machine_is_msm8x60_surf()) {
+ }
+ if (machine_is_msm8x60_surf() || machine_is_msm8x60_ffa()
+ || machine_is_msm8x60_fusion()
+ || machine_is_msm8x60_fusn_ffa()) {
for (i = 0; i < ARRAY_SIZE(snd_devices_ftm); i++)
snd_devices_ftm[i]->id = dev_id++;
diff --git a/arch/arm/mach-msm/qdsp6v2/timpani_profile_8x60.h b/arch/arm/mach-msm/qdsp6v2/timpani_profile_8x60.h
index e747957..7096669 100644
--- a/arch/arm/mach-msm/qdsp6v2/timpani_profile_8x60.h
+++ b/arch/arm/mach-msm/qdsp6v2/timpani_profile_8x60.h
@@ -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
@@ -888,7 +888,7 @@
{ADIE_CODEC_ACTION_ENTRY, ADIE_CODEC_PACK_ENTRY(0x31, 0xFF, 0xC5)}, \
{ADIE_CODEC_ACTION_ENTRY, ADIE_CODEC_PACK_ENTRY(0x4C, 0xFF, 0x29)}, \
{ADIE_CODEC_ACTION_DELAY_WAIT, 0xBB8}, \
- {ADIE_CODEC_ACTION_ENTRY, ADIE_CODEC_PACK_ENTRY(0x31, 0xFF, 0xF5)}, \
+ {ADIE_CODEC_ACTION_ENTRY, ADIE_CODEC_PACK_ENTRY(0x31, 0xFF, 0xC5)}, \
{ADIE_CODEC_ACTION_ENTRY, ADIE_CODEC_PACK_ENTRY(0xE2, 0xFE, 0xAC)}, \
{ADIE_CODEC_ACTION_ENTRY, ADIE_CODEC_PACK_ENTRY(0xE3, 0xFE, 0xAC)}, \
{ADIE_CODEC_ACTION_ENTRY, ADIE_CODEC_PACK_ENTRY(0x3C, 0x27, 0x20)}, \
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 4079850..9c1473f 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -808,6 +808,9 @@
mutex_lock(&dbs_mutex);
mutex_destroy(&this_dbs_info->timer_mutex);
dbs_enable--;
+ /* If device is being removed, policy is no longer
+ * valid. */
+ this_dbs_info->cur_policy = NULL;
if (!cpu)
input_unregister_handler(&dbs_input_handler);
mutex_unlock(&dbs_mutex);
diff --git a/drivers/gpu/msm/kgsl.c b/drivers/gpu/msm/kgsl.c
index 34e83a0..c6e78dd 100644
--- a/drivers/gpu/msm/kgsl.c
+++ b/drivers/gpu/msm/kgsl.c
@@ -1318,8 +1318,7 @@
int sglen = PAGE_ALIGN(size) / PAGE_SIZE;
unsigned long paddr = (unsigned long) addr;
- memdesc->sg = kmalloc(sglen * sizeof(struct scatterlist),
- GFP_KERNEL);
+ memdesc->sg = vmalloc(sglen * sizeof(struct scatterlist));
if (memdesc->sg == NULL)
return -ENOMEM;
@@ -1359,7 +1358,7 @@
err:
spin_unlock(¤t->mm->page_table_lock);
- kfree(memdesc->sg);
+ vfree(memdesc->sg);
memdesc->sg = NULL;
return -EINVAL;
diff --git a/drivers/gpu/msm/kgsl_sharedmem.c b/drivers/gpu/msm/kgsl_sharedmem.c
index ec91b39..7211879 100644
--- a/drivers/gpu/msm/kgsl_sharedmem.c
+++ b/drivers/gpu/msm/kgsl_sharedmem.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2002,2007-2011, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2002,2007-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
@@ -421,7 +421,7 @@
memdesc->ops = &kgsl_vmalloc_ops;
memdesc->hostptr = (void *) ptr;
- memdesc->sg = kmalloc(sglen * sizeof(struct scatterlist), GFP_KERNEL);
+ memdesc->sg = vmalloc(sglen * sizeof(struct scatterlist));
if (memdesc->sg == NULL) {
ret = -ENOMEM;
goto done;
@@ -554,7 +554,7 @@
if (memdesc->ops && memdesc->ops->free)
memdesc->ops->free(memdesc);
- kfree(memdesc->sg);
+ vfree(memdesc->sg);
memset(memdesc, 0, sizeof(*memdesc));
}
diff --git a/drivers/gpu/msm/kgsl_sharedmem.h b/drivers/gpu/msm/kgsl_sharedmem.h
index d345ff3..67a1c2d 100644
--- a/drivers/gpu/msm/kgsl_sharedmem.h
+++ b/drivers/gpu/msm/kgsl_sharedmem.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2002,2007-2011, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2002,2007-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
@@ -15,6 +15,7 @@
#include <linux/slab.h>
#include <linux/dma-mapping.h>
+#include <linux/vmalloc.h>
#include "kgsl_mmu.h"
struct kgsl_device;
@@ -81,7 +82,7 @@
{
struct page *page = phys_to_page(physaddr);
- memdesc->sg = kmalloc(sizeof(struct scatterlist) * 1, GFP_KERNEL);
+ memdesc->sg = vmalloc(sizeof(struct scatterlist) * 1);
if (memdesc->sg == NULL)
return -ENOMEM;
diff --git a/sound/soc/codecs/wcd9310.c b/sound/soc/codecs/wcd9310.c
index cec01f1..8de9dec 100644
--- a/sound/soc/codecs/wcd9310.c
+++ b/sound/soc/codecs/wcd9310.c
@@ -2640,6 +2640,7 @@
{
struct tabla_priv *tabla = snd_soc_codec_get_drvdata(codec);
+ pr_debug("%s: enable = %d\n", __func__, enable);
if (enable) {
snd_soc_update_bits(codec, TABLA_A_CONFIG_MODE_FREQ, 0x10, 0);
snd_soc_write(codec, TABLA_A_BIAS_CONFIG_MODE_BG_CTL, 0x17);
@@ -2656,6 +2657,7 @@
snd_soc_update_bits(codec, TABLA_A_BIAS_CONFIG_MODE_BG_CTL, 0x1,
0);
snd_soc_update_bits(codec, TABLA_A_CONFIG_MODE_FREQ, 0x80, 0);
+ snd_soc_update_bits(codec, TABLA_A_CLK_BUFF_EN1, 0x08, 0x00);
}
tabla->config_mode_active = enable ? true : false;
@@ -2667,7 +2669,7 @@
{
struct tabla_priv *tabla = snd_soc_codec_get_drvdata(codec);
- pr_debug("%s\n", __func__);
+ pr_debug("%s: config_mode = %d\n", __func__, config_mode);
if (config_mode) {
tabla_codec_enable_config_mode(codec, 1);