msm: pm-stats: add suspend stats reset handling

Add suspend stats reset handling to reset suspend_stats
counters and time when sending the reset command.
"echo reset > /proc/msm_pm_stats"

CRs-fixed: 610602
Change-Id: I80be31815b25ce967b50a1d0f2384250b5438420
Signed-off-by: Anil kumar mamidala <amami@codeaurora.org>
ASoC: wcd9xxx: Report lineout immediately

If extension cable is inserted into the jack, it
is taking 5 sec to report the insertion. Reduce
this delay by reporting high headphone immediately.

Change-Id: I904f232ede585c39c6b600692ddb8750b848ebcd
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
ASoC: wcd9xxx: Notify mbhc when TX1/IN1 path is enabled

Notification is sent to mbhc whenever TX1/IN1 path is used
for audio capture. MBHC then will switch to VDDIO if headset
is inserted. This is to avoid polling noise that gets captured
in the recorded audio due to noise coupling in hardware b/w
TX2 and TX1 paths.

Change-Id: Iac40f41572d1417d2afdc55438d86c047710824f
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
msm:qdsp6v2: Check null pointer on userspace data argument in kernel

The null pointer check is required to ensure that userspace data
in kernalspace is not null.

Change-Id: I9e522c393ae643626a4bae03731a73f5d6db6458
CRs-Fixed: 563752
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
ASoC: wcd9xxx: Fix RX Ear register gain values

Rx Ear Gain register on WCD9306 supports different gain
values from 6DB to -12DB. It was wrongly configured with
2DB. This change fixes the issue and adds support for
correct gain values for Ear PA Gain.

CRs-Fixed: 520688
Change-Id: I6493cf63a1d36d9c9c0a3086b645b92f8c3de588
Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
ASoC: dapm: Change mutex lock subclass in dapm

Address the compilation issue by changing the subclass
enum in mixer/mux power update dapm functions

Change-Id: I3946cf2a5c6a0b469378d5c0583fd9c8567d4b70
CRs-Fixed: 567030
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
ASoC: dapm: Fix race condition in dapm

Dirty widget list can be accessed by multiple
paths in dapm framework. Dirty list is protected by
dapm mutex. Since stream_event function accesses the dirty list,
it should acquire dapm mutex instead of codec mutex.

CRs-fixed: 593141, 596103
Change-Id: I9f41bf436b41ba9b4fa3bb447035fd1fe262e76b
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
ASoC: msm: Add support for AAC decode in ADTS format

- Set AAC format based on the format value set in
  compress params
- Default is RAW AAC

Change-Id: I4815fdfa0bc0716a44cde0c4440eaa15180c03fc
Signed-off-by: ApurupaPattapu <apurupa@codeaurora.org>
ASoc: msm : update speaker gain control.

Configuring speaker max gain as 8 in the SPKR_DRV_GAIN register.
Other wise the gain setting when the invert flag is set will differ.

Change-Id: I18ae30c4035088fd439ae00bba2a34aa4e9385a9
CRs-Fixed: 593181
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
ASoC: msm: Send endpoint parameters for DDP decoder

DDP decoder requires end point parameters to be configured or
updated based on the input clip configuration or as updated by
the user through set parameter. Add support for the same

Change-Id: I1d331b4be27d67e1da5b3a03cfaff161e5fd1550
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
ASoC: wcd9xxx: Mute during Impedance detection

Verify HPH PA state before disabling PA to avoid mute
during headset impedance detection

CRs-Fixed: 578022
Change-Id: I156410c92507b20690c7576bed830563107c0d22
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
ASoC: msm: qdsp6v2: Add meaningful labels

Add meaningful labels to goto on error
conditions in config_debug_fs_init(). Also
added more robust error handling in same
function.

Change-Id: I160bd921e3a43a30f2bf40f532be675c1134716b
CRs-Fixed: 575229
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
ARM: dts: msm8974: Configure micbias3 voltage to 2.7V

Configure micbias3 voltage to 2.7V that powers up
ANC mic lines and to support detection of the ANC
mic using MBHC.

Change-Id: Ifa75dc4b5c6b10662830e0db391f606d2cf69682
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
diag: Add new polling command

Diag driver should now support a new polling command for the tools
to recognize the target.

Change-Id: Ia7966cc74c5c74693cebfd64b178831e5ca6f2dd
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
usb: f_qc_rndis: Correct SSUSB descriptor with IAD information

Currently SSUB descriptor is using rndis.c related descriptor
which is not being updated at binding time. Hence windows host
is not able to load RNDIS driver identifying both Control and
Data Interfaces. Update the same which is being updated and used
by qc_rndis.c file to resolve this issue.

Change-Id: I6788059bf247dc5f767970ef76a10351ed83dbb1
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
ARM: dts: msm: Add the hardware jack setting for all boards

Headset jack can have 4-pole or 5-pole or 6-pole.
Add device tree setting to distinguish these jacks.

Change-Id: I51835bb082346f672350dda08832670b71e8387a
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
msm: lpm_levels: return new idle level to cpuidle framework

Need to return the new idle level to cpuidle framework
but just returned input value argument 'index' which is
not used actually at lpm_cpu_power_select().

CRs-fixed: 601636
Change-Id: Iabd182eeb4fbdc67f4e07b40a1b593471cf8cbdf
Signed-off-by: Anil kumar mamidala <amami@codeaurora.org>
slim_ngd: Handle runtime-pm resume error gracefully

Runtime-pm resume for satellite driver may fail if ADSP is going
through subsystem-restart. Handle that error, and set runtime-pm's
status to suspended if resume fails. Resume typically fails due to
failure to wake slimbus from pause_clock. Make sure another wakeup
can be tried later when ADSP comes back up

Change-Id: Ie9b798f5506de89a37491dbc3798acaa24b98808
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
slimbus: Manage channel slots only if framework manages bandwidth

If slimbus controller overrides bandwidth management, channel slots
should not be managed since controller is expected to do that.
Slimbus controller will go into idle mode due to this change when
channel setup/teardown is done. Make sure controller can transition
states correctly in runtime-pm suspend, and system-suspend case.

Change-Id: Id41aed822e3c98af8c1fe7db3a3527a1206739be
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
slim_msm: Rectify physical address type

Make sure physical address type is of correct type.

Change-Id: I9ec7a846e0fc14efd3627d141bb2228c8e56b2cc
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>