msm: Asoc: audio: Migrate to ION from pmem, dma alloc

-Voice driver and RT proxy driver are using Pmem and
DMA alloc. Migrate them to use ION memory to save memory
and avoid stability issues.

CRs-Fixed: 369303
Change-Id: If58b69b9f8b7b03661a36451c1a5c27885fbf976
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
msm: memory: Use standard cache routines

Convert custom clean, flush, and invalidate cache routines to use
standard ARM cache routines.

Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
(cherry picked from commit 29bb4d5fa7a285c8fb5d5db55225dab700b80419)

Change-Id: I2c83c27e55811a42fdfdbca08c3db772c5c83e15
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
gpu: ion: Use standard cache routines

Instead of using custom routines for cache operations use the
standard operations for cache flush, cache clean, and cache
invalidate. In addition only call outer cache routines if
outer cache is available.

Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
(cherry picked from commit 85c95406680ce1a959a9b8cdb5aff7afcd699038)

Conflicts:

	drivers/gpu/ion/ion_system_heap.c

Change-Id: Ic56c50b502fedf921cb77d4fb87b0d2763fcd010
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
mmc: msm_sdcc: allow auto prog done detection

Multiblock write command may not always necessary prefixed with
CMD23 (SET_BLOCK_COUNT) or followed by CMD12 (STOP_TRANSMISSION).

So this patch will enable the auto_prog_done for such multi block
write transfers as well.

CRs-fixed: 365355
Change-Id: Ie2980b00a4a57ef4484bd350c3ac42bb2956d972
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>

Conflicts:

	drivers/mmc/host/msm_sdcc.c

Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
msm_fb: display: Flush pipe registers before staging the pipe

Flush pipe registers before staging the pipe for the Mixer with
pull mode panel interfaces. This fixes the IOMMU page fault/underrun
caused by pipe fetching previously unmapped buffers due to missing flush
calls

CRs-Fixed: 356484
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
(cherry picked from commit cfd004fa326a6dc4c7e80da707248b5bddaa39b8)

Conflicts:

	drivers/video/msm/mdp4_overlay.c

Change-Id: I830ef580bf2eb51d83396f1b177ea530fe68eb2f
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
USB: OTG: msm: Fix inconsistent lockdep state warning

=================================
[ INFO: inconsistent lock state ]
3.0.21-g51ce160-00021-g8b33780-dirty #2904
---------------------------------
inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W}

kworker/0:1/32 [HC0[0]:SC0[0]:HE1:SE1] takes:
 (&irq_desc_lock_class){?.....}, at: [<c01cfd10>] irq_read_line+0x3c/0x80
{IN-HARDIRQ-W} state was registered at:
  [<c01b8768>] __lock_acquire+0x704/0x9f8
  [<c01b9034>] lock_acquire+0x10c/0x130
  [<c0833ac8>] _raw_spin_lock+0x44/0x54
  [<c01d1c30>] handle_fasteoi_irq+0x14/0x108
  [<c01ce8ac>] generic_handle_irq+0x28/0x3c
  [<c0106f6c>] handle_IRQ+0x7c/0xc0
  [<c0100458>] gic_handle_irq+0xac/0x104
  [<c0834798>] __irq_svc+0x58/0x8c
  [<c01070b4>] default_idle+0x28/0x2c
  [<c010742c>] cpu_idle+0x8c/0xf4
  [<c0808ddc>] rest_init+0xd8/0x100
  [<c0008a90>] start_kernel+0x464/0x4d8
  [<8020803c>] 0x8020803c

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&irq_desc_lock_class);
  <Interrupt>
    lock(&irq_desc_lock_class);

 *** DEADLOCK ***

2 locks held by kworker/0:1/32:
 #0:  (events_nrt){.+.+..}, at: [<c019c49c>] process_one_work+0x1f8/0x518
 #1:  ((&motg->sm_work)){+.+...}, at: [<c019c49c>] process_one_work+0x1f8/0x518

stack backtrace:
[<c010c798>] (unwind_backtrace+0x0/0x12c) from [<c01b53bc>]
[<c01b53bc>] (print_usage_bug+0x248/0x2ac) from [<c01b5804>]
[<c01b5804>] (mark_lock+0x3e4/0x6ec) from [<c01b87f4>]
[<c01b87f4>] (__lock_acquire+0x790/0x9f8) from [<c01b9034>]
[<c01b9034>] (lock_acquire+0x10c/0x130) from [<c0833ac8>]
[<c0833ac8>] (_raw_spin_lock+0x44/0x54) from [<c01cfd10>]
[<c01cfd10>] (irq_read_line+0x3c/0x80) from [<c04e79b8>]
[<c04e79b8>] (msm_otg_sm_work+0x1a0/0x1510) from [<c019c57c>]
[<c019c57c>] (process_one_work+0x2d8/0x518) from [<c019cb94>]
[<c019cb94>] (worker_thread+0x220/0x3a0) from [<c01a2a80>]
[<c01a2a80>] (kthread+0x88/0x94) from [<c0107008>]

CRs-Fixed: 370876

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
(cherry picked from commit 431771e5684a35f9ff8f385a8d391e4076b30fdf)

Change-Id: Ida254b3bd839e592d37bd7aad1135ffe17008c4d
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm_fb: hdmi: Guard HDMI related functions

HDMI dependent functions need to be guarded under HDMI panel
macro to avoid compilation errors for non HDMI builds.

CRs-Fixed: 366864

Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
(cherry picked from commit 43a72fb470785c90534ba4de964dcd4d3de1ba5c)

Change-Id: I22a7a56bf23d8b8c2f4fdabd7f9c14024f55cc23
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
Bluetooth: Check for NULL pointer dereference

The fix in commit ff9718f8254b96dc313dd998c195c1c3769417ba was not
complete.  In l2cap_logical_link_complete the socket pointer was
dereferenced in two places, the previous fix only handled one of
the locations.

This fixes an infrequent crash when performing OPP or FTP transfer
over AMP (Bluetooth 3.0+HS).

CRs-fixed: 360758

Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
(cherry picked from commit 6bba008fbead844722c5dc80b6c4dd59adc637c9)

Change-Id: I311f656682335b43a324710d9224c91b27329cc9
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
radio: iris: Add calibration mode

Do not queue the FM enabled/disabled events
while calibration is in progress

CRs-Fixed: 358229
Signed-off-by: Ayaz Ahmad <aahmad@codeaurora.org>
(cherry picked from commit c1e6a95c31cc474f809bb7ab3c036e8890be7709)

Change-Id: Ied803ecc284cbcdec036b4b4935db5ffcf5193b3
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm: vidc: Fixes bug in handling duplicate frames.

Fixes bug while closing encoder which supports
duplicate input frames. This fix decrements
the reference count of original frames
appropriately.

CRs-Fixed: 366268
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
(cherry picked from commit af4a0ef0c6162e89c063b04da0a037246fcc76b9)

Change-Id: Icf36d82e78588bf4b5becf480bdccd4c7cda94a5
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm: wfd: Flush encoder before stop.

Flushes the encoder before stop to make
sure that encoder does not hold on to
any input/output buffers.

CRs-Fixed: 366268
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
(cherry picked from commit b6dd587b602ab3cf7149fa609cf912820d643577)

Change-Id: Ied753e48376a4a9835b5d598a847341f8d0c0816
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm: vidc: Invalidate the cache before processing metadata.

- Encoder output bit stream is getting corrupted if cache
  is not invalidated before meta data processing.
- ION_IOC_INV_CACHES is called before meta data processing
  to make sure physical data & cached data are the same.

CRs-Fixed: 358392
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
(cherry picked from commit 999a4d94539cbf3e7deb68c61b1539fcba15964d)

Conflicts:

	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_interrupt_handler.c

Change-Id: I759ad9ca8407d98c810691a905f5b3e9d92e9301
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm: sps: add flexible memory allocation for desc cache

When a descriptor FIFO is large, the cache for descriptors also requires
relatively large memory allocation. Use vmalloc for this case. For the
small memory allocation, still use kmalloc.

CRs-Fixed: 369996
Signed-off-by: Yan He <yanhe@codeaurora.org>
(cherry picked from commit 55f35cf5b78b4f5ef74843c45201568854719343)

Change-Id: I44fcb62436c964dc9fbddf4c0a930b41cd98456d
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
tspp: 8960: adding TSPP driver for 8960

Board file changes required for adding TSPP support to 8960
For more information on TSPP, please refer to:
Documentation/arm/msm/tspp.txt

CRs-fixed: 334732
Signed-off-by: Joel Nider <jnider@codeaurora.org>
(cherry picked from commit 266a2648d9828258108c16545e62459149c50323)

Change-Id: Ic8283ec563f5633d1b8d1a164ac105f03c10518a
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Merge "mmc: msm_sdcc: allow auto prog done detection" into ics_chocolate
Merge "msm: Asoc: audio: Migrate to ION from pmem, dma alloc" into ics_chocolate
Merge "msm: memory: Use standard cache routines" into ics_chocolate
Merge "gpu: ion: Use standard cache routines" into ics_chocolate
Merge "USB: OTG: msm: Fix inconsistent lockdep state warning" into ics_chocolate
Merge "msm: sps: add flexible memory allocation for desc cache" into ics_chocolate