msm: Kconfig: Add support for MSM_FIQ for 8625

On 8x25 modem is the master processor and in case apps
is holding lock with irqs disabled then sending an SMSM reset
interrupt does not help and the state of Apps is not known
at all.Hence we are enabling a FIQ which will save the cpu context
of the apps and help debugging before going into SMSM reset.
In the current patch we are adding support for enabling the fiq
and defining the fiq offset number.

Signed-off-by: Taniya Das <tdas@codeaurora.org>
(cherry picked from commit 87628c186a29a4454fb3097631085e15543f6bbb)

Change-Id: Ia336272dcb01b7b71b0e0665aa754b69869779f9
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
msm: Kconfig: Add GIC_SECURE support for 8625

GIC has to configure IRQ lines in group-1 and FIQ lines in
group-0, which  can be done once we enable GIC_SECURE

Signed-off-by: Taniya Das <tdas@codeaurora.org>
(cherry picked from commit b6c26704cd34604880a584782561d5e99dddcf65)

Change-Id: I21e7c443905cb1b4be6ff619cc79418787eec7ea
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
msm: 8625 Add support for PBUS error handler

Register PBUS error interrupt handler and send IPI_CPU_BACKTRACE
to all other cores when error occured.

CRs-Fixed: 449134
Change-Id: I86a1b4274d77fb2dc01ac0bcdde04a46b51643e3
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/Makefile
msm: devices-msm7x27a: Add pbus device for 8625

pbus error reporting device registration for 8625

CRs-Fixed: 449134
Change-Id: I9e194f829736b65a9a4cfb5876a0f08da0299e6f
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
msm: 7x27a: Add support for FIQ handler

Add support for FIQ handler on MSM7x27a to save
ACPU context.

CRs-Fixed: 449136
Change-Id: I88a5d35c782eaca11f9ea452166e881d8e929455
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
msm: cpr: Fix for continuous CPR up interrupts

CPR is disabled after gettting VMAX_BREACH_CNT up interrupts
after VMax is hit. But if Apps goes to power collpase after
this, during wakeup CPR is again enabled and max_volt_count not
reset. As current check is (max_volt_count equals to
VMAX_BREACH_CNT) and max_volt_count will be more than that, CPR
is not disabled anymore and we will keep getting UP interrupts.

CRs-Fixed: 448508
Change-Id: I7be1556a765b671e107977ab00bf7201b756f7b9
Acked-by: Gopi Krishna Nedanuri <gnedanur@qti.qualcomm.com>
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
(cherry picked from commit 5f5841cb0a6abc0f2ec6feebdd14114c0059ca53)

Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm: Camera: Camera preview rotated to 180 degrees

Change the mount angle for EVBD device from 90 to 270
degree as sensor is mounted on same side as display

Change-Id: I1bb6c238d24648fab6dcc38ddca481d7bbb7d9aa
CRs-fixed: 444276
Signed-off-by: Sandeep Sharma <sansharm@codeaurora.org>
msm: cpr: Get VP regulator handle for 8x25V2

8x25Q uses shared regulator handle between acpu and CPR.
8x25V2 uses vp regulator for CPR. Hence, shared regulator
handle is null on 8x25V2 and so need to get vp regulator
handle in CPR probe.

CRs-Fixed: 450709
Change-Id: I55623d59d2a63c2ac4dddd6547ad88a867566a22
Signed-off-by: Kaushal Kumar <kaushalk@codeaurora.org>
mpm: 8625: Add PBUS interrupt to bypass irq list

Add pbus interrupt to bypass list. So that to
ignore PBUS interrupt while system decided to IdlePC.

CRs-Fixed: 451213
Change-Id: I54bd645a1114366ec38fab8df1682a49b19c0cce
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
msm: 8625 Add support to send secure SGI other CPU cores

Currently only one cpu context is getting saved
when FIQ is raised. Send secure SGI to other
CPU cores to save all CPU context.

CRs-Fixed: 443724
Change-Id: Ic49509a778a5bdcba266e6244655f4732261b29d
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
msm: pm2: Remove unused variable

Remove unused 'power_collapsed' variable. Currently
this variable is maintained as per CPU variable.

CRs-fixed: 453858
Change-Id: I2f921f6986931babd2460096ea33e2d34f958f37
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
msm: board7627a: Allocate CMA region in lowmem

Give hard limit of 768 MB, so that CMA allocation won't
happen in HIGHMEM.

Change-Id: I471b4e0180e5f2f9ea264f2dfdcffe67e9ae9cd6
Signed-off-by: Chintan Pandya <cpandya@codeaurora.org>
Signed-off-by: Manish Kumar <manishku@codeaurora.org>
regulator: Fairchild fan53555 support

This driver supports Fairchild FAN53555 Digitally Programmable
TinyBuck Regulator. The FAN53555 is a step-down switching voltage
regulator that delivers a digitally programmable output from an
input voltage supply of 2.5V to 5.5V. The output voltage is
programmed through an I2C interface.

Change-Id: Ie640a2b0e093d6170a8d41d63d5bd9a71feaba5b
Signed-off-by: Yunfan Zhang <yfzhang@marvell.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
regulator: fan53555: remove vsel_max not used

The max voltage will be bounded by min_uV, uV_step and n_voltages, so
remove it to avoid confusing.

Change-Id: I46add34715f46a462593ff5cfe7a99512adff1c6
Signed-off-by: Yunfan Zhang <yfzhang@marvell.com>
Reviewed-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
regulator: fan53555: Make driver compatible to 3.4 kernel

The driver is currently based on the regulator framework of
3.7 kernel version, modify it to support 3.4 kernel.

Change-Id: I3b1218c94bbc0e17e86de018169ed10ed97e4692
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
regulator: fan53555: Modify Chip Id

In latest data sheet, Chip Id of 09x part is changed to 12.
Also dump the contents of all the registers at the end of
probe routine.

Change-Id: I36d22bacdce12f3a8bbcff8215b4ba5b21cd9709
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
regulator: fan53555:  Add regulator driver at fs initcall

Add the fan53555 regulator driver at fs initcall as i2c_gpio
driver initialized at subsys_init. This resolves the dependency
chain.

Change-Id: I5364e0298e8ba47a9bdd06cbf86b1d1633369e68
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
regulator: fan53555: Add slew delay API

During voltage switch, buck regulator takes certain time to
reach the new setpoint. Software should put certain delay after
issuing a set voltage command. This delay depends on number steps
of voltage switch.

Add slew delay API to set delay depends on the number of steps change
in voltage.

Change-Id: I9a32ae4052d03b25c940cf2e6e6e9e2bf9070d4c
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
regulator: fan53555: Do not use regmap_update_bits

regmap_update_bits does a read-modify-write while updating
the device registers. This involves an unwanted read
operation which can be avoided by storing the register
value locally.

Also, make sure that the i2c read call required for
debug is enabled selectively.

Change-Id: I546b44233ef53209f424df47cc0a316975893cbe
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
regulator: fan53555: API to configure the regulator during reboot

In cases when the device is not completely turned off (reboot)
the regulator registers are not reset. This can cause the device to
boot at the same voltage at which it went down, leading to
instability. Add an API to set the default voltage.

Also, call this API before the APPS goes for a restart on 8x25q.

Change-Id: Ibb388134afbb852e2fa52bfb18c2b53408cfbbc2
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>