msm: kgsl: Check long IB only for valid context

Do not check for long IB if the hang is detected in a NULL context,
hang in NULL context can happen when we are switching from NULL to
active context and hang is detected in commands that write an
active context to memstore, long IB in this scenario is not possible.

Change-Id: I7711c86b91c6c2ce0b4aa0543572c26d10c83030
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
arm/dt: 8610: add MDP device tree for msm8610

add MDP device tree for msm8610 targets

Change-Id: I195fd5c8c9dca4c290a11242df33c97ffc7b5e56
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
msm: wfd: Explicitly include slab.h

slab.h is getting implicitly included from external header files, which
if disabled in compilation, causes compilation errors for wfd driver.
Include slab.h explicitly to remove this unnecessary dependancy.

Change-Id: I23691038f92ad1f6b9f2225a39ea76d0a18573ab
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
hwmon: qpnp-adc: Use buffered 625mV reference channel

Use channel 0xc to read the buffered 625mV reference
channel during calibration if it exists. The channel
may not exist on all the PMIC versions. If the channel
is supported in the PMIC add it as a channel in the
VADC DT channel node.

Change-Id: I49b54e161538f075fcd89ed9beb7ffbdd8034a87
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
gpu: ion: Move msm heaps in makefile to msm definitions

Rather than put the msm additions in the same place as generic
code in the make file, move the compilation definitions to an
msm specific definition (CONFIG_ION_MSM).

Change-Id: Icae87c43aac7c6530f50e9464000ae37e4028e04
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
asoc: msm: Add afe loopback support for 8x10

Afe loopback is required for 8x10. Primary mi2s is used for tx,
secondary mi2s is used for rx.

Change-Id: I8c43aa0ac1ffeef87a8bf3dc8472f8dacb117eff
Signed-off-by: Fred Oh <fred@codeaurora.org>
ASoC: msm8x10: Add all FEs/BEs to 8x10 driver

This is required FEs/BEs for 8x10 driver machine driver.

Change-Id: I64c4bb4a2535273939470e77bc65d9893c96b105
Signed-off-by: Fred Oh <fred@codeaurora.org>
ASoC: msm: qdsp6v2: Add FM support for msm8x10

FM playback is one of hostless playback. Update routing table for
msm8x10.

Change-Id: Ifa98b0b19827340d01b7f166ed4edbb8721fa9ba
Signed-off-by: Fred Oh <fred@codeaurora.org>
Merge branch 'core-3.4' into android-msm-3.4
mm: cma: remove watermark hacks

Commits 2139cbe627b8 ("cma: fix counting of isolated pages") and
d95ea5d18e69 ("cma: fix watermark checking") introduced a reliable
method of free page accounting when memory is being allocated from CMA
regions, so the workaround introduced earlier by commit 49f223a9cd96
("mm: trigger page reclaim in alloc_contig_range() to stabilise
watermarks") can be finally removed.

Change-Id: Iae17de8185eeabffd46752dbaf819591e6585869
CRs-Fixed: 480377
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Mel Gorman <mel@csn.ul.ie>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Git-commit: bc357f431c836c6631751e3ef7dfe7882394ad67
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[lauraa@codeaurora.org: Context fixup in mmzone.h, keep zone definition in
alloc_contig_range for other purposes]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Merge branch 'core-3.4' into android-msm-3.4
mm: cma: fix accounting of CMA pages placed in high memory

The total number of low memory pages is determined as totalram_pages -
totalhigh_pages, so without this patch all CMA pageblocks placed in
highmem were accounted to low memory.

Change-Id: I10b78fa6a710828520a487b2fc2419b4f7521a6f
CRs-Fixed: 480377
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Git-commit: 41a7973447b0b8717f0a214d4328dc31ec2291d7
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: thermal: Add sensor id mapping ability

In some cases, the remote sensors that are enabled are not
sequential. Also, when this happens, there is possibility that max sensor
count might be smaller than the remote sensor id. Add the mapping
so that we can specify the remote sensor id by giving sensor software
id.

Change-Id: I4b67a811ade48e9517647d780e8785af508fee8c
Signed-off-by: Jennifer Liu <chihning@codeaurora.org>
msm: cpufreq: Initialize cpufreq driver early at boot

MSM cpufreq driver registering with the CPUFreq framework during
late_initcall() may cause the device to be available a few seconds after
the clock driver is ready for changing frequency. This could be bad for
boot and/or thermal performance, since the cpu will continue to boot at
whatever frequency the bootloaders set it to.

Initialize cpufreq driver as part of device_initcalL() but only after
all the clock drivers have had a chance to initialize their devices.

Change-Id: Iaa4867108f59a368ee5b511d35ea2e8e219d39d3
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
msm: subsystem_restart: Add support for error services ready indication

Most subsystems are capable of monitoring and reporting their own errors.
But things could go wrong during their boot up before they enable this
capability. To detect this error condition, subsystems will now send a new
"error services ready" indication to the application processor when they
are ready to monitor their own errors. When the "error services ready"
indication is expected from a subsystem, but doesn't come within a
reasonable time, it should be treated as an error.

There are multiple ways to handle this error: 1) Treat the timeout as a SSR
request after the subsystem has booted up. 2) Treat the reception of the
indication as a "boot complete" requirement.

Option (1) will mean that flashing an older image or one that doesn't have
support for this new indication by accident will trigger back-to-back
restarts of the subsystem. After the SSR count/time limit is hit, it will
trigger an entire system reset. Once the system reset is complete, it will
be back to a series of back-to-back restarts of the sybsystem. This results
in continuous resets of the system, making it hard to recover the device
from this invalid configuration.

Option (2) will mean that flashing an incorrect image just results in
failure of boot up of the subsystem. Repeated attempts will only result in
successive boot failures, but will not trigger a subsystem restart or hit
any limits that will trigger a system reset. Recovering from this invalid
configuration should be easier since the system is still stable and allows
manual reflashing of the proper subsystem images. This option also means
that failure to get this indication during a subsystem restart is treated
as a boot failure during SSR. Since the current SSR framework treats boot
failures during SSR as an unrecoverable error and restarts the whole
system, a properly configured system is never left in a state with a
dysfunctional subsystem.

For this reason, option (2), treating the timely reception of the error
services ready indication as a successful boot up requirement is the
implementation chosen by this patch.

Change-Id: Ibe7ea522babfe826e40a950ef3ea4577a463a313
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
ASoC: wcd9320: Enable speaker clip detection

Codec has 4 banks of clip pcm registers and they need
to be enabled for capturing pcm values.
Clip pcm registers in each bank will hold the values of pcm
samples that triggers the clip interrupt.
This change exposes the bank selection configuration to client's
of codec driver.

Change-Id: I285931df878ee621095a8b1bfc4d81fcbe2a4375
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
board: 8610: add SD card detect gpiomux configuration

On MSM8x10 platforms, a MSM GPIO is used for SD card detect and it's
gpiomux configuration needs to be set to a specified value for the
SD card to be detected across all platforms. This patch adds the correct
gpiomux configuration for SD card detect GPIO to properly detect SD card
across all platforms.

CRs-Fixed: 480392
Change-Id: I4ce31b329ec3ff1d9dcad7355851cb28beffcd82
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
msm: msm_bus: Change MDP port interleaved setting

When display driver requests bandwidth on MDP port 0, it was
automatically divided between port 0 and port 1 by the bus driver
as a part of interleaving. Since MDP port 1 was never used,
this did not have any impact.

Now, the display driver needs to use MDP port 1 such that MDP
ports should be able to use the bandwidth non-uniformally.
To enable these ports to use unequal amount of bandwidth,
it is required that bus driver does not divide bandwidth
between port 0 and port 1.
The display team is now responsible for requesting bandwidth
explicitly on both ports.

CRs-Fixed: 474499
Change-Id: I826a4c20a113a32f6d6bcf13f1c6474040f35f46
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
msm: Remove ANDROID_PMEM from the Kconfig dependencies

The PMEM driver is completely deprecated. Remove any Kconfig
that is still depending on it.

Change-Id: I3386a7eedf34213f2c644372a719ae00c65b0d6d
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
mmc: sdhci-msm: wait for SW reset to be complete

Wait for SW reset to be complete before proceeding further
in probe. Otherwise, any register writes immediately
after the reset would be ignored/reset.

Change-Id: If1c7f5debfca6f45a0fdb08bc759ad04b96fd86c
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>