msm_fb: display: add wait for overlay0 done

Dcs command mode BLT involves both overlay0 done interrupt
and dmap done interrupt. A transaction is start at kickoff and
end with done interrupt.  At some cornor cases both overlay0 and
dmap transaction need to be completed before kickoff new transaction.

Change-Id: I5a3cc6e8255acf2c61fc627d35f990182d226f63
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
msm_fb: display: add mutex on overlay_play to fix iommu page fault

An iommu page fault may heppen When a pipe_commit is executed
in between of frame dropped and pipe_queue during overlay play.
An mutex is necessary to mutual exclusive between pipe_commit
and overlay_play.

Change-Id: I736e821c6c648a6ebd435303a1906a40e9b75791
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
EHCI: HSIC: Use counter for timeout in ulpi_read()

ulpi_read() relies on jiffies to calculate the timeout
for read operation on phy register. Calling ulpi_read()
with interrupts disabled, freezes jiffies on local processor.
In case of phy lockup this results in infinite loop leading
to watchdog reset. Use loop counter for timeout instead of
jiffies for read operation to avoid watchdog reset.

CRs-Fixed: 388234
Change-Id: I1d46052b087c42b9f422b6f7eb691498fa104718
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
msm: mdm: Disconnect peripheral(hsic) before powering down the MDM

Powering down the MDM before disconnecting HSIC can cause PHY lock
due to bus-errors. Hence remove the hsic controller device before
resetting external modem.

CRs-Fixed: 388234
Change-Id: Ia22451cfcc4d9ef8a41348a8b0f02960c068c74b
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
msm: smd_tty: use pm_qos for bt performance.

A2DP audio skips out every 8-10 seconds in idle.
cpuidle is working and sometime A2DP audio skips in that time.

Use pm_qos to avoid this problem.

Change-Id: I00701c89cb9d5723e17928f452696db21e107ab0
Signed-off-by: Iliyan Malchev <malchev@google.com>
mako: Fix unbalanced disables for vibrator

[ 3101.348816] amp_enable: AMP_EN is set to 1
[ 3102.875995] ------------[ cut here ]------------
[ 3102.879749] WARNING: at android/kernel/drivers/regulator/core.c:1590 _reg
[ 3102.879779] unbalanced disables for 8921_l16
[ 3102.879779] Modules linked in:
[ 3102.879810] [<c0014380>] (unwind_backtrace+0x0/0x11c) from [<c007159c>] (
[ 3102.879810] [<c007159c>] (warn_slowpath_common+0x4c/0x64) from [<c0071634
[ 3102.879840] [<c0071634>] (warn_slowpath_fmt+0x2c/0x3c) from [<c02c5010>]
[ 3102.879871] [<c02c5010>] (_regulator_disable+0x30/0x23c) from [<c02c523c>
[ 3102.879871] [<c02c523c>] (regulator_disable+0x20/0x58) from [<c005bdcc>]
[ 3102.879901] [<c005bdcc>] (vibrator_power_set+0xfc/0x150) from [<c033fcb4>
[ 3102.879932] [<c033fcb4>] (android_vibrator_force_set+0x88/0x11c) from [<c

Change-Id: I54987c842384bd23b5daecddd6440d0ad0857523
switch: fsa8008: show error and warning messages

error and warning messages should be displayed. and add some missing
error handling.

Change-Id: I26d08f02e2e181670733aec78f8b128748961884
ASoc: Reduce number of periods in low latency driver.

- Reduce number of periods to 2 from 4.

Signed-off-by: SathishKumar Mani <smani@codeaurora.org>
ASoc: msm: Update platform drivers to correctly access audio_client

Update platform driver open function call to access
audio_client pointer only after allocation to avoid crash.

Signed-off-by: SathishKumar Mani <smani@codeaurora.org>
Revert "msm: vidc: Correct calculation of yuv buffer size"

This reverts commit 3a2945ef2385ae934ab4df98f26651d132b7b4fc.
[ARM] usb: msm_otg: correctly report charging status

Change-Id: I90cfe1f9450833e4f8883705f30b906c61d95926
Signed-off-by: Iliyan Malchev <malchev@google.com>
power: charger: get the current information from usb-otg

usb_otg is able to know what kind of charger is connected like as
USB, TA and  Slimport. And we can decide the max charging current
by cable type. pm8921-charger is able to use this information.

And unplug_check_worker has some problem. Wrong charging current
might set as 100mA even thought USB charger can be set by max 500mA.
It cause very slow charging.

msg_otg didn't use power supply api properly due to not supported
some POWER_SUPPLY_PROPs in pm8921-charger.c. It's also fixed.

Change-Id: I86661fbe38e3db5522caab6ff316c0100f87fe0d
leds: pm8xxx: change calculation of blinking period and on/off timing

Change-Id: I6adae65ae692c0a3d79bc45356ba8f880b3d00f3
Signed-off-by: Iliyan Malchev <malchev@google.com>
msm: hsic: Retry port RESUME if unable to send SOFs within 3ms

Due to h/w bug in hsic controller, interrupts are disabled during
resume signalling (~20ms), commit: e404049ae, which may result in
below issues
1. Delayed MDP interrupts causing display stutters
2. Since default workqueue disables preemption for 20ms, the kernel
   scheduler schedules out the worker thread for long time. It results
   in MDM crash due to delayed response
To avoid busy loop, port resume is performed without disabling the
interrupts. Due to this if resume time constraint is not met then
don't start SOF and retry RESUME after some time. This delay (w/o SOF)
lets the device to enter SUSPEND state (after issuing remote wakeup)
and followed by RESUME after sometime. Also, Move the resume code to
hsic controller driver to avoid changes to ehci upstream code.

CRs-Fixed: 383752
Change-Id: Ic4768587bbb9a00d8cf495065ec9e14c46a5c1d4
Signed-off-by: Vamsi Krishna <vskrishn@codeaurora.org>
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
msm: usb: fix mdm bridge channel mismatch when disconnecting

The bridge_disconnect assumed the internal channel id in pre-defined order,
which was not matched with the actual usb_interface to be disconnected.
Due to this, other internal resources were freed unexpectedly and caused
occasional crash during reset and power off.

Implemented new routines for matching usb_interface and internal channel id
to free proper resources when bridge_disconnect is called.

Change-Id: I0ca604423dd36928f99fad3e21a24ed4699f96c3
camera: imx111(rear): fix unsupported packet format error in csic

Change-Id: I5d9385f4850fc50ce8004424cef2d129ed5c56a6
Merge "gpu: ion: Add compatibility with future changes" into android-msm-mako-3.4-wip
Revert "mako: pmic: store Real Time Clock(RTC)"

QCT recommand that rtc_write_enable value should be disabled.
Because other subsystem are dependent on rtc from pmic,
and forcing it to different value may cause unexpected problems
on other sub system.

This reverts commit fe1ef3b68f671e7857dd6f2ca001e628333c75d4.
power: charger: fix fluctuation between charging and not charging

commit 8126554cf049d13f4dd2d815d86ea289efdc6f3a has fluctuation issue
between charging and not charging. It fixes this issue.

Change-Id: I1cc2f3b51b5c1077b5d317ce324e0ce05a616977
Merge "camera: imx111(rear): fix unsupported packet format error in csic" into android-msm-mako-3.4-wip