msm: pm2: Add memory markers across PM driver

Add memory markers in PM driver to know the SPC & PC code flow.
This patch is useful to debug the stability/field issues.
Currently below are marker locations used by individual cores.

Cores SPC/HOTPLUG marker locations:
----------------------------------
C0	-->	0xFC00010
C1	-->	0xFC00014
C2	-->	0xFC00018
C3	-->	0xFC0001C
Above all locations are written an unique value when
the core executes different parts of LPM code.

C0	-->	0xFC00020
C1	-->	0xFC00024
C2	-->	0xFC00028
C3	-->	0xFC0002C
If the values written become
	0x1	--> Cores are doing idleSPC
	0x2	--> Cores are in HOTPLUG state
	default	--> 0x0

e.g:
	0xFC00014	--> 0x4
	0xFC00024	--> 0x2
Above markers tell us that C1 is in HOTPLUG
	0xFC00014	--> 0x4
	0xFC00024	--> 0x2
Above markers tell us that C1 comes out of HOTPLUG

C0 PC marker locations:
----------------------
C0	-->	0xFC00030

Extra locations:
---------------
0x34	--> write 1, this tells 'idle-v7.S' that we are doing PC
0x38	--> tell us we are idlePC/suspendPC
	If the values written become
		default		--> 0x0
		suspendPC	--> 0x1
		idlePC		--> 0x2

Change-Id: If89e2c193d5e3134bd08d3910db95304d89a31db
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/idle-v7.S
	arch/arm/mach-msm/pm.h
i2c: i2c-gpio: Add suspend/resume callbacks

Add suspend-resume callbacks and also provide
a callback to configure/un-configure hardware
resources such as gpio's.
Provide an API to configure the i2c-gpio's very
late into the power collapse sequence.

Change-Id: I5b2168ab568931cd406a92a95bdaaf9dd1526a6e
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
msm: pm2: Extend memory marker support to 7x27A

Currently debug markers support presents for only 8x25.
This change was borken for 7x27a traget as it uses the same
kernel binary for 7x27a and 8x25 targets. Fix this for 7x27a
target by moving the "memblock_remove" API to 7x27a reserve
function.

Change-Id: I512af0dddc68eb4ce98774552a78fc16c5b5e39f
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
Revert "i2c: i2c-gpio: Add suspend/resume callbacks"

This reverts commit f5ce93ff860e03819deaa58c62cc832da27ebbe9

Change-Id: I3566ae58e57c912e3b465d2df333bae6cea2e6d9
Revert "msm: pm2: Call ACPU clock driver APIs at correct place"

This reverts commit 128f9acec89e751977ab8b5fb0be22bd46147b0a.

Reason for revert:
When the APPS decides to enter into PC it make a request to
lower the ACPU frequency to TCXO. At the same time ACPU clock
driver read the current voltage via GPIO lines connect to
external BUCK. But the BUCK regulator which supplies voltage
to the APPS core retains the voltage across the PC cycles.
Hence, there is no need to reprogram the voltage.

Conflicts:

	arch/arm/mach-msm/pm2.c

Change-Id: Ibc70af6505b81d6d96ccb3d9e7d7da08d404e1a9
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
msm: 8x25q: Save/restore AHB clock registers across power-collapse

On 8x25q the AHB clock select and control register are
reset across power collapse. Save and restore values across
power-collapse.

Also, make sure that the ACPU clk driver always configures
both the AHB clk dividers.

Change-Id: I9c0b8094535ba2e2d9739f8ceb09b9619db2da94
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
msm: cpr: Use preset value of Turbo Vmin in 8x25Q

The floor fuse is used in 8x25(v2) to fix the L2 cache
Vmin marginality. In 8x25Q, the Vmin for both nominal
and turbo is fixed so do not depend on floor fuse since
these fused bits could possibly get re-used for some
other purpose leading to error in turbo Vmin setting.

Change-Id: I2202d23a5b552434082c406bcafd0f2bc4b0a6fe
Signed-off-by: Kaushal Kumar <kaushalk@codeaurora.org>
msm: cpr: Fix the error path for get_regulator

free_irq() should only be done if request_threaded_irq
is being called.

Change-Id: Ib1d8ccc24fa4596b812326efc4edd6894244796b
Acked by: Manish Poddar <mpoddar@qti.qualcomm.com>
Signed-off-by: Utsab Bose <ubose@codeaurora.org>
msm: acpuclock-8625q: change the PVS equation

Change the PVS equation according to the requirement
of 8625Q.

Change-Id: I8fc3d33092ba37e825e712d293afc3e5db6135d8
Signed-off-by: Utsab Bose <ubose@codeaurora.org>
msm: 8625: Send IPI_CPU_BACKTRACE when FIQ is raised

Currently only cpu0 context is getting saved when FIQ is raised.
So add support to unwind the call stacks of all the CPUs cores by
sending IPI_CPU_BACKTRACE.

Change-Id: I4ef0b5f08f8d6c920fbe6db5802c20a07b5f1b46
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
msm: acpuclock-8625q: Avoid vdd update during power-collapse

On 8625q, the regulator supplying voltage to the APPS
core retains the voltage across power-collapse. Hence,
there is no need to reprogram the voltage.

Change-Id: Ie11cbf5d0407b23d38d0d3e7da23d95237b63b5d
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
msm: board-msm7627a-io: Add key support for EVBD+

Configure gpios and add platform data for gpio matrix
driver to support keys on EVBD+ platform.

(cherry picked from commit 5f9469409a029eb11c1b73a2630bc512f2e8221f)

Change-Id: Idfb4fe1d81b18556e80bc55f214faad7d0c340ad
CRs-fixed: 434294
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
msm: 7627a-io: Add TS support for 8x25 QPR EVBD+

Add synaptic TS support for 8x25 QPR EVBD+. It uses
720p display panel.

Change-Id: Ibf0d9f56847db7bbc2e2a164b79c8bacbed3f240
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
msm: board-7627a: Re-arrange memory reservations target wise

Make dynamic reservations for PMEM/ION_CARVEOUT after the fixed
allocations required for specifically 8625.

Also, reservation related to 8625 should not happen in the case
of 7627a, so take out that code from common path.

Change-Id: I4772600fc072fd017ba47d927417b0c689f6d767
Signed-off-by: Chintan Pandya <cpandya@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/board-msm7x27a.c
	arch/arm/mach-msm/board-qrd7627a.c
fix ion_platform_data definition

fix ion_platform_heap to make is use an usual way
in board configuration file.

Change-Id: Ia5129a4c81bb6719f471214e75d77e51f5f50c59
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
[lauraa: Fixup msm board files]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
[cpandya: clean up for checkpatch]
Signed-off-by: Chintan Pandya <cpandya@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/board-msm7x27a.c
	arch/arm/mach-msm/board-msm8x60.c
	arch/arm/mach-msm/board-qrd7627a.c
msm: Rip out fmem related memory adjustments

fmem is deprecated. Get rid of the special handling for
fmem in memory reservation code.

Change-Id: I5c69357eb75c53a7666efc1904579b979be2f3a4
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
[cpandya: taken out fmem code from 7627a board files]
Signed-off-by: Chintan Pandya <cpandya@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/board-8064.c
	arch/arm/mach-msm/board-8930.c
	arch/arm/mach-msm/board-8960.c
	arch/arm/mach-msm/board-msm7x27a.c
	arch/arm/mach-msm/board-qrd7627a.c