linux 3.4.91

Signed-off-by: houst0nn <houstonn@gmail.com>

Conflicts:
	arch/arm/Kconfig
	arch/arm/Makefile
	arch/arm/include/asm/mutex.h
	arch/arm/kernel/perf_event.c
	arch/arm/kernel/traps.c
	arch/arm/mm/dma-mapping.c
	arch/arm/mm/mmu.c
	arch/arm/mm/proc-v7.S
	arch/arm/mm/tlb-v7.S
	arch/arm/vfp/entry.S
	arch/arm/vfp/vfpmodule.c
	drivers/base/power/main.c
	drivers/bluetooth/ath3k.c
	drivers/bluetooth/btusb.c
	drivers/gpio/gpio-msm-v2.c
	drivers/md/dm-crypt.c
	drivers/media/dvb/dvb-core/dmxdev.c
	drivers/mmc/card/block.c
	drivers/mmc/core/cd-gpio.c
	drivers/mmc/host/sdhci.c
	drivers/mtd/mtdchar.c
	drivers/net/ethernet/smsc/smc91x.h
	drivers/net/tun.c
	drivers/scsi/sd.c
	drivers/staging/zsmalloc/zsmalloc-main.c
	drivers/uio/uio.c
	drivers/usb/core/driver.c
	drivers/usb/core/hub.c
	drivers/usb/core/message.c
	drivers/usb/dwc3/ep0.c
	drivers/usb/dwc3/gadget.c
	drivers/usb/gadget/f_mass_storage.c
	drivers/usb/host/xhci-hub.c
	drivers/usb/host/xhci-plat.c
	drivers/usb/host/xhci.c
	drivers/usb/host/xhci.h
	drivers/usb/serial/qcserial.c
	drivers/usb/storage/scsiglue.c
	drivers/video/au1100fb.c
	drivers/video/au1200fb.c
	drivers/virtio/virtio_ring.c
	fs/ext4/xattr.c
	fs/ubifs/dir.c
	include/linux/kref.h
	include/linux/sched.h
	include/linux/virtio.h
	include/net/bluetooth/hci_core.h
	include/net/bluetooth/mgmt.h
	include/scsi/scsi_device.h
	include/sound/core.h
	kernel/cgroup.c
	kernel/events/core.c
	kernel/hrtimer.c
	kernel/power/suspend.c
	kernel/sched/core.c
	kernel/signal.c
	kernel/sys.c
	kernel/workqueue.c
	mm/internal.h
	mm/memory_hotplug.c
	mm/vmscan.c
	net/bluetooth/hci_conn.c
	net/bluetooth/hci_core.c
	net/bluetooth/hci_event.c
	net/bluetooth/l2cap_core.c
	net/bluetooth/mgmt.c
	net/bluetooth/rfcomm/sock.c
	net/bluetooth/smp.c
	net/ipv4/ping.c
	net/wireless/nl80211.c
	net/wireless/reg.c
msm: ultrasound: add verifications of some input parameters

Some security vulnerabilities were found.
To fix them, additional verifications of some input parameters
are required.

CRs-Fixed: 554575, 554560, 555030
Change-Id: Ie87a433bcda89c3e462cfd511c168e8306056020
Signed-off-by: Baruch Eruchimovitch <baruche@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: msm: Add Buffer overflow check

The overflow check is required to ensure that user space data
in kernel may not go beyond buffer boundary.

Change-Id: I7d94a209c0b8818bfb9c65f8c13a5f5e36c49e2d
CRs-Fixed: 563086
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
msm: ultrasound: Add support for general button events

The side buttons bitmap was expanded to allow sending button
events for tool type buttons (stylus, rubber) and also for a new
button which signals that the hovering icon should be displayed.

The event source field was removed as it was previously used to
set the tool type, which is now done explicitly via the buttons
bitmap.

Change-Id: Id08921c392eeec8928ca0c730988f8c83be2ba8f
Signed-off-by: Lior Barenboim <liorb@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
msm: audio: qdsp6v2: disable read interrupts for smd channels

SMD channels are configured to send interrupts when the remote end
reads from the channels. Disable this behavior to reduce number
of interrupts.

Change-Id: I4c4f76c038b5f9b79c164a53306ccbe31c415d74
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: msm: qdsp6v2: Release IPA mapping

When DSP has a SMMU associated with it, audio driver will allocate
(KVA)kernel virtual address and (IPA)intermediate physical
address.When freeing memory audio driver should release IPA and KVA
mappings. Change fixes the issue where IPA mapping was not released

Change-Id: Id81ef9f2af29f2b6793853d8d0a1ef960c5d6310
CRs-fixed: 600938
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
msm: Fix for APR session based callbacks

In the callback function src_port was being used
instead of dest_port for returning the callbacks.
Fixed by changing src_port to dest_port.

Change-Id: I3871d32924678fb6ed1eab1a94046a9bf22a978e
Signed-off-by: Vicky Sehrawat <vickys@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
msm: Allow native driver to communicate with APR

Add a new driver to expose IOCTLs for userspace clients
to use to communicate directly with APR. This will allow
clients to directly interact with services such MVM, CVS,
etc

Change-Id: Icc75b01e19b757d7da81f143fc10f09185e92d31
Signed-off-by: Vicky Sehrawat <vickys@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: msm: qdsp6v2: Fix ion_import failure

When ion_import_legacy api fails,we should not
destory the client instead just bail out.

CRs-Fixed: 620370
Change-Id: Icbcf4dadd5f00e1cf4d7a356ee1c0f5835dcb4c4
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
msm: ultrasound: add support for aDSP Sub-System Restart

Add handling of RESET_EVENTS message from APR, which indicates
aDSP sub-system restart has begun.

Add a new internal state, USF_ADSP_RESTART_STATE, for this
scenario.

Change-Id: Ic1178f8fb4e659abc29947fac4079ba088e51447
Signed-off-by: Lior Barenboim <liorb@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ARM: dts: msm8974: Add support for incall LCH tone playback

Update the device tree to add AFE port id needed to enable
incall music delivery on the second subscription.

CRs-Fixed: 626562
Change-Id: Idf6ae3cd9c916c250ea587837031c80f4522a11f
Signed-off-by: Avinash Vaish <avaish@codeaurora.org>
Signed-off-by: Karthik Reddy Katta <a_katta@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: wcd9320: Prevent calling PA event unnecessarily during ANC

When Headphone ANC is enabled, do not call the headphone PA event
in pre-power down case, only in post-power down.
Headphone PA event will only process this call in post-power
down case.

Change-Id: I61ba96ae038c2e0aa4dc3d01048f33e6a5e97d86
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
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>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: msm8974: Add voice2 dai-link

Add voice2 dai-link to enable DSDS on msm8974 platform.

CRs-fixed: 587066
Change-Id: Ia057890525e51f4ef0344b04ccabbb1f265d1dc3
Signed-off-by: Vicky Sehrawat <vickys@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: wcd9xxx :Modify detection of Euro Headset

Detect the cable as EU Headset only if below conditions met.
1.Plug types for 1st, 2nd, 4th are consistent and equal to HEADSET.
2.Delta b/w 1st, 2nd, 4th is not more than WCD9XXX_CS_MEAS_DELTA_MAX_MV.
3.Plug type of the 3rd measurement is HEADPHONE.
4.Don't consider the status of HPHL.

Change-Id: Iee5f05a360599295e75496bec87b595709ba5a6c
Signed-off-by: Yeleswarapu, Nagaradhesh <nagaradh@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
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>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: wcd9xxx: Maintain micbias for headsets with threshold on mic

There are headsets that require to maintain  micbias while
it's plugged since mic of headsets have threshold to turn
on mic. Maintain micbias when this type of headset is detected
in order to detect headset button press.

CRs-Fixed: 587697
Change-Id: Ie2bc622d4336ab9b772cd996db84b569dacd9bf6
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
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>
Signed-off-by: houst0nn <houstonn@gmail.com>
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>
Signed-off-by: houst0nn <houstonn@gmail.com>
audio: ocmem: fix the ocmem driver crash during video playback

Triggering SSR during wait for client callback by the audio
ocmem driver causes de-reference of freed memory in ocmem_free
function. Fixed by assigning NULL to the ocmem buffer pointer after every
ocmem_free function call.

CRs-Fixed: 589762
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Change-Id: I53208de26a4d22f6b60d118e47d16a3ad29a8040
Signed-off-by: houst0nn <houstonn@gmail.com>