msm: camera: Add statistics support for concurrent ISP

For image statatistics for concurrent ISP, we
collect statistics for a single camera sensor from
two ISP hardware. A single buffer is passed from userspace
and share between two ISP hardware using different buffer
offset. When both hardware are done with the buffer,
a stats done event will be send to userspace.

Change-Id: Ia129fbfc082c8d348db0d2765dddeb8d442c931f
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
msm: camera: Add buffer queue lock

Add lock to provide synchronization when two ISPs
are sharing the same buffer queue during single
camera dual ISP usecase.

Change-Id: Iede4a326da7506e7554dcc00b42fff1f47416b8f
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
Merge "msm: camera: Multiple instance support for actuator driver"
Merge "msm: camera: Use info about VFEs in ISPIF"
Merge "msm: camera: define ISP0 and ISP1 bit to seperate 2 ISP"
Merge "msm: camera: Add support for concurrent ISP"
Merge "msm: camera: Add statistics support for concurrent ISP"
Merge "msm: camera: Add buffer queue lock"
arm/dt: msm8974: Revert back to V1 SPM Sequence.

The V2 SPM sequence expects the Hardware Sequencer to be initalized.
The HW Sequencer initialization in software is incomplete.
Switch to the V1 sequence until the HW Sequencer is ready to be used.

Change-Id: Icf11107d74dbbce2f1aff36b09b75c35f5859c26
Signed-off-by: Karthik Parsha <kparsha@codeaurora.org>
Merge "arm/dt: msm8974: Revert back to V1 SPM Sequence."
msm: msm_bus: Move Krait to Priority 0

This patch changes the rd/wr priority of Krait ports
to 0. This is required to avoid underruns as the MM
NoC seems to have a bug due to which it doesn't
propagate the priority levels correctly.

Change-Id: I703e930e8da94f0b276a8686c3384189c4feffbe
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
Merge "msm: msm_bus: Move Krait to Priority 0"
Merge commit 'AU_LINUX_ANDROID_JB_MR1_RB1.04.02.02.50.045' into HEAD.

* commit 'AU_LINUX_ANDROID_JB_MR1_RB1.04.02.02.50.045': (45 commits)
  msm: msm_bus: Move Krait to Priority 0
  arm/dt: msm8974: Revert back to V1 SPM Sequence.
  msm: camera: Add buffer queue lock
  msm: camera: Add statistics support for concurrent ISP
  msm: camera: Add support for concurrent ISP
  msm: camera: define ISP0 and ISP1 bit to seperate 2 ISP
  msm: camera: Use info about VFEs in ISPIF
  msm: camera: Multiple instance support for actuator driver
  msm: pm-8x60: Switch to using udelay in msm_pm_wait_cpu_shutdown
  msm: gdsc: Increase EN_FEW_WAIT to decrease in-rush current
  Revert "power: qpnp-bms: estimate OCV when a new battery is inserted"
  gpu: ion: Don't have a mapping for secure buffers
  arm/dt: msm8974: Add a low power level with XO on and L2 off
  msm: acpuclock-8974: Add PVS voltage table support for 8974v2 CPUs.
  arm/dt: msm8974: Remove PLL commands for Standalone PC
  msm: vidc: Fix bug in shared queue access
  msm: jpeg: Fix regulator deinit sequence
  msm: camera: Change func select for gpio pins
  msm: camera: Fix for QOS settings
  msm: camera: Increase max ISP buffer queue
  ...

Change-Id: I8afdd8d0b35a44f9c06a7d5b4ea57f3b41e802cf
Signed-off-by: Sridhar Nelloru <nellos@codeaurora.org>
Revert "cma: use MEMBLOCK_ALLOC_ANYWHERE for placing CMA regions"

This reverts commit 6308fd5399ae93e35ac381825a279996264a5f78.

As an optimization for kmap/kunmap, the page table entries may
not be completely removed on kunmap. This causes a problem
when memory is XPU protected and the CPU speculates into the
virtual address map. There are functions to remove zero
count entries for kmap calls but kmap_atomic is handled separately.
Remove CMA from highmem until an effective strategy for removing
these entries is found.

Change-Id: Ic60a34401244182442fc6d11dd0cdf986be7a335
CRs-Fixed: 467508
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
(cherry picked from commit 74ab7c1e198200036a84acd88c28ee9a441e5167)
power: qpnp-bms: always clamp SoC based on voltage

The BMS inaccuracies are still blocking people in testing. Remove the
workaround hardware check to always clamp SoC based on voltage.

Change-Id: Iba930f2ae1668105bacbdea5aee386fbe89724c1
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
(cherry picked from commit 445d249f4c19ebcfedf2c31db594d73d93efa042)
Merge "Merge commit 'AU_LINUX_ANDROID_JB_MR1_RB1.04.02.02.50.045' into HEAD."
Merge "Revert "cma: use MEMBLOCK_ALLOC_ANYWHERE for placing CMA regions""
Merge "power: qpnp-bms: always clamp SoC based on voltage"
Merge commit 'AU_LINUX_ANDROID_JB_MR1_RB1.04.02.02.50.047' into HEAD

* commit 'AU_LINUX_ANDROID_JB_MR1_RB1.04.02.02.50.047': (47 commits)
  power: qpnp-bms: always clamp SoC based on voltage
  Revert "cma: use MEMBLOCK_ALLOC_ANYWHERE for placing CMA regions"
  msm: msm_bus: Move Krait to Priority 0
  arm/dt: msm8974: Revert back to V1 SPM Sequence.
  msm: camera: Add buffer queue lock
  msm: camera: Add statistics support for concurrent ISP
  msm: camera: Add support for concurrent ISP
  msm: camera: define ISP0 and ISP1 bit to seperate 2 ISP
  msm: camera: Use info about VFEs in ISPIF
  msm: camera: Multiple instance support for actuator driver
  msm: pm-8x60: Switch to using udelay in msm_pm_wait_cpu_shutdown
  msm: gdsc: Increase EN_FEW_WAIT to decrease in-rush current
  Revert "power: qpnp-bms: estimate OCV when a new battery is inserted"
  gpu: ion: Don't have a mapping for secure buffers
  arm/dt: msm8974: Add a low power level with XO on and L2 off
  msm: acpuclock-8974: Add PVS voltage table support for 8974v2 CPUs.
  arm/dt: msm8974: Remove PLL commands for Standalone PC
  msm: vidc: Fix bug in shared queue access
  msm: jpeg: Fix regulator deinit sequence
  msm: camera: Change func select for gpio pins
  ...

Change-Id: I0694fad3ab91c0f7bdc258c2a72bfdb788d2d570
Signed-off-by: Sridhar Nelloru <nellos@codeaurora.org>
arm/dt: 8974: disable charging for Fluid and MTP

Having charging enabled on Fluid and MTP devices
causes resets caused by DC supplies emulating
VBAT on provided large debug boards for the platform.

While battery presence continues to be emulated on
these boards disable charging by default to avoid
above mentioned resets.

Change-Id: Ieb5238d80866f1cd9e36281ce2c6fa766603a1b3
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
(cherry picked from commit e37b579e1b481cd34716e3a8e444cc71ae08e2ea)