ASoC: msm8960: Change boot sequence of msm-pcm-hostless platform driver.

The driver sound/soc/msm/msm-pcm-hostless.c is registered very late
in the sequence and hence the SOC framework keeps polling repeatedly
for it adding to latencies.

CRs-fixed: 428455
Change-Id: I973cc77e5f41a1ce32c2c74a1055efaadbae6dab
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
msm: 8974: Update priorities of System NoC masters

This patch changes the priority settings for System NoC masters
based on the latest recommendations from systems' team.

Change-Id: I9af571f8fb8e496b138bcb0552dbfc30adf4a4c6
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
msm: clock: Fix clk_set_parent()

- Update the clk->parent field when the operation succeeds.
- Grab the prepare lock when changing the parent. This is necessary to
  avoid race conditions between clk_set_parent() and clk_prepare(),
  clk_unprepare() and clk_set_rate(). Luckily, as of now, only the measure
  clock supports clk_set_parent(). So, this is not a real issue in a
  production device. Each set_parent op still needs to deal with
  grabbing/releasing the enable lock at the right time.
- If a clock doesn't support clk_set_parent() return an error instead of
  silently failing.

Change-Id: I5fdd6a7bb44bb924dc9aabd7119a03520617e3d1
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
msm: camera_v2: Add a macro

To support dual VFEs the configuration pataremer entries size
need to be doubled

Change-Id: I16f877ce207f093a60228da23434efe08c88840c
Signed-off-by: Mingcheng Zhu <mingchen@codeaurora.org>
ASoC: msm: Update msm pcm drivers to support 192KHz playback

Update the backend drivers and the dai's for front end
to support 192 KHz sample rate for the playback path

Change-Id: I1b3f1fab8c08baa85ed71be4ccc7968b63b75489
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
ASoC: msm8974: Update mixer control to support 192KHz

Update existing mixer control to set the sampling rate
on the backend to support 192KHz sampling rate.

Change-Id: Ib3bc001073ef4d91a9398cb0871c237e3fc6b50b
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
msm: camera:v2: config PIX0 line buffer enable bit

When enable dual VFE crop, the VFE0's PIX interface's line buffer
needs to be enabled.

Change-Id: I64fed15d0326ba40d2ad84d04e9f7270a0a07d75
Signed-off-by: Mingcheng Zhu <mingchen@codeaurora.org>
arm/dt: msm8610: Add SMP2P force-stop and error-fatal entries

The pil-q6v5-mss driver needs to monitor two GPIOs to be
notified of modem crashes and to inform the modem to shut
down in the event of an apps crash. Add the necessary DT
properties to support this.

Change-Id: Id263a2d063fb42152603257527ccf0a89ac4c8c7
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
msm: vidc: Remove all use of subsystem map api

Subsystem map api is deprecated and will be removed.
It is no longer being used.

Change-Id: Ib4b7d1e982f4ec634d06c0d895656071e7c10b14
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
msm: Remove subsystem map api files

Subsystem map api has been deprecated and is no longer
being used.

Change-Id: Id7c8f1410719fd00ea8b8ca1819d7a6f3fd40d8a
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
msm: vidc: Do cache operations without kernel virtual address

Kernel virtual address space is limited and video buffers are
huge for some resolutions like 3840 X 2160. Mapping these buffers
in kernel virtual address space can fail. Kernel mapping was
required earlier to flush/invalidate the cached buffers. This
mapping is no longer needed as per the recent change in caching
api.

Change-Id: I228519ed11343d4a1f0d8ffd6513fd3ab84bb1c9
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
msm: acpuclock-8974: Add support for Speed Bin 2 (2150.4MHz) parts

Add the 7 PVS bin tables for the new speed bin.

Change-Id: I68e71ba218ddd1892fc3f60080fd7e5b05461ca8
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
jbd2: fix assertion failure in jbd2_journal_flush()

The following race is possible between start_this_handle() and someone
calling jbd2_journal_flush().

Process A                              Process B
start_this_handle().
  if (journal->j_barrier_count) # false
  if (!journal->j_running_transaction) { #true
    read_unlock(&journal->j_state_lock);
                                       jbd2_journal_lock_updates()
                                       jbd2_journal_flush()
                                         write_lock(&journal->j_state_lock);
                                         if (journal->j_running_transaction) {
                                           # false
                                         ... wait for committing trans ...
                                         write_unlock(&journal->j_state_lock);
    ...
    write_lock(&journal->j_state_lock);
    if (!journal->j_running_transaction) { # true
      jbd2_get_transaction(journal, new_transaction);
    write_unlock(&journal->j_state_lock);
    goto repeat; # eventually blocks on j_barrier_count > 0
                                         ...
                                         J_ASSERT(!journal->j_running_transaction);
                                           # fails

We fix the race by rechecking j_barrier_count after reacquiring j_state_lock
in exclusive mode.

Reported-by: yjwsignal@empal.com
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@vger.kernel.org

CRs-Fixed: 468318
Change-Id: Ibe417ee5c50e257b7521b5ce8bbfa4e13547d4c5
Git-commit: d7961c7fa4d2e3c3f12be67e21ba8799b5a7238a
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Taniya Das <tdas@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>
power: qpnp-bms: Prevent SOC jumps while charging

The BMS driver scales the SOC while charging based on the charge
current. It does not scale when it sees that the battery voltage at
terminals have fallen 10mV below the max current, the reason being a
current spike that causes the voltage to droop.

However there is a corner case when the voltage could droop but not by
10mV. In this case the BMS will report a higher SOC value, since the
charge current most likely has reduced.  This is incorrect.

Fix this behavior by showing the previous SOC value under severe system
load while charging. Note that when the vdd max adjusting algorithm in
charger reduces the vdd max value, the battery terminal voltage reduces
causing this scheme to treat it as a current spike. This is fine as it
will scale SOC correctly the next time it does a calculation.

Change-Id: I7b7e2c07a1acee7a4af0309ebd5d7968cbf5a774
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
msm: mdss: Avoid delay in framebuffer registration

Change framebuffer driver init to 'module_init' to
make framebuffer registration to happen earlier. This is
needed for few configurations where we want
to display image as soon as the kernel starts booting.

Change-Id: Ibe7cda8304a9e16ee50a3043b822517a71a23498
CRs-Fixed: 453847
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
msm: mdss: clear vsync interrupt bit before wait for completion

When kickoff happens, MDP needs to ensure that a vsync has happend after
flush. To ensure this, MDP driver needs to clear any pending vsync
interrupts after writing to flush to ensure that vsync has happened
and the shadowed registers have been swapped (at vsync boundary). This
addressed possible concurrency issue where vsync interrupt happens just
before flush but irq handler does not process it until after, leading to
iommu page fault.

CRs-Fixed: 465340
Change-Id: I0f8412386c76fc6409e95f316f54999f42b09be5
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
arm/dt: msm8610: Enable SPM only when we enter low power mode

On some hardware if the core is held in reset SPM state machine
starts execution. As a result, enabling SPM before programming the
SPM sequence could result in SPM executing its low power mode state
machine while the core is still held in reset. Disable SPM by
default as it gets enabled when we enter low power mode.

Change-Id: I34393ded3721503da1382492d1894424367d5e3e
Signed-off-by: Priyanka Mathur <pmathur@codeaurora.org>
arm/dt: msm8610: Update SPM configuration

Update SPM sequence for 8610 as per latest HPG. Also
remove the sequence corresponding to L2 GDHS as it is
not supported on the hardware yet.

Change-Id: I9e721490c0e5e98c8f97e0e8af43b8340f33b046
Signed-off-by: Priyanka Mathur <pmathur@codeaurora.org>
input: synaptics_fw_update: Remove hardcoded firmware image name

Firmware name should be passed in based on target, not hardcoded.
Remove hardcoding and add appropriate error checking for this.

Change-Id: Ia95bf2abf8a86adc649d64d757f22d84c8e0053f
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>