USB: msm_otg: Add 50 msec delay after changing scope from SYSTEM to DEVICE

When USB operate in host mode, it select SYSTEM scope.  PMIC charging
driver disable VBUS comparator upon SYSTEM scope request from USB.
scope is changed to DEVICE from SYSTEM for ID_GND-->ID_A transition.
USB request charging driver to draw current from VBUS.  Later when
charging driver receive VBUS valid interrupt, it tries to reset the
charging current as per AICL algorithm.

Add 50 msec delay after changing scope from SYSTEM to DEVICE.  This would
allow charger driver to observe VBUS valid interrupt before vbus_draw()
request from USB. Apply this delay only for ID_GND-->ID_A transition.

CRs-Fixed: 417564
Change-Id: Ic505468cddd650d9306568b377b324d523779040
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>

Conflicts:

	drivers/usb/otg/msm_otg.c

Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm_fb: display: wait4vsync after timing generator is turned off

When continuous splash is enabled, timing generator is enabled at
bootloader, it then needs to be turned off at mdp4_dsi_video_on()
to switch displayed content from frame buffer. wait4vsync after
timing generator is turned off is necessary to make sure DMAP has
finished fetching splash logo from original splash buffer. Otherwise,
DMAP iommu page fault may happen.

CRs-fixed: 434361
Change-Id: I35f9fb9da76f93b60d4719d147aea3246c770c9f
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Vivek Panwar <vpanwa@codeaurora.org>
msm: vidc: Adds VUI timing info support for AVC encoding.

Poor video quality is observed as VUI fps information is not present in
the encoded bit stream. Add support for VUI timing info in video driver
and an additional V4L2 control to set from user space.

Change-Id: I3594903cb897920ea2ef93208644ac8c6ca5d5d9
CRs-Fixed: 399017
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>

Conflicts:

	drivers/media/video/msm_wfd/enc-subdev.c
	drivers/media/video/msm_wfd/enc-subdev.h
	include/linux/videodev2.h

Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm: vidc: Set CODECCONFIG for buffers with sps/pps

The client needs a way to know if a buffer contains the sps/pps.  Hence
mark the v4l2 buffer with V4L2_QCOM_BUF_FLAG_CODECCONFIG.

Change-Id: If612a114f990eec19eab443cd9a6636db30a3c51
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
Merge "msm_fb: display: wait4vsync after timing generator is turned off"
Merge "USB: msm_otg: Add 50 msec delay after changing scope from SYSTEM to DEVICE"
ASoC: Avoid putting stream state to STOP when stream is paused

The issue is caused by the below scenerio-
1. Front-end session 1 is put to PAUSED state by user-space application.
2. DPCM framework puts front-end session in STOP state
3. Front-end Session 2 comes UP and used the Back-end.
4. Front-end Session 2 is done and releases Front-end 2 and shuts-down Back-end
as part of the tear-down of audio session.
5. Afterward, Front-end session 1 is un-PAUSED and comes in.
6. As Front-end session 1 finds the Back-end to be closed, it calls hardware
parameter callback again. This will reset all parameters keeping track of
the session.

Instead, putting the stream state to PAUSED, will avoid the Back-end from
being freed by session 2 above.

Change-Id: Ic31bf90a09b605b91f6b9fe3c09361b1145581fb
Signed-off-by: Banajit Goswami <bgoswa@codeaurora.org>
Merge "msm: vidc: Adds VUI timing info support for AVC encoding."
Merge "msm: vidc: Set CODECCONFIG for buffers with sps/pps"
ASoC: wcd9xxx: Fix MBHC irq handler deadlock scenario

There is a chance to encounter deadlock when either electrical mbhc irq
or mechanical mbhc irq releases resource lock to let polling thread finish
its job.  This is due to the possibility of one irq handler can preempt
already running the other type of irq handler.
Introduce a new mutex to avoid this preemption.

CRs-fixed: 428653
Change-Id: Idf24c62224026c9c061de12c31e248c05b47de9d
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Merge "ASoC: wcd9xxx: Fix MBHC irq handler deadlock scenario"
power: pm8921-charger: Add error handling logic

Handle return errors at multiple locations and report them
appropriately. While at it, fix functions which can report
valid negative values

(cherry picked from commit 39b644d9c6c632c53b34f620d6de8425c5987a39)

Change-Id: I69d9cb8c22a86a9cceee5b5c8868ad0a942e9e02
CRs-Fixed: 389633
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>

Conflicts:

	drivers/power/pm8921-charger.c

Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
ondemand: Add support to consider other cpu load when scaling frequencies

Currently only current cpu load is considered when frequency scaling.
As a side effect of this when scheduler migrates a thread to a slower
core, the execution time increases unexpectedly.

The new algorithm not only considers current cpu load for frequency
scaling, but also takes into account load of other online cpus. The
treshold for this can be controlled using up_threshold_any_cpu_load.
When the up_threshold_any_cpu_load is crossed in any cpu then the
current cpu is set to sync_freq.

Also, when more than one cpu is online a two step ramp-up mechanism
is used. When the up_threshold_multi_core is crossed the cpu is ramped
up to optimal_freq which is less than policy->max and set to a power
friendly value.

Change-Id: I469d6924743239e45c50255b9974c93bbea9d470
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
msm: cpufreq: increase priority of thread that increases frequencies

When the cpufreq governors request for increase in frequency from kworker
threads, there is chance that the kworker thread is cpu starved due to
other high priority threads, leading to undesirable increase in frequency
ramp-up latency. Add the calling thread to SCHED_FIFO policy when
requesting for increase in frequency and restore back to original policy
after ramp-up is completed.

Change-Id: Ie4fa199b7f9087717cb94dfcc2eddea27cc0012b
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
Merge "power: pm8921-charger: Add error handling logic"
Merge "ASoC: Avoid putting stream state to STOP when stream is paused"
Merge "ondemand: Add support to consider other cpu load when scaling frequencies"
Merge "msm: cpufreq: increase priority of thread that increases frequencies"
msm: rotator: Support Fast YUV for 8960, 8064 and 8x30 targets.

Add Fast YUV support in rotator for 8960, 8064 and 8x30 based
targets to improve performance for YUV 420P and 420PP inputs.

(cherry picked from commit 27147a768fc84d8819a83445fd5bb9f5c0d0627b)

CRs-fixed: 415246
Change-Id: Ib4cbbd0fd45a82b8d409e7f52ae8bf8420b2c4eb
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Merge "msm: rotator: Support Fast YUV for 8960, 8064 and 8x30 targets."