ASoC: wcd9xxx: Disable current source in error scenarios

Sometimes during removal, fake electrical removal interrupt
can also get generated. In that case, current source needs
to be disabled after a round of DCE measurements. Otherwise,
next time when the plug is re-inserted, measurements can go
wrong and hence plug type can be wrongly detected.

CRs-Fixed: 759634
Change-Id: I6be5ab5891bd73f63acf2ec0f03c98ccd3938936
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
ASoC: wcd9xxx: Handle fake mechanical interrupt

Handle fake mechanical interrupt during slow insertion of
headset usecase when the plug type is detected as lineout.

CRs-Fixed: 754305
Change-Id: I559309915771b633c6f1677f020459b8afc1f574
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
ASoC: wcd9xxx: Continue polling for Unsupported plug types

Sometimes slow insertion of headphone could lead to
detection of unsupported plug types. In these cases,
continue polling so that headphone can be detected
once it is fully inserted.

CRs-Fixed: 745214
Change-Id: I4fe40d1afe71a5b1f5c8e8e69ba3afe16750161e
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
ASoC: msm: qdsp6v2: set stream volume before starting it

Volume gains for a stream should be set before sending
RUN command to DSP. This will avoid any glitch in audio
which might occur because of rapid change in volume level
while setting up the appropriate volume for the stream.

CRs-Fixed: 753619
Change-Id: Ib9270929759852f671bf3677f6e4cc826997b76a
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
asoc: msm: Always send correct bitwidth to backend

 * Do it during gapless transitions too.

Change-Id: I6d4fca21fc61d21dacf908f46f2ac6abd2eb0450
cpufreq_conservative: Improve support for micro idle accounting

The minimum samplerate calculations of the current conservative
implementation assume that there is not micro idle accounting present,
however, we do have that capability in our idle estimates.  As a result,
we can support lower polling intervals just like ondemand does.

Signed-off-by: Andrew Dodd <atd7@cornell.edu>

Change-Id: I183d494a74a99d4c662554895f9eb6d9f4092162
cpufreq: conservative: Set some usable defaults
defconfig: Reenable conservative governor

Change-Id: I88ef6faf5515007115afa678477e33c71321d966
hammerhead: lcd_kcal: remove control bit

PS2: Fixed tabs

Change-Id: I9d55b4d18fe69967fd4a10a36aeab58748b1b5fe
cpufreq: interactive: Add max_freq_hysteresis feature

Previously known as sampling down factor, max_freq_hysteresis
extends the period that interactive governor will stay at policy->max.
This feature is to accomodate short idle periods in an otherwise very
intensive workload.

When the feature is enabled, it ensures that once a CPU goes to max
frequency, it doesn't reduce the frequency for max_freq_hysteresis
microseconds from the time it first goes to idle.

Change-Id: Ia54985cb554f63f8c22d0b554a0a0f2ed2be038f
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
cpufreq: interactive: Make window alignment optional

Make sampling window alignment optional when scheduler inputs
are not enabled.

Change-Id: If69c111a3efe219cdd1e38c1f46f03404789c0bb
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
cpufreq: interactive: Exercise hispeed settings at a policy level

If a heavy task migrates between otherwise idle CPUs in a policy during
every sample window, the above hispeed delay window for the CPUs would get
restarted for every sample window. Due to the continuous restart of above
hispeed delay window, none of the CPUs would ever pick a target frequency
higher than hispeed frequency. This causes the policy's frequency to be
stuck at hispeed freq even if the load justifies a higher frequency.

To fix this, the above high speed delay window is restarted only when the
policy frequency changes. This ensures that tasks migrating between CPUs in
a policy are handled correctly.

Also, the hispeed load/frequency heuristic is only necessary when the
information is insufficient to determine if the load on the CPU needs at
least hispeed frequency. When the policy frequency is already at or above
hispeed frequency, if the CPU load% based on policy frequency is not above
hispeed load, then the information is clearly sufficient to determine that
the load on the CPU does not need hispeed frequency.

Therefore, compute CPU load% (which is used only to compare against hispeed
load) based on policy frequency instead of CPU target frequency.

Change-Id: I1749d663949e34753ecb5c426a16563796f8b0b2
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
soc: qcom: rq_stats: Pass correct cpu id to update_average_load function

Pass correct cpu number to update_average_load function
from cpufreq_transition_handler function. Also avoid div by zero
condition in update_average_load function.

CRs-Fixed: 708310
Change-Id: I4ec3e54b92c760ac5fa910542524fdfe919f55e9
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Enable conservative cpu governor
Vidc hack
Revert "cpufreq: conservative: Set some usable defaults"

This reverts commit 62367983bc8b8e4c8b365d08289ccab04e9c5c4e.
Revert "cpufreq_conservative: Improve support for micro idle accounting"

This reverts commit 152e1eb45ed5ad6affdcb14534a53df838d630f2.
Revert "Vidc hack"

This reverts commit f8d398fc41c5d15860d8b85b11d20f7f92e6841c.