msm: msm-pm: Remove acpuclock APIs

Acpuclock APIs are deprecated. Remove its reference from msm-pm.

[mpokwsths: Adapted to msm-pm and cleaned up some CAF derps]

Change-Id: I63084f714884b54d90b8e9809127cac276b1e8d5
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
Signed-off-by: Kostas K <mpokwsths@gmail.com>

Conflicts:
	arch/arm/mach-msm/pm-8x60.c
msm: Remove references to SMI

SMI memory is no longer supported on current targets. Remove
all references to it.

[mpokwsths: Adapted for hammerhead]

Change-Id: Ifbdf6247cc4b13c1d0173f1c998e07c702c06408
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Kostas K <mpokwsths@gmail.com>

Conflicts:
	arch/arm/mach-msm/board-samarium.c
lge_devices: Proper persistent ram/tracer definitions

To allow compiling without persistent ram/console these modifications were
needed.

Signed-off-by: Kostas K <mpokwsths@gmail.com>
msm: cache_erp: Remove acpuclk_get_rate call

acpuclk_get_rate is deprecated, and will just return 0. Remove the call
since it's only for debugging printing.

Change-Id: I7137a2e395825d2756b09d851f18df07df59dad9
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
msm: hotplug: Use cpufreq_get to find the slowest cpu

Acpuclock is deprecated. Remove references to it and use cpufreq_get to find
the slowest cpu to offline.

Signed-off-by: Kostas K <mpokwsths@gmail.com>
msm: Remove acpuclock

Acpuclock is deprecated and has no more clients. Remove it.

Signed-off-by: Kostas K <mpokwsths@gmail.com>
i2c-qup: Verify that mem resource exists prior to redirection

Redirection may cause a system crush in the case of a missing
memory resource specification. Now when reading a memory
resource from platform data, the return value is checked
before doing redirection on the resource.

Change-Id: Id4ef9c293f65935d6e3bd311720a1e66a2da8f35
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

Conflicts:
	drivers/i2c/busses/i2c-qup.c
qup_i2c: Handle scenario if runtime PM is disable

If runtime PM is not supported, make sure
the I2C clock and GPIOs enabled at the start
of the transfer(RD/WR)
This is done by i2c_qup_pm_resume_runtime()

CRs-Fixed: 492194
Change-Id: Iaa901a0f0d0cd58318e3f6dd64e1db73c73b630f
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
qup_i2c: Initialize I2C resource before registering.

Due to mismatch in sequence of initializing the
I2C resources  and registering device,  issues seen
while probing clients. This patch corrects the sequence.

CRs-Fixed: 581007
Change-Id: I98f0e73ce1ed1213409d5700f7a78e722e451ec0
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
qup_i2c: Correct free memory call

Correct freeing of memory, which is allocated using
the devm prefixed API, to free it using devm_kfree rather
then kfree.

CRs-Fixed: 582597
Change-Id: If1aa9bcd86bb3a7d35adc5630ff19ad08bbdf762
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
i2c_qup: Improve implementation of PM callbacks

Refactor PM callbacks and remove redundant variable.
Add support for configuration of clockcontrol event.
Now the clock's state may be set by pm calls (as before)
or by a transfer's begining and ending.
Runtime-PM is still used in autosuspend configuration for
expensive NoC voting/unvoting since that may go to remote
processor.

CRs-Fixed: 592435
Change-Id: I54f7c67f768336f66765a04006b4c8e4734ac277
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>

Conflicts:
	Documentation/devicetree/bindings/i2c/i2c-qup.txt
qup_i2c: dump gpio config on error

Dump the configuration of relevant GPIOs
on timeout error.

Change-Id: Iab5aa57befc146c232d12759990b0b8a23a68fe1
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
qup_i2c: export qup_i2c_init_driver

Drivers like onsemi-ncp6335d and fan53555 are clients of i2c-qup driver.
In some targets, these clients have to initialize and probe early before
the i2c-qup driver is ready. Hence export qup_i2c_init_driver to make sure
i2c-qup driver is ready when its clients need to probe.

Change-Id: I0f866d1c4239f9c72f6753674c2283e97f3a3691
Signed-off-by: Ke Liu <keliu@codeaurora.org>
qup_i2c: improve PM functionality

Move system-PM functionality to noirq stage. Remove
the incorrect active-only clock path-voting setting.
Resolve synchronization of concurent transition of
system and runtime PM.

Change-Id: I2753557482da7a48a596e4b660165b4e2af0f854
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
qup_i2c: support for configuarable noise rejection

allow to configure noise rejection value from device tree
which helps filter spikes in the i2c lines.

CRs-Fixed: 626250
Change-Id: If66132c8cc444294e4e6e275ece8b85108cf7abb
Signed-off-by: Ankit Gupta <ankgupta@codeaurora.org>
qup_i2c: Improve recovery from core and slave bad state

Unexpected noise, and/or unexpected behavior from a slave
may put the whole I2C bus in unworkable state. Clear I2C
bus state using HW command instead of bit-banging to avoid
assumption about GPIO recovery config.

Change-Id: I8d1d0002392f9ec9bc0db146aa0ce3e138334644
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
msm: sps: enable SPS for APQ8084

Add the support for new BAM HW features and LPAE.

1. Replace data types of physical addresses of descriptor
   and data with phys_addr_t.
2. Replace sps_transfer_one() function u32 addr argument
   to phys_addr_t addr.
3. Add new MSB registers address support for LPAE.
4. Add support for two new PIPE level ERROR IRQs which
   can be enable or disable by client.
5. Add support to read the BAM PIPEs attributed to
   specific EE.
6. Add the option for BAM Clients to specify whether
   enable or disable some HW features of their BAMs.

Change-Id: If41e3d5e7e8333d7076d924dbae06caa126a1694
Signed-off-by: Dipen Parmar <dipenp@codeaurora.org>
msm: sps: add OCIMEM for pipe memory

BAM uses pipe memory for BAM-to-BAM connnections. OCIMEM is one of
memory types for pipe memory. Add the support for OCIMEM in this
change.

Change-Id: Ifc6fe537060d2c4120a03222cb419f463c7b4ab0
Signed-off-by: Yan He <yanhe@codeaurora.org>
msm: sps: free the interrupt for satellite mode

When BAM is registered in satellite mode on apps side, we do not
need to disable BAM HW when apps side does not use that BAM any
more. But we still should free the interrupt. This is addressed
in this change.

Change-Id: I955ea1a341036efa82f0ecc0f45cad5ec41651ae
Signed-off-by: Yan He <yanhe@codeaurora.org>
msm: sps: update the checking of free slots

There is a new BAM use case where the client driver does not use
either interrupt or polling for a pipe. Thus, add a new way to
check the free slots in descriptor FIFO for this case.

Change-Id: I133b938718d0c3654309e65ac0670fe1725a937f
Signed-off-by: Yan He <yanhe@codeaurora.org>