Merge "PM / Sleep: Add wakeup_source_activate and wakeup_source_deactivate tracepoints"
diff --git a/Documentation/devicetree/bindings/platform/msm/qpnp-revid.txt b/Documentation/devicetree/bindings/platform/msm/qpnp-revid.txt
new file mode 100644
index 0000000..93312df
--- /dev/null
+++ b/Documentation/devicetree/bindings/platform/msm/qpnp-revid.txt
@@ -0,0 +1,13 @@
+QPNP-REVID
+
+QPNP-REVID provides a way to read the PMIC part number and revision.
+
+Required properties:
+- compatible : should be "qcom,qpnp-revid"
+- reg : offset and length of the PMIC peripheral register map.
+
+Example:
+ qcom,revid@100 {
+ compatible = "qcom,qpnp-revid";
+ reg = <0x100 0x100>;
+ };
diff --git a/arch/arm/boot/dts/msm-pm8226.dtsi b/arch/arm/boot/dts/msm-pm8226.dtsi
index 44ece9e..b996766 100644
--- a/arch/arm/boot/dts/msm-pm8226.dtsi
+++ b/arch/arm/boot/dts/msm-pm8226.dtsi
@@ -318,6 +318,23 @@
qcom,fast-avg-setup = <0>;
};
};
+
+ qcom,pm8226_rtc {
+ spmi-dev-container;
+ compatible = "qcom,qpnp-rtc";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ qcom,qpnp-rtc-write = <0>;
+ qcom,qpnp-rtc-alarm-pwrup = <0>;
+
+ qcom,pm8226_rtc_rw@6000 {
+ reg = <0x6000 0x100>;
+ };
+ qcom,pm8226_rtc_alarm@6100 {
+ reg = <0x6100 0x100>;
+ interrupts = <0x0 0x61 0x1>;
+ };
+ };
};
qcom,pm8226@1 {
diff --git a/arch/arm/boot/dts/msm-pm8841.dtsi b/arch/arm/boot/dts/msm-pm8841.dtsi
index 68691c7..a2d80ec 100644
--- a/arch/arm/boot/dts/msm-pm8841.dtsi
+++ b/arch/arm/boot/dts/msm-pm8841.dtsi
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2013, The Linux Foundation. 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
@@ -22,6 +22,11 @@
#address-cells = <1>;
#size-cells = <1>;
+ qcom,qpnp-revid@100 {
+ compatible = "qcom,qpnp-revid";
+ reg = <0x100 0x100>;
+ };
+
qcom,temp-alarm@2400 {
compatible = "qcom,qpnp-temp-alarm";
reg = <0x2400 0x100>;
diff --git a/arch/arm/boot/dts/msm-pm8941.dtsi b/arch/arm/boot/dts/msm-pm8941.dtsi
index 892afbb..28ca985 100644
--- a/arch/arm/boot/dts/msm-pm8941.dtsi
+++ b/arch/arm/boot/dts/msm-pm8941.dtsi
@@ -22,6 +22,11 @@
#address-cells = <1>;
#size-cells = <1>;
+ qcom,revid@100 {
+ compatible = "qcom,qpnp-revid";
+ reg = <0x100 0x100>;
+ };
+
qcom,temp-alarm@2400 {
compatible = "qcom,qpnp-temp-alarm";
reg = <0x2400 0x100>;
diff --git a/arch/arm/boot/dts/msm8226-cdp.dts b/arch/arm/boot/dts/msm8226-cdp.dts
index eaf7d84..5cb68e5 100644
--- a/arch/arm/boot/dts/msm8226-cdp.dts
+++ b/arch/arm/boot/dts/msm8226-cdp.dts
@@ -37,6 +37,38 @@
synaptics,reg-en;
};
};
+
+ gpio_keys {
+ compatible = "gpio-keys";
+ input-name = "gpio-keys";
+
+ camera_focus {
+ label = "camera_focus";
+ gpios = <&msmgpio 108 0x1>;
+ linux,input-type = <1>;
+ linux,code = <0x210>;
+ gpio-key,wakeup;
+ debounce-interval = <15>;
+ };
+
+ camera_snapshot {
+ label = "camera_snapshot";
+ gpios = <&msmgpio 107 0x1>;
+ linux,input-type = <1>;
+ linux,code = <0x2fe>;
+ gpio-key,wakeup;
+ debounce-interval = <15>;
+ };
+
+ vol_up {
+ label = "volume_up";
+ gpios = <&msmgpio 106 0x1>;
+ linux,input-type = <1>;
+ linux,code = <115>;
+ gpio-key,wakeup;
+ debounce-interval = <15>;
+ };
+ };
};
&sdcc1 {
diff --git a/arch/arm/boot/dts/msm8226-iommu.dtsi b/arch/arm/boot/dts/msm8226-iommu.dtsi
index 20e1444..bddafc9 100644
--- a/arch/arm/boot/dts/msm8226-iommu.dtsi
+++ b/arch/arm/boot/dts/msm8226-iommu.dtsi
@@ -50,8 +50,6 @@
&mdp_iommu {
status = "ok";
- /* HACK: set to -1 during pre-si due to lack of TZ */
- qcom,iommu-secure-id = <0xFFFFFFFF>;
qcom,iommu-bfb-regs = <0x204c
0x2050
@@ -94,8 +92,6 @@
&venus_iommu {
status = "ok";
- /* HACK: set to -1 during pre-si due to lack of TZ */
- qcom,iommu-secure-id = <0xFFFFFFFF>;
qcom,iommu-bfb-regs = <0x204c
0x2050
diff --git a/arch/arm/boot/dts/msm8226-mtp.dts b/arch/arm/boot/dts/msm8226-mtp.dts
index 7ef3360..07441d8 100644
--- a/arch/arm/boot/dts/msm8226-mtp.dts
+++ b/arch/arm/boot/dts/msm8226-mtp.dts
@@ -37,6 +37,38 @@
synaptics,reg-en;
};
};
+
+ gpio_keys {
+ compatible = "gpio-keys";
+ input-name = "gpio-keys";
+
+ camera_focus {
+ label = "camera_focus";
+ gpios = <&msmgpio 108 0x1>;
+ linux,input-type = <1>;
+ linux,code = <0x210>;
+ gpio-key,wakeup;
+ debounce-interval = <15>;
+ };
+
+ camera_snapshot {
+ label = "camera_snapshot";
+ gpios = <&msmgpio 107 0x1>;
+ linux,input-type = <1>;
+ linux,code = <0x2fe>;
+ gpio-key,wakeup;
+ debounce-interval = <15>;
+ };
+
+ vol_up {
+ label = "volume_up";
+ gpios = <&msmgpio 106 0x1>;
+ linux,input-type = <1>;
+ linux,code = <115>;
+ gpio-key,wakeup;
+ debounce-interval = <15>;
+ };
+ };
};
&sdcc1 {
diff --git a/arch/arm/boot/dts/msm8226-qrd.dts b/arch/arm/boot/dts/msm8226-qrd.dts
index acc44b6..cdb2680 100644
--- a/arch/arm/boot/dts/msm8226-qrd.dts
+++ b/arch/arm/boot/dts/msm8226-qrd.dts
@@ -37,6 +37,38 @@
synaptics,reg-en;
};
};
+
+ gpio_keys {
+ compatible = "gpio-keys";
+ input-name = "gpio-keys";
+
+ camera_focus {
+ label = "camera_focus";
+ gpios = <&msmgpio 108 0x1>;
+ linux,input-type = <1>;
+ linux,code = <0x210>;
+ gpio-key,wakeup;
+ debounce-interval = <15>;
+ };
+
+ camera_snapshot {
+ label = "camera_snapshot";
+ gpios = <&msmgpio 107 0x1>;
+ linux,input-type = <1>;
+ linux,code = <0x2fe>;
+ gpio-key,wakeup;
+ debounce-interval = <15>;
+ };
+
+ vol_up {
+ label = "volume_up";
+ gpios = <&msmgpio 106 0x1>;
+ linux,input-type = <1>;
+ linux,code = <115>;
+ gpio-key,wakeup;
+ debounce-interval = <15>;
+ };
+ };
};
&sdcc1 {
diff --git a/arch/arm/boot/dts/msm8974-v1-fluid.dts b/arch/arm/boot/dts/msm8974-v1-fluid.dts
index 60f2c4b..683fe18 100644
--- a/arch/arm/boot/dts/msm8974-v1-fluid.dts
+++ b/arch/arm/boot/dts/msm8974-v1-fluid.dts
@@ -24,3 +24,7 @@
qcom,cont-splash-enabled;
};
};
+
+&pm8941_chg {
+ qcom,chg-charging-disabled;
+};
diff --git a/arch/arm/boot/dts/msm8974-v1-mtp.dts b/arch/arm/boot/dts/msm8974-v1-mtp.dts
index 2d52f78..0e5d2ae 100644
--- a/arch/arm/boot/dts/msm8974-v1-mtp.dts
+++ b/arch/arm/boot/dts/msm8974-v1-mtp.dts
@@ -24,3 +24,7 @@
qcom,cont-splash-enabled;
};
};
+
+&pm8941_chg {
+ qcom,chg-charging-disabled;
+};
diff --git a/arch/arm/boot/dts/msm8974-v2-cdp.dts b/arch/arm/boot/dts/msm8974-v2-cdp.dts
index 58e172f..319debe 100644
--- a/arch/arm/boot/dts/msm8974-v2-cdp.dts
+++ b/arch/arm/boot/dts/msm8974-v2-cdp.dts
@@ -20,3 +20,16 @@
compatible = "qcom,msm8974-cdp", "qcom,msm8974";
qcom,msm-id = <126 1 0x20000>;
};
+
+&usb3 {
+ #address-cells = <0>;
+ interrupt-parent = <&usb3>;
+ interrupts = <0 1 2 3>;
+ #interrupt-cells = <1>;
+ interrupt-map-mask = <0xffffffff>;
+ interrupt-map = <0 &intc 0 131 0
+ 1 &intc 0 179 0
+ 2 &intc 0 133 0
+ 3 &spmi_bus 0x0 0x0 0x9 0x0>;
+ interrupt-names = "irq", "otg_irq", "hs_phy_irq", "pmic_id_irq";
+};
diff --git a/arch/arm/boot/dts/msm8974.dtsi b/arch/arm/boot/dts/msm8974.dtsi
index d636b7f..99886c7 100644
--- a/arch/arm/boot/dts/msm8974.dtsi
+++ b/arch/arm/boot/dts/msm8974.dtsi
@@ -351,6 +351,20 @@
interrupt-names = "hc_irq", "pwr_irq";
qcom,bus-speed-mode = "HS200_1p8v", "DDR_1p8v";
qcom,cpu-dma-latency-us = <200>;
+
+ qcom,msm-bus,name = "sdhc1";
+ qcom,msm-bus,num-cases = <8>;
+ qcom,msm-bus,active-only = <0>;
+ qcom,msm-bus,num-paths = <1>;
+ qcom,msm-bus,vectors-KBps = <78 512 0 0>, /* No vote */
+ <78 512 1600 3200>, /* 400 KB/s*/
+ <78 512 80000 160000>, /* 20 MB/s */
+ <78 512 100000 200000>, /* 25 MB/s */
+ <78 512 200000 400000>, /* 50 MB/s */
+ <78 512 400000 800000>, /* 100 MB/s */
+ <78 512 800000 1600000>, /* 200 MB/s */
+ <78 512 2048000 4096000>; /* Max. bandwidth */
+ qcom,bus-bw-vectors-bps = <0 400000 20000000 25000000 50000000 100000000 200000000 4294967295>;
status = "disable";
};
@@ -363,6 +377,20 @@
qcom,bus-width = <4>;
qcom,cpu-dma-latency-us = <200>;
+
+ qcom,msm-bus,name = "sdhc2";
+ qcom,msm-bus,num-cases = <8>;
+ qcom,msm-bus,active-only = <0>;
+ qcom,msm-bus,num-paths = <1>;
+ qcom,msm-bus,vectors-KBps = <81 512 0 0>, /* No vote */
+ <81 512 1600 3200>, /* 400 KB/s*/
+ <81 512 80000 160000>, /* 20 MB/s */
+ <81 512 100000 200000>, /* 25 MB/s */
+ <81 512 200000 400000>, /* 50 MB/s */
+ <81 512 400000 800000>, /* 100 MB/s */
+ <81 512 800000 1600000>, /* 200 MB/s */
+ <81 512 2048000 4096000>; /* Max. bandwidth */
+ qcom,bus-bw-vectors-bps = <0 400000 20000000 25000000 50000000 100000000 200000000 4294967295>;
status = "disable";
};
@@ -382,6 +410,20 @@
qcom,bus-width = <4>;
qcom,cpu-dma-latency-us = <200>;
+
+ qcom,msm-bus,name = "sdhc3";
+ qcom,msm-bus,num-cases = <8>;
+ qcom,msm-bus,active-only = <0>;
+ qcom,msm-bus,num-paths = <1>;
+ qcom,msm-bus,vectors-KBps = <79 512 0 0>, /* No vote */
+ <79 512 1600 3200>, /* 400 KB/s*/
+ <79 512 80000 160000>, /* 20 MB/s */
+ <79 512 100000 200000>, /* 25 MB/s */
+ <79 512 200000 400000>, /* 50 MB/s */
+ <79 512 400000 800000>, /* 100 MB/s */
+ <79 512 800000 1600000>, /* 200 MB/s */
+ <79 512 2048000 4096000>; /* Max. bandwidth */
+ qcom,bus-bw-vectors-bps = <0 400000 20000000 25000000 50000000 100000000 200000000 4294967295>;
status = "disable";
};
@@ -401,6 +443,20 @@
qcom,bus-width = <4>;
qcom,cpu-dma-latency-us = <200>;
+
+ qcom,msm-bus,name = "sdhc4";
+ qcom,msm-bus,num-cases = <8>;
+ qcom,msm-bus,active-only = <0>;
+ qcom,msm-bus,num-paths = <1>;
+ qcom,msm-bus,vectors-KBps = <80 512 0 0>, /* No vote */
+ <80 512 1600 3200>, /* 400 KB/s*/
+ <80 512 80000 160000>, /* 20 MB/s */
+ <80 512 100000 200000>, /* 25 MB/s */
+ <80 512 200000 400000>, /* 50 MB/s */
+ <80 512 400000 800000>, /* 100 MB/s */
+ <80 512 800000 1600000>, /* 200 MB/s */
+ <80 512 2048000 4096000>; /* Max. bandwidth */
+ qcom,bus-bw-vectors-bps = <0 400000 20000000 25000000 50000000 100000000 200000000 4294967295>;
status = "disable";
};
diff --git a/arch/arm/configs/msm8610_defconfig b/arch/arm/configs/msm8610_defconfig
index 5ac1e02..9e38eca 100644
--- a/arch/arm/configs/msm8610_defconfig
+++ b/arch/arm/configs/msm8610_defconfig
@@ -133,6 +133,7 @@
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4=y
CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_RMI4_DEV=y
+CONFIG_KEYBOARD_GPIO=y
CONFIG_INPUT_MISC=y
CONFIG_INPUT_UINPUT=y
CONFIG_INPUT_GPIO=m
diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
index 1b36410..f39046c 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -434,6 +434,8 @@
select DONT_MAP_HOLE_AFTER_MEMBANK0
select MSM_BUS_SCALING
select ARM_HAS_SG_CHAIN
+ select REGULATOR
+ select MSM_RPM_REGULATOR_SMD
endmenu
choice
diff --git a/arch/arm/mach-msm/board-8226-gpiomux.c b/arch/arm/mach-msm/board-8226-gpiomux.c
index cc03e6e..5db52dd 100644
--- a/arch/arm/mach-msm/board-8226-gpiomux.c
+++ b/arch/arm/mach-msm/board-8226-gpiomux.c
@@ -60,6 +60,18 @@
.pull = GPIOMUX_PULL_DOWN,
};
+static struct gpiomux_setting gpio_keys_active = {
+ .func = GPIOMUX_FUNC_GPIO,
+ .drv = GPIOMUX_DRV_2MA,
+ .pull = GPIOMUX_PULL_UP,
+};
+
+static struct gpiomux_setting gpio_keys_suspend = {
+ .func = GPIOMUX_FUNC_GPIO,
+ .drv = GPIOMUX_DRV_2MA,
+ .pull = GPIOMUX_PULL_NONE,
+};
+
static struct gpiomux_setting gpio_spi_config = {
.func = GPIOMUX_FUNC_1,
.drv = GPIOMUX_DRV_8MA,
@@ -78,6 +90,30 @@
.pull = GPIOMUX_PULL_NONE,
};
+static struct msm_gpiomux_config msm_keypad_configs[] __initdata = {
+ {
+ .gpio = 106,
+ .settings = {
+ [GPIOMUX_ACTIVE] = &gpio_keys_active,
+ [GPIOMUX_SUSPENDED] = &gpio_keys_suspend,
+ },
+ },
+ {
+ .gpio = 107,
+ .settings = {
+ [GPIOMUX_ACTIVE] = &gpio_keys_active,
+ [GPIOMUX_SUSPENDED] = &gpio_keys_suspend,
+ },
+ },
+ {
+ .gpio = 108,
+ .settings = {
+ [GPIOMUX_ACTIVE] = &gpio_keys_active,
+ [GPIOMUX_SUSPENDED] = &gpio_keys_suspend,
+ },
+ },
+};
+
static struct msm_gpiomux_config msm_blsp_configs[] __initdata = {
{
.gpio = 0, /* BLSP1 QUP1 SPI_DATA_MOSI */
@@ -181,6 +217,8 @@
#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs));
#endif
+ msm_gpiomux_install(msm_keypad_configs,
+ ARRAY_SIZE(msm_keypad_configs));
msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));
diff --git a/arch/arm/mach-msm/board-8226.c b/arch/arm/mach-msm/board-8226.c
index 79ab428..dcab9ca 100644
--- a/arch/arm/mach-msm/board-8226.c
+++ b/arch/arm/mach-msm/board-8226.c
@@ -45,6 +45,7 @@
#include <mach/clk-provider.h>
#include <mach/msm_smd.h>
#include <mach/rpm-smd.h>
+#include <mach/rpm-regulator-smd.h>
#include <linux/msm_thermal.h>
#include "board-dt.h"
#include "clock.h"
@@ -108,6 +109,7 @@
msm_rpm_driver_init();
msm_lpmrs_module_init();
msm_spm_device_init();
+ rpm_regulator_smd_driver_init();
qpnp_regulator_init();
if (machine_is_msm8226_rumi())
msm_clock_init(&msm8226_rumi_clock_init_data);
diff --git a/arch/arm/mach-msm/socinfo.c b/arch/arm/mach-msm/socinfo.c
index 6643b14..3da1c63 100644
--- a/arch/arm/mach-msm/socinfo.c
+++ b/arch/arm/mach-msm/socinfo.c
@@ -866,6 +866,10 @@
dummy_socinfo.id = 147;
strlcpy(dummy_socinfo.build_id, "msm8610 - ",
sizeof(dummy_socinfo.build_id));
+ } else if (early_machine_is_msmzinc()) {
+ dummy_socinfo.id = 178;
+ strlcpy(dummy_socinfo.build_id, "msmzinc - ",
+ sizeof(dummy_socinfo.build_id));
}
strlcat(dummy_socinfo.build_id, "Dummy socinfo",
sizeof(dummy_socinfo.build_id));
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 8e01c94..e28ce98 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -649,7 +649,6 @@
{
dev->kobj.kset = devices_kset;
kobject_init(&dev->kobj, &device_ktype);
- INIT_LIST_HEAD(&dev->deferred_probe);
INIT_LIST_HEAD(&dev->dma_pools);
mutex_init(&dev->mutex);
lockdep_set_novalidate_class(&dev->mutex);
diff --git a/drivers/gpio/gpio-msm-common.c b/drivers/gpio/gpio-msm-common.c
index 05b2e0d..3115628 100644
--- a/drivers/gpio/gpio-msm-common.c
+++ b/drivers/gpio/gpio-msm-common.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2013, The Linux Foundation. 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
@@ -174,7 +174,7 @@
{
struct msm_gpio_dev *g_dev = to_msm_gpio_dev(chip);
struct irq_domain *domain = g_dev->domain;
- return irq_linear_revmap(domain, offset);
+ return irq_create_mapping(domain, offset);
}
static inline int msm_irq_to_gpio(struct gpio_chip *chip, unsigned irq)
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_buf_mgr.c b/drivers/media/platform/msm/camera_v2/isp/msm_buf_mgr.c
index 8ce8dbf..c8873b8 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_buf_mgr.c
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_buf_mgr.c
@@ -586,6 +586,9 @@
const char *ctx_name, uint16_t num_buf_q)
{
int rc = -1;
+ if (buf_mgr->open_count++)
+ return 0;
+
if (!num_buf_q) {
pr_err("Invalid buffer queue number\n");
return rc;
@@ -602,7 +605,6 @@
}
buf_mgr->client = msm_ion_client_create(-1, ctx_name);
buf_mgr->buf_handle_cnt = 0;
-
return 0;
bufq_error:
return rc;
@@ -611,6 +613,8 @@
static int msm_isp_deinit_isp_buf_mgr(
struct msm_isp_buf_mgr *buf_mgr)
{
+ if (--buf_mgr->open_count)
+ return 0;
msm_isp_release_all_bufq(buf_mgr);
ion_client_destroy(buf_mgr->client);
kfree(buf_mgr->bufq);
@@ -684,7 +688,7 @@
buf_mgr->ops = &isp_buf_ops;
buf_mgr->vb2_ops = vb2_ops;
buf_mgr->init_done = 1;
- buf_mgr->ref_count = 0;
+ buf_mgr->open_count = 0;
return 0;
iommu_domain_error:
return rc;
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_buf_mgr.h b/drivers/media/platform/msm/camera_v2/isp/msm_buf_mgr.h
index 244a1e2..c3b97d9 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_buf_mgr.h
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_buf_mgr.h
@@ -111,7 +111,7 @@
struct msm_isp_buf_mgr {
int init_done;
- uint32_t ref_count;
+ uint32_t open_count;
spinlock_t lock;
uint16_t num_buf_q;
struct msm_isp_bufq *bufq;
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
index 2e9bcd7..5baeb28 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
@@ -642,7 +642,7 @@
for (i = 0; i < vfe_dev->hw_info->num_iommu_ctx; i++)
vfe_dev->buf_mgr->ops->attach_ctx(vfe_dev->buf_mgr,
vfe_dev->iommu_ctx[i]);
- vfe_dev->buf_mgr->ops->buf_mgr_init(vfe_dev->buf_mgr, "msm_isp", 14);
+ vfe_dev->buf_mgr->ops->buf_mgr_init(vfe_dev->buf_mgr, "msm_isp", 28);
memset(&vfe_dev->axi_data, 0, sizeof(struct msm_vfe_axi_shared_data));
memset(&vfe_dev->stats_data, 0,
diff --git a/drivers/media/radio/radio-tavarua.c b/drivers/media/radio/radio-tavarua.c
index d3ddeef..0c5534c 100644
--- a/drivers/media/radio/radio-tavarua.c
+++ b/drivers/media/radio/radio-tavarua.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2009-2013, The Linux Foundation. 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
@@ -744,7 +744,15 @@
return;
}
mutex_lock(&radio->lock);
- tavarua_read_registers(radio, STATUS_REG1, STATUS_REG_NUM);
+ retval = tavarua_read_registers(radio, STATUS_REG1, STATUS_REG_NUM);
+ if (retval < 0) {
+ FMDERR("Fails to read status register and try once again");
+ msleep(TAVARUA_DELAY);
+ retval = tavarua_read_registers(radio, STATUS_REG1,
+ STATUS_REG_NUM);
+ if (retval < 0)
+ FMDERR("Fails to read status register");
+ }
FMDBG("INTSTAT1 <%x>\n", radio->registers[STATUS_REG1]);
FMDBG("INTSTAT2 <%x>\n", radio->registers[STATUS_REG2]);
@@ -1872,6 +1880,7 @@
static int tavarua_fops_open(struct file *file)
{
struct tavarua_device *radio = video_get_drvdata(video_devdata(file));
+ struct marimba config = { .mod_id = SLAVE_ID_BAHAMA};
int retval = -ENODEV;
unsigned char value;
/* FM core bring up */
@@ -1923,7 +1932,7 @@
radio->marimba->mod_id = MARIMBA_SLAVE_ID_MARIMBA;
value = FM_ENABLE;
- retval = marimba_write_bit_mask(radio->marimba,
+ retval = marimba_write_bit_mask(&config,
MARIMBA_XO_BUFF_CNTRL, &value, 1, value);
if (retval < 0) {
printk(KERN_ERR "%s:XO_BUFF_CNTRL write failed\n",
@@ -1937,7 +1946,7 @@
radio->marimba->mod_id = SLAVE_ID_BAHAMA;
/* Read the Bahama version*/
- retval = marimba_read_bit_mask(radio->marimba,
+ retval = marimba_read_bit_mask(&config,
0x00, &bahama_version, 1, 0x1F);
if (retval < 0) {
printk(KERN_ERR "%s: version read failed",
@@ -1953,7 +1962,7 @@
*/
value = 0x06;
/* value itself used as mask in these writes*/
- retval = marimba_write_bit_mask(radio->marimba,
+ retval = marimba_write_bit_mask(&config,
BAHAMA_LDO_DREG_CTL0, &value, 1, value);
if (retval < 0) {
printk(KERN_ERR "%s:0xF0 write failed\n",
@@ -1961,7 +1970,7 @@
goto open_err_all;
}
value = 0x86;
- retval = marimba_write_bit_mask(radio->marimba,
+ retval = marimba_write_bit_mask(&config,
BAHAMA_LDO_AREG_CTL0, &value, 1, value);
if (retval < 0) {
printk(KERN_ERR "%s:0xF4 write failed\n",
@@ -2058,7 +2067,7 @@
open_err_all:
/*Disable FM in case of error*/
value = 0x00;
- marimba_write_bit_mask(radio->marimba, MARIMBA_XO_BUFF_CNTRL,
+ marimba_write_bit_mask(&config, MARIMBA_XO_BUFF_CNTRL,
&value, 1, value);
tavarua_disable_irq(radio);
open_err_req_irq:
@@ -2087,6 +2096,7 @@
{
int retval;
struct tavarua_device *radio = video_get_drvdata(video_devdata(file));
+ struct marimba config = { .mod_id = SLAVE_ID_BAHAMA};
unsigned char value;
int i = 0;
/*FM Core shutdown sequence for Bahama*/
@@ -2189,7 +2199,7 @@
&& (bahama_version == 0x09 || bahama_version == 0x0a)) {
radio->marimba->mod_id = SLAVE_ID_BAHAMA;
/* actual value itself used as mask*/
- retval = marimba_write_bit_mask(radio->marimba,
+ retval = marimba_write_bit_mask(&config,
BAHAMA_LDO_DREG_CTL0, &internal_vreg_ctl[bt_status][0],
1, internal_vreg_ctl[index][0]);
if (retval < 0) {
@@ -2197,7 +2207,7 @@
goto exit;
}
/* actual value itself used as mask*/
- retval = marimba_write_bit_mask(radio->marimba,
+ retval = marimba_write_bit_mask(&config,
BAHAMA_LDO_AREG_CTL0, &internal_vreg_ctl[bt_status][1],
1, internal_vreg_ctl[index][1]);
if (retval < 0) {
@@ -2210,7 +2220,7 @@
}
value = 0x00;
- retval = marimba_write_bit_mask(radio->marimba, MARIMBA_XO_BUFF_CNTRL,
+ retval = marimba_write_bit_mask(&config, MARIMBA_XO_BUFF_CNTRL,
&value, 1, FM_ENABLE);
if (retval < 0) {
printk(KERN_ERR "%s:XO_BUFF_CNTRL write failed\n", __func__);
@@ -4326,9 +4336,15 @@
retval = tavarua_setup_interrupts(radio,
(radio->registers[RDCTRL] & 0x03));
if (retval < 0) {
- printk(KERN_INFO DRIVER_NAME "Error in \
- tavarua_resume %d\n", retval);
- return -EIO;
+ FMDERR("Fails to write RDCTRL");
+ msleep(TAVARUA_DELAY);
+ retval = tavarua_setup_interrupts(radio,
+ (radio->registers[RDCTRL] & 0x03));
+ if (retval < 0) {
+ FMDERR("Error in tavarua_resume %d\n",
+ retval);
+ return -EIO;
+ }
}
}
}
diff --git a/drivers/platform/msm/Kconfig b/drivers/platform/msm/Kconfig
index 76e3175..46b4651 100644
--- a/drivers/platform/msm/Kconfig
+++ b/drivers/platform/msm/Kconfig
@@ -82,6 +82,15 @@
VIB_DRV_N line and can be controlled manually or by the DTEST lines.
It uses the android timed-output framework.
+config QPNP_REVID
+ tristate "QPNP Revision ID Peripheral"
+ depends on SPMI
+ help
+ Say 'y' here to include support for the Qualcomm QPNP REVID
+ peripheral. REVID prints out the PMIC type and revision numbers
+ in the kernel log along with the PMIC option status. The PMIC
+ type is mapped to a Qualcomm chip part number and logged as well.
+
config IPA
tristate "IPA support"
depends on SPS
diff --git a/drivers/platform/msm/Makefile b/drivers/platform/msm/Makefile
index 289ece9..6b9c5ad 100644
--- a/drivers/platform/msm/Makefile
+++ b/drivers/platform/msm/Makefile
@@ -11,3 +11,4 @@
obj-$(CONFIG_QPNP_CLKDIV) += qpnp-clkdiv.o
obj-$(CONFIG_MSM_AVTIMER) += avtimer.o
obj-$(CONFIG_SSM) += ssm.o
+obj-$(CONFIG_QPNP_REVID) += qpnp-revid.o
diff --git a/drivers/platform/msm/qpnp-revid.c b/drivers/platform/msm/qpnp-revid.c
new file mode 100644
index 0000000..f218a5a
--- /dev/null
+++ b/drivers/platform/msm/qpnp-revid.c
@@ -0,0 +1,147 @@
+/* Copyright (c) 2013, The Linux Foundation. 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/module.h>
+#include <linux/slab.h>
+#include <linux/spmi.h>
+
+#define REVID_REVISION1 0x0
+#define REVID_REVISION2 0x1
+#define REVID_REVISION3 0x2
+#define REVID_REVISION4 0x3
+#define REVID_TYPE 0x4
+#define REVID_SUBTYPE 0x5
+#define REVID_STATUS1 0x8
+
+#define QPNP_REVID_DEV_NAME "qcom,qpnp-revid"
+
+static const char *const pmic_names[] = {
+ "Unknown PMIC",
+ "PM8941",
+ "PM8841",
+ "PM8019",
+ "PM8226",
+ "PM8110"
+};
+
+static struct of_device_id qpnp_revid_match_table[] = {
+ { .compatible = QPNP_REVID_DEV_NAME },
+ {}
+};
+
+static u8 qpnp_read_byte(struct spmi_device *spmi, u16 addr)
+{
+ int rc;
+ u8 val;
+
+ rc = spmi_ext_register_readl(spmi->ctrl, spmi->sid, addr, &val, 1);
+ if (rc) {
+ pr_err("SPMI read failed rc=%d\n", rc);
+ return 0;
+ }
+ return val;
+}
+
+#define PM8941_PERIPHERAL_SUBTYPE 0x01
+static size_t build_pmic_string(char *buf, size_t n, int sid,
+ u8 subtype, u8 rev1, u8 rev2, u8 rev3, u8 rev4)
+{
+ size_t pos = 0;
+ /*
+ * In early versions of PM8941, the major revision number started
+ * incrementing from 0 (eg 0 = v1.0, 1 = v2.0).
+ * Increment the major revision number here if the chip is an early
+ * version of PM8941.
+ */
+ if ((int)subtype == PM8941_PERIPHERAL_SUBTYPE && rev4 < 0x02)
+ rev4++;
+
+ pos += snprintf(buf + pos, n - pos, "PMIC@SID%d", sid);
+ if (subtype >= ARRAY_SIZE(pmic_names) || subtype == 0)
+ pos += snprintf(buf + pos, n - pos, ": %s (subtype: 0x%02X)",
+ pmic_names[0], subtype);
+ else
+ pos += snprintf(buf + pos, n - pos, ": %s",
+ pmic_names[subtype]);
+ pos += snprintf(buf + pos, n - pos, " v%d.%d", rev4, rev3);
+ if (rev2 || rev1)
+ pos += snprintf(buf + pos, n - pos, ".%d", rev2);
+ if (rev1)
+ pos += snprintf(buf + pos, n - pos, ".%d", rev1);
+ return pos;
+}
+
+#define PMIC_PERIPHERAL_TYPE 0x51
+#define PMIC_STRING_MAXLENGTH 80
+static int __devinit qpnp_revid_probe(struct spmi_device *spmi)
+{
+ u8 rev1, rev2, rev3, rev4, pmic_type, pmic_subtype, pmic_status;
+ u8 option1, option2, option3, option4;
+ struct resource *resource;
+ char pmic_string[PMIC_STRING_MAXLENGTH] = {'\0'};
+
+ resource = spmi_get_resource(spmi, NULL, IORESOURCE_MEM, 0);
+ if (!resource) {
+ pr_err("Unable to get spmi resource for REVID\n");
+ return -EINVAL;
+ }
+ pmic_type = qpnp_read_byte(spmi, resource->start + REVID_TYPE);
+ if (pmic_type != PMIC_PERIPHERAL_TYPE) {
+ pr_err("Invalid REVID peripheral type: %02X\n", pmic_type);
+ return -EINVAL;
+ }
+
+ rev1 = qpnp_read_byte(spmi, resource->start + REVID_REVISION1);
+ rev2 = qpnp_read_byte(spmi, resource->start + REVID_REVISION2);
+ rev3 = qpnp_read_byte(spmi, resource->start + REVID_REVISION3);
+ rev4 = qpnp_read_byte(spmi, resource->start + REVID_REVISION4);
+
+ pmic_subtype = qpnp_read_byte(spmi, resource->start + REVID_SUBTYPE);
+ pmic_status = qpnp_read_byte(spmi, resource->start + REVID_STATUS1);
+
+ option1 = pmic_status & 0x3;
+ option2 = (pmic_status >> 2) & 0x3;
+ option3 = (pmic_status >> 4) & 0x3;
+ option4 = (pmic_status >> 6) & 0x3;
+
+ build_pmic_string(pmic_string, PMIC_STRING_MAXLENGTH, spmi->sid,
+ pmic_subtype, rev1, rev2, rev3, rev4);
+ pr_info("%s options: %d, %d, %d, %d\n",
+ pmic_string, option1, option2, option3, option4);
+ return 0;
+}
+
+static struct spmi_driver qpnp_revid_driver = {
+ .probe = qpnp_revid_probe,
+ .driver = {
+ .name = QPNP_REVID_DEV_NAME,
+ .owner = THIS_MODULE,
+ .of_match_table = qpnp_revid_match_table,
+ },
+};
+
+static int __init qpnp_revid_init(void)
+{
+ return spmi_driver_register(&qpnp_revid_driver);
+}
+
+static void __exit qpnp_revid_exit(void)
+{
+ return spmi_driver_unregister(&qpnp_revid_driver);
+}
+
+module_init(qpnp_revid_init);
+module_exit(qpnp_revid_exit);
+
+MODULE_DESCRIPTION("QPNP REVID DRIVER");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:" QPNP_REVID_DEV_NAME);
diff --git a/include/linux/device.h b/include/linux/device.h
index 40374ce..810337c 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -582,10 +582,6 @@
* @mutex: Mutex to synchronize calls to its driver.
* @bus: Type of bus device is on.
* @driver: Which driver has allocated this
- * @deferred_probe: entry in deferred_probe_list which is used to retry the
- * binding of drivers which were unable to get all the resources
- * needed by the device; typically because it depends on another
- * driver getting probed first.
* @platform_data: Platform data specific to the device.
* Example: For devices on custom boards, as typical of embedded
* and SOC based hardware, Linux often uses platform_data to point
@@ -645,7 +641,6 @@
struct bus_type *bus; /* type of bus device is on */
struct device_driver *driver; /* which driver has allocated this
device */
- struct list_head deferred_probe;
void *platform_data; /* Platform specific data, device
core doesn't touch it */
struct dev_pm_info power;