Merge changes Idca5ac07,Ifc85b131,I0a7a113f,I5087584a,I40360498 into msm-3.4
* changes:
msm_serial_hs_lite: Unconditionally control UART AHB clock
arm/dt: msm8974: Disable simulation UARTs by default
msm: clock-8974: Remove support for mmss_mmssnoc_ahb_clk
msm: clock-8974: Enable GPLL0's AUX2 output for acpuclock
msm: clock-8974: Don't program an N value of zero
diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
index 2cf05d8..f026a94 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -317,7 +317,7 @@
select CPU_V7
select MSM_GPIOMUX
select MULTI_IRQ_HANDLER
- select GPIO_MSM_V2
+ select GPIO_MSM_V3
endmenu
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index ce19336..5e3a980 100644
--- a/arch/arm/mach-msm/Makefile
+++ b/arch/arm/mach-msm/Makefile
@@ -287,7 +287,7 @@
obj-$(CONFIG_MACH_MPQ8064_DTV) += board-8064-all.o board-8064-regulator.o
obj-$(CONFIG_ARCH_MSM9615) += board-9615.o devices-9615.o board-9615-regulator.o board-9615-gpiomux.o board-9615-storage.o board-9615-display.o
obj-$(CONFIG_ARCH_MSM9615) += clock-local.o clock-9615.o acpuclock-9615.o clock-rpm.o clock-pll.o
-obj-$(CONFIG_ARCH_MSM8974) += board-8974.o board-dt.o board-8974-regulator.o board-8974-gpiomux.o
+obj-$(CONFIG_ARCH_MSM8974) += board-8974.o board-dt.o board-8974-gpiomux.o
obj-$(CONFIG_ARCH_MSM8974) += acpuclock-8974.o
obj-$(CONFIG_ARCH_MSM8974) += clock-local2.o clock-pll.o clock-8974.o clock-rpm.o clock-voter.o
obj-$(CONFIG_ARCH_MSM8974) += gdsc.o
diff --git a/arch/arm/mach-msm/board-8930.c b/arch/arm/mach-msm/board-8930.c
index b20c876..0678461 100644
--- a/arch/arm/mach-msm/board-8930.c
+++ b/arch/arm/mach-msm/board-8930.c
@@ -2609,7 +2609,12 @@
msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
msm_spm_l2_init(msm_spm_l2_data);
msm8930_init_buses();
- platform_add_devices(msm8930_footswitch, msm8930_num_footswitch);
+ if (cpu_is_msm8627())
+ platform_add_devices(msm8627_footswitch,
+ msm8627_num_footswitch);
+ else
+ platform_add_devices(msm8930_footswitch,
+ msm8930_num_footswitch);
if (cpu_is_msm8627())
platform_device_register(&msm8627_device_acpuclk);
else if (cpu_is_msm8930())
diff --git a/arch/arm/mach-msm/board-8974-regulator.c b/arch/arm/mach-msm/board-8974-regulator.c
deleted file mode 100644
index 1a41f09..0000000
--- a/arch/arm/mach-msm/board-8974-regulator.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * 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/platform_device.h>
-#include <linux/regulator/stub-regulator.h>
-
-#define VREG_CONSUMERS(_name) \
- static struct regulator_consumer_supply vreg_consumers_##_name[]
-
-/*
- * Consumer specific regulator names:
- * regulator name consumer dev_name
- */
-VREG_CONSUMERS(K0) = {
- REGULATOR_SUPPLY("krait0", "f9000000.qcom,acpuclk"),
-};
-VREG_CONSUMERS(K1) = {
- REGULATOR_SUPPLY("krait1", "f9000000.qcom,acpuclk"),
-};
-VREG_CONSUMERS(K2) = {
- REGULATOR_SUPPLY("krait2", "f9000000.qcom,acpuclk"),
-};
-VREG_CONSUMERS(K3) = {
- REGULATOR_SUPPLY("krait3", "f9000000.qcom,acpuclk"),
-};
-
-#define PM8X41_VREG_INIT(_id, _name, _min_uV, _max_uV, _modes, _ops, \
- _always_on, _supply_regulator, _hpm_min, _system_uA) \
- struct stub_regulator_pdata vreg_dev_##_id##_pdata __devinitdata = { \
- .init_data = { \
- .constraints = { \
- .valid_modes_mask = _modes, \
- .valid_ops_mask = _ops, \
- .min_uV = _min_uV, \
- .max_uV = _max_uV, \
- .input_uV = _max_uV, \
- .apply_uV = 0, \
- .always_on = _always_on, \
- .name = _name, \
- }, \
- .num_consumer_supplies = \
- ARRAY_SIZE(vreg_consumers_##_id), \
- .consumer_supplies = vreg_consumers_##_id, \
- .supply_regulator = _supply_regulator, \
- }, \
- .hpm_min_load = _hpm_min, \
- .system_uA = _system_uA, \
- }
-
-#define KRAIT_PWR(_id, _name, _always_on, _min_uV, _max_uV, \
- _supply_regulator, _hpm_min, _system_uA) \
- PM8X41_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
- | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \
- REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
- REGULATOR_CHANGE_DRMS, _always_on, \
- _supply_regulator, _hpm_min, _system_uA)
-
-/* ID name a_on min_uV max_uV supply hpm_min sys_uA */
-KRAIT_PWR(K0, "krait0", 0, 850000, 1100000, NULL, 100000, 0);
-KRAIT_PWR(K1, "krait1", 0, 850000, 1100000, NULL, 100000, 0);
-KRAIT_PWR(K2, "krait2", 0, 850000, 1100000, NULL, 100000, 0);
-KRAIT_PWR(K3, "krait3", 0, 850000, 1100000, NULL, 100000, 0);
-
-#define VREG_DEVICE(_name, _devid) \
- static struct platform_device vreg_device_##_name __devinitdata = \
- { \
- .name = STUB_REGULATOR_DRIVER_NAME, \
- .id = _devid, \
- .dev = { .platform_data = &vreg_dev_##_name##_pdata }, \
- }
-
-VREG_DEVICE(K0, 0);
-VREG_DEVICE(K1, 1);
-VREG_DEVICE(K2, 2);
-VREG_DEVICE(K3, 3);
-
-struct platform_device *msm_8974_stub_regulator_devices[] __devinitdata = {
- &vreg_device_K0,
- &vreg_device_K1,
- &vreg_device_K2,
- &vreg_device_K3,
-};
-
-int msm_8974_stub_regulator_devices_len __devinitdata =
- ARRAY_SIZE(msm_8974_stub_regulator_devices);
diff --git a/arch/arm/mach-msm/board-8974.c b/arch/arm/mach-msm/board-8974.c
index a44d67b..1049bcb 100644
--- a/arch/arm/mach-msm/board-8974.c
+++ b/arch/arm/mach-msm/board-8974.c
@@ -24,8 +24,8 @@
#ifdef CONFIG_ANDROID_PMEM
#include <linux/android_pmem.h>
#endif
-#include <linux/regulator/stub-regulator.h>
#include <linux/regulator/machine.h>
+#include <linux/regulator/krait-regulator.h>
#include <asm/mach/map.h>
#include <asm/hardware/gic.h>
#include <mach/board.h>
@@ -412,8 +412,6 @@
{
platform_device_register(&msm_device_smd_8974);
platform_device_register(&android_usb_device);
- platform_add_devices(msm_8974_stub_regulator_devices,
- msm_8974_stub_regulator_devices_len);
}
/*
@@ -430,7 +428,7 @@
msm_lpmrs_module_init();
rpm_regulator_smd_driver_init();
msm_spm_device_init();
- regulator_stub_init();
+ krait_power_init();
if (machine_is_msm8974_rumi())
msm_clock_init(&msm8974_rumi_clock_init_data);
else
diff --git a/arch/arm/mach-msm/devices-8930.c b/arch/arm/mach-msm/devices-8930.c
index fa24ba9..eac2140 100644
--- a/arch/arm/mach-msm/devices-8930.c
+++ b/arch/arm/mach-msm/devices-8930.c
@@ -416,7 +416,7 @@
.bus_port0 = MSM_BUS_MASTER_JPEG_ENC,
};
-static struct fs_driver_data mdp_fs_data = {
+static struct fs_driver_data mdp_fs_data_8930 = {
.clks = (struct fs_clk_data[]){
{ .name = "core_clk" },
{ .name = "iface_clk" },
@@ -432,6 +432,20 @@
.bus_port1 = MSM_BUS_MASTER_MDP_PORT1,
};
+static struct fs_driver_data mdp_fs_data_8627 = {
+ .clks = (struct fs_clk_data[]){
+ { .name = "core_clk" },
+ { .name = "iface_clk" },
+ { .name = "bus_clk" },
+ { .name = "vsync_clk" },
+ { .name = "lut_clk" },
+ { .name = "reset1_clk" },
+ { 0 }
+ },
+ .bus_port0 = MSM_BUS_MASTER_MDP_PORT0,
+ .bus_port1 = MSM_BUS_MASTER_MDP_PORT1,
+};
+
static struct fs_driver_data rot_fs_data = {
.clks = (struct fs_clk_data[]){
{ .name = "core_clk" },
@@ -474,7 +488,7 @@
};
struct platform_device *msm8930_footswitch[] __initdata = {
- FS_8X60(FS_MDP, "vdd", "mdp.0", &mdp_fs_data),
+ FS_8X60(FS_MDP, "vdd", "mdp.0", &mdp_fs_data_8930),
FS_8X60(FS_ROT, "vdd", "msm_rotator.0", &rot_fs_data),
FS_8X60(FS_IJPEG, "vdd", "msm_gemini.0", &ijpeg_fs_data),
FS_8X60(FS_VFE, "vdd", "msm_vfe.0", &vfe_fs_data),
@@ -484,6 +498,17 @@
};
unsigned msm8930_num_footswitch __initdata = ARRAY_SIZE(msm8930_footswitch);
+struct platform_device *msm8627_footswitch[] __initdata = {
+ FS_8X60(FS_MDP, "vdd", "mdp.0", &mdp_fs_data_8627),
+ FS_8X60(FS_ROT, "vdd", "msm_rotator.0", &rot_fs_data),
+ FS_8X60(FS_IJPEG, "vdd", "msm_gemini.0", &ijpeg_fs_data),
+ FS_8X60(FS_VFE, "vdd", "msm_vfe.0", &vfe_fs_data),
+ FS_8X60(FS_VPE, "vdd", "msm_vpe.0", &vpe_fs_data),
+ FS_8X60(FS_GFX3D, "vdd", "kgsl-3d0.0", &gfx3d_fs_data),
+ FS_8X60(FS_VED, "vdd", "msm_vidc.0", &ved_fs_data),
+};
+unsigned msm8627_num_footswitch __initdata = ARRAY_SIZE(msm8627_footswitch);
+
/* MSM Video core device */
#ifdef CONFIG_MSM_BUS_SCALING
static struct msm_bus_vectors vidc_init_vectors[] = {
diff --git a/arch/arm/mach-msm/devices.h b/arch/arm/mach-msm/devices.h
index bc60df2..84fe195 100644
--- a/arch/arm/mach-msm/devices.h
+++ b/arch/arm/mach-msm/devices.h
@@ -294,6 +294,8 @@
extern unsigned apq8064_num_footswitch;
extern struct platform_device *msm8930_footswitch[];
extern unsigned msm8930_num_footswitch;
+extern struct platform_device *msm8627_footswitch[];
+extern unsigned msm8627_num_footswitch;
extern struct platform_device fsm_qfp_fuse_device;
diff --git a/arch/arm/mach-msm/include/mach/sps.h b/arch/arm/mach-msm/include/mach/sps.h
index 70f91f3..edc4b39 100644
--- a/arch/arm/mach-msm/include/mach/sps.h
+++ b/arch/arm/mach-msm/include/mach/sps.h
@@ -59,6 +59,9 @@
#define SPS_IOVEC_FLAG_NO_SUBMIT 0x0002 /* Do not submit descriptor to HW */
#define SPS_IOVEC_FLAG_DEFAULT 0x0001 /* Use driver default */
+/* Maximum descriptor/iovec size */
+#define SPS_IOVEC_MAX_SIZE (32 * 1024 - 1) /* 32K-1 bytes due to HW limit */
+
/* BAM device options flags */
/*
diff --git a/drivers/platform/msm/sps/sps.c b/drivers/platform/msm/sps/sps.c
index a7f07a6..656d1fb 100644
--- a/drivers/platform/msm/sps/sps.c
+++ b/drivers/platform/msm/sps/sps.c
@@ -1191,6 +1191,49 @@
EXPORT_SYMBOL(sps_flow_off);
/**
+ * Check if the flags on a descriptor/iovec are valid
+ *
+ * @flags - flags on a descriptor/iovec
+ *
+ * @return 0 on success, negative value on error
+ *
+ */
+static int sps_check_iovec_flags(u32 flags)
+{
+ if ((flags & SPS_IOVEC_FLAG_NWD) &&
+ !(flags & (SPS_IOVEC_FLAG_EOT | SPS_IOVEC_FLAG_CMD))) {
+ SPS_ERR("sps:NWD is only valid with EOT or CMD.\n");
+ return SPS_ERROR;
+ } else if ((flags & SPS_IOVEC_FLAG_EOT) &&
+ (flags & SPS_IOVEC_FLAG_CMD)) {
+ SPS_ERR("sps:EOT and CMD are not allowed to coexist.\n");
+ return SPS_ERROR;
+ } else if (!(flags & SPS_IOVEC_FLAG_CMD) &&
+ (flags & (SPS_IOVEC_FLAG_LOCK | SPS_IOVEC_FLAG_UNLOCK))) {
+ static char err_msg[] =
+ "pipe lock/unlock flags are only valid with Command Descriptor";
+ SPS_ERR("sps:%s.\n", err_msg);
+ return SPS_ERROR;
+ } else if ((flags & SPS_IOVEC_FLAG_LOCK) &&
+ (flags & SPS_IOVEC_FLAG_UNLOCK)) {
+ static char err_msg[] =
+ "Can't lock and unlock a pipe by the same Command Descriptor";
+ SPS_ERR("sps:%s.\n", err_msg);
+ return SPS_ERROR;
+ } else if ((flags & SPS_IOVEC_FLAG_IMME) &&
+ (flags & SPS_IOVEC_FLAG_CMD)) {
+ SPS_ERR("sps:Immediate and CMD are not allowed to coexist.\n");
+ return SPS_ERROR;
+ } else if ((flags & SPS_IOVEC_FLAG_IMME) &&
+ (flags & SPS_IOVEC_FLAG_NWD)) {
+ SPS_ERR("sps:Immediate and NWD are not allowed to coexist.\n");
+ return SPS_ERROR;
+ }
+
+ return 0;
+}
+
+/**
* Perform a DMA transfer on an SPS connection end point
*
*/
@@ -1199,6 +1242,8 @@
struct sps_pipe *pipe = h;
struct sps_bam *bam;
int result;
+ struct sps_iovec *iovec;
+ int i;
SPS_DBG("sps:%s.", __func__);
@@ -1208,6 +1253,34 @@
} else if (transfer == NULL) {
SPS_ERR("sps:%s:transfer is NULL.\n", __func__);
return SPS_ERROR;
+ } else if (transfer->iovec == NULL) {
+ SPS_ERR("sps:%s:iovec list is NULL.\n", __func__);
+ return SPS_ERROR;
+ } else if (transfer->iovec_count == 0) {
+ SPS_ERR("sps:%s:iovec list is empty.\n", __func__);
+ return SPS_ERROR;
+ } else if (transfer->iovec_phys == 0) {
+ SPS_ERR("sps:%s:iovec list address is invalid.\n", __func__);
+ return SPS_ERROR;
+ }
+
+ /* Verify content of IOVECs */
+ iovec = transfer->iovec;
+ for (i = 0; i < transfer->iovec_count; i++) {
+ u32 flags = iovec->flags;
+
+ if (iovec->addr == 0) {
+ SPS_ERR("sps:%s:iovec address is invalid.\n", __func__);
+ return SPS_ERROR;
+ } else if (iovec->size > SPS_IOVEC_MAX_SIZE) {
+ SPS_ERR("sps:%s:iovec size is invalid.\n", __func__);
+ return SPS_ERROR;
+ }
+
+ if (sps_check_iovec_flags(flags))
+ return SPS_ERROR;
+
+ iovec++;
}
bam = sps_bam_lock(pipe);
@@ -1240,33 +1313,8 @@
return SPS_ERROR;
}
- if ((flags & SPS_IOVEC_FLAG_NWD) &&
- !(flags & (SPS_IOVEC_FLAG_EOT | SPS_IOVEC_FLAG_CMD))) {
- SPS_ERR("sps:NWD is only valid with EOT or CMD.\n");
+ if (sps_check_iovec_flags(flags))
return SPS_ERROR;
- } else if ((flags & SPS_IOVEC_FLAG_EOT) &&
- (flags & SPS_IOVEC_FLAG_CMD)) {
- SPS_ERR("sps:EOT and CMD are not allowed to coexist.\n");
- return SPS_ERROR;
- } else if (!(flags & SPS_IOVEC_FLAG_CMD) &&
- (flags & (SPS_IOVEC_FLAG_LOCK | SPS_IOVEC_FLAG_UNLOCK))) {
- SPS_ERR("sps:pipe lock and unlock flags are only valid with "
- "Command Descriptor.\n");
- return SPS_ERROR;
- } else if ((flags & SPS_IOVEC_FLAG_LOCK) &&
- (flags & SPS_IOVEC_FLAG_UNLOCK)) {
- SPS_ERR("sps:Can't lock and unlock a pipe by the same"
- "Command Descriptor.\n");
- return SPS_ERROR;
- } else if ((flags & SPS_IOVEC_FLAG_IMME) &&
- (flags & SPS_IOVEC_FLAG_CMD)) {
- SPS_ERR("sps:Immediate and CMD are not allowed to coexist.\n");
- return SPS_ERROR;
- } else if ((flags & SPS_IOVEC_FLAG_IMME) &&
- (flags & SPS_IOVEC_FLAG_NWD)) {
- SPS_ERR("sps:Immediate and NWD are not allowed to coexist.\n");
- return SPS_ERROR;
- }
bam = sps_bam_lock(pipe);
if (bam == NULL)