asoc: msm: Add flexible period count to pcm record driver

 In pcm recording, if buffers are not requested from dsp at real
 time then dsp drops the buffers and sends partial buffers. This
 is causing record failures. Pcm record platform driver has two
 periods. If system is loaded, read request will not be at real
 time. Add flexible period count to pcm record platform driver
 so client can configure the period count.

CRs-Fixed: 467746
Change-Id: Iadd47979f7b29a01fb8e6479383094a2ed1d93c5
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
msm_fb: display: fix the hang issue caused by solidfill pipe

When mdp pipe solidfill mode is disabled, the staled pipe info is used
to update mdp pipe regs. This caused mdp hang. Since
mdp4_overlay_rgb_setup function already resets solidfill mode, this
patch removes any pipe register updates that are related to disabling
solidfill mode.

CRs-fixed: 467555
Change-Id: I23f4b29731c9097ab0cc38baa00cd35bc536d2ba
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
mmc: core: Fix some driver hangs when dealing with broken devices

There are infinite loops in the mmc code that can be caused by bad
hardware.  The code will loop forever if the device never comes back
from program mode, R1_STATE_PRG, and it is not ready for data,
R1_READY_FOR_DATA.

A long timeout is added to prevent the code from looping forever.
The timeout will occur if the device never comes back from program
state or the device never becomes ready for data.

It's not clear whether the timeout will do more than log a pr_err()
and then start a fresh hang all over again.  We may need to extend
this patch later to perform some kind of reset of the device (is
that possible?) or rejection of new I/O to the device.

Change-Id: I1f3e5fddffb5134743fbfbcdef5e97803fd25fc6
Signed-off-by: Trey Ramsay <tramsay@linux.vnet.ibm.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
msm: camera: fix the out of order of frames issue

observed that if the frame processing in the userspace
is delayed, the incoming frames from the hardware are being sent
to user before the diverted frame returns.so dropping the
the delayed postprocessing frame to prevent out of order

Change-Id: I43b0f9ea7a7683a419ce142b7d4fdf9e13d11d95
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
media: dvb: Fix calculation of next ready packet in dvb-ringbuffer

The calculation of number of bytes between the last reported
packet to the user and the current read pointer did not properly
take into account wrap-around case in the packet buffer.
Debug printouts for values returned by dvb-ringbuffer were
added for better traceability.

CRs-Fixed: 470982
Change-Id: I2765f5b1e0fbb7baed6725f2617702dd7ed87556
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
msm: vidc: Remove delayed unmap flag in ion_map_iommu()

This change fixes the iommu map failure in movie studio
application by removing the delayed unmap flag in
ion_map_iommu(). The delayed unmap will cause the
iommu buffer to be unmapped only when all the clients
unmap the buffer.

Change-Id: I9e226fd56fecfa292e4d77aa94b2883bcfbf6ec2
CRs-fixed: 464374
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Merge "media: dvb: Fix calculation of next ready packet in dvb-ringbuffer"
Merge "msm: vidc: Remove delayed unmap flag in ion_map_iommu()"
Merge "msm: camera: fix the out of order of frames issue"
Merge "asoc: msm: Add flexible period count to pcm record driver"
Merge "mmc: core: Fix some driver hangs when dealing with broken devices"
msm: kgsl: initialize kgsl_sync_timeline_ops properly

CRs-fixed: 471346
Change-Id: Ib8dccb60ead6fcecc0f9beaf271ba28199d404a2
Signed-off-by: Iliyan Malchev <malchev@google.com>
Signed-off-by: Jeff Boody <jboody@quicinc.com>
ASoC: msm: FENS Support for VOIP calls

Add support FENS for Voip calls. Support is added by adding new
Mixer control

CRs-Fixed: 460878
Change-Id: I4c05155ac1de7b8da5b5e1ae24776c3e98b353f2
Signed-off-by: Sidipotu Ashok <sashok@codeaurora.org>
Merge "msm_fb: display: fix the hang issue caused by solidfill pipe"
Merge "msm: kgsl: initialize kgsl_sync_timeline_ops properly"
Merge "ASoC: msm: FENS Support for VOIP calls"
msm: kgsl: Properly record the size of the sglist in the memdesc

It was possible to fail out of kgsl_sharedmem_alloc after a sglist was
allocated but before we saved the size of the allocation which caused
problems when the sglist was freed during cleanup.

Change-Id: Ic0dedbadd57ec4d9422b5e3a873243d0ffed51f7
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
bcmdhd: squash updated bcmdhd stack from google

net: wireless: bcmdhd: Fix SUPPORT_PM2_ONLY option for p2p
Change-Id: I1db584aa5284adc8ab156e4690891bba3a1c3b91
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcmdhd: Update to Version 1.28-27
- Disable SDIO in-band interrupt explicitly to avoid problems
  with SDIO Host when generating SDIO Interrupt on DAT1 created
  unwanted CRC error
- Fix handling when bcmsdh_probe() called twice
- Fix handling the packet list properly in the corner cases
- Remove unnecessary delay during P2P connection process
- Fix issue finding peer with VSDB
- Get AP beacon and DTIM to set proper DTIM skipping

Change-Id: I7ee923727d0c3ad34c83b5ec1dda8e2aa5ea5834
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcmdhd: Update to Version 1.28-24
- P2P: Improve provision discovery probing
- Add optional dhd_dpcpoll to improve performance
- Return proper err in wl_cfg80211_attach

Change-Id: I877fc2ff4de2e43b33fdd688cd7309924f7c3722
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcmdhd: Fix PEAP with dynamic WEP
Change-Id: I62dffdb3b759ea5ccdf9f7ea0f0e67f928ace92b
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcmdhd: Update to Version 1.28-23
- Add locale support via NL80211_CMD_REQ_SET_REG
- Fix P2P and VSDB
- Move setting for KEEP_ALIVE and PNO_LOCK into Makefile as
  CUSTOM_PNO_EVENT_LOCK_xTIME and CUSTOM_KEEP_ALIVE_SETTING

Change-Id: I4d2e7c1c72f1109cc9ca3c79b07ad76aea1fd513
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcmdhd: Postpone taking wd_wake lock
Change-Id: I3926d7a1a357d173144f408996f35f0929db711e
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcmdhd: Increase PNO wakelock to 7 sec
Change-Id: Ib4d51cb3ee1c117c645dda663e08a1ee5954c81c
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcmdhd: Fix dhd_txcomplete() dead lock
For TX packet dhd_prot_hdrpull does nothing other than pull the prot
header from the skb. Use a NULL ifdix pointer to indicate a handling
of tx packet and skip most of the header parsing routine - we don't
need it for TX packet and we can skip extra unnecessary PROP_TXSTATUS
parsing. It will resloved dead lock case because we just exit
dhd_prot_hdrpull for TX path.

Change-Id: Ic41e1c549036baeb0fabfb0be4b8331a4bf60682
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcmdhd: Avoid suspend on watchdog
Change-Id: Ic41a8f369a2ee8b2a0084e6a1cbf6b454ff53353
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcmdhd: Fix WD wakelock behavior
Change-Id: I7ebae2be248cbb4bc98e2b448641f65b77a320f4
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
M2: regulators: fixup: make RPM_VREG_ID_PM8921_S2 regulator sleep_selectable

M2: ATT: Increase frequency for RPM_VREG_ID_PM8921_S2 regulator to 2.4

(same as in stock. ATT specific change is forced in rpm-regulator.c)

Change-Id: Ib351f8f75437e85fb50ba166dcaf887fac042df5
M2: msm: simplify ifdefs (no functional change)

I made these before we had a unified "MACH_M2" (thanks invisiblek).
Looks better now.

Change-Id: Ibfd7e22267acb13eea7fc1778994affccbec196d