ASoC: wcd9xxx: Clear unsupported jack from hph status

In the case when headphone or headset is removed at the
other end of extension cable, unsupported jack event is
never cleared. Further headset/headphone insertion event
will always have the unsupported jack bit ON in the hph_status.

Change-Id: I5ea046b09cf8db4702c2e6d97fa1c8d23ba2702c
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
ASoC: wcd9xxx: Add check for buffer overflow

Current code does not check if the indexes of array
codec_dai being accessed is within the maximum
number of codec dais for a particular codec. The change
adds this check and ensures that indexes outside the
bounds of array are not accessed.

CRs-Fixed: 628865
Change-Id: Ibf81f91b35e43feddc6b03a1239b4d12e04a95da
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
ASoC: msm: ensure check before accessing session private data.

The compressed session needs to be active to set volume to dsp.
Ensure the check to see valid session exist before accessing
private data, else results in kernel panic.

The Memory allocation for driver data also needs to be freed
for failure in session open.

CRs-Fixed: 638817
Change-Id: Ifdce543aa55df420960e9eeff0564f18d9410060
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
mmc: core: abort rescan if suspend is triggered

There could be a race between suspend and mmc_rescan as follows:
At resume:
-> mmc_pm_notify
  -> mmc_rescan is scheduled

Suspend is triggered:
-> mmc_pm_notify
   -> wait for mmc_rescan/cancel it
      -> rescan acquires wakelock if card is detected
         so as to give user-space a chance to respond
-> PM framework cancels suspend since wakelock is active

Hence, release the wake-lock if its active in suspend prepare
and check for rescan_disable before acquiring wake-lock.
This prefers suspend over notifying the user-space of the status
of the card, which is fine since with suspend user-space is frozen
too.

CRs-fixed: 655281
Change-Id: I83783589f9b541d3af73931e9a7b0b144a25538e
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>

Conflicts:
	drivers/mmc/core/sd.c
ASoC: msm8974: Set tx bit rate for slim tx params

Set tx bit rate format in slimbus tx hw fixup params.

CRs-Fixed: 659408
Change-Id: I02b7cb88ca180cac033e9f5b63af287b2d932c10
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
ASoC: qcom: qdsp6v2: Initialize locks before use

Spinlock crash issue is fixed with this patch. This patch
is to initialize the locks before it is used.

Change-Id: Ib8200b5f2d89bd3e06db4a47e3682fe290fa6b3c
Signed-off-by: Anish Kumar <kanish@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/qdsp6v2/audio_amrwbplus.c
ASoC: msm: Configure correct gain on set Volume command

Output channel gain is product of per channel gain and master gain.
Hence if only per channel gain is set and master gain is set to 0
then no audio is heard at the output.
Ensure that if we change per channel gain then we set master gain
to unity and vice versa. This enables only one gain to be effective.

Change-Id: I4cc2990efbb3e86edcc3d4328761cb64ed8fa775
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
ASoC: wcd9xxx: Correct wrong check conditions

1) For targets where micbias is shared, we do not
use vddio to identify special headset. We want
micbias to be enabled always with any headset
inserted for such targets. Currently, if headset is
inserted during recording, we check for this vddio
flag as well. Since, it is null for the above mentioned
targets, we never touch the code to enable micbias
always for any type of headset.

2) Again for the above mentioned targets, if micbias
is enabled by voice call, and we insert the headset.
Now if headset is removed, we try force diable of
micbias. This results in Tx mute. The count to disable
micbias needs to be corrected.

Change-Id: I022a54578c47485ebf7eef27c405e31ea6395ecf
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>

Conflicts:
	sound/soc/codecs/msm8x10-wcd.c
cpufreq: interactive: Initialize spinlocks

These were missing in commit 8fbac318173082918312d6a4ceacf63376797c52,
"cpufreq: interactive: Use frequency dependent per cpu timings".
Linux 3.4.94
gpio_keys: remove sec_debug_check_crash_key