ASoC: msm: Do not set volume to zero during session open

Setting stream volume to 0 will cause problem when user
starts playback from aplay. The previous volume which is
set gets overwritten with 0 when the playback starts. To
avoid this user space can control the volume setting at
the start of the playback.

Change-Id: I3776bb7ffd390ff0cfb56462bebb60a9163a7796
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
msm: scm: Add logging of actual return code from scm call

When an error occurs during an scm call the error returned is
remapped so we lose the original error code. This means that
when an error occurs we have no idea what actually failed within
the secure environment.

Add a logging statement that will log the actual error code from
scm call allowing us to easier determine what caused the error
to occur.

Change-Id: I8439cf53e324fee136b78c1f9e55c4f3d54679eb
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
ARM: dts: msm: Add regulators for SDC1 and SDC2 slots for msmsamarium

Add the voltage, current and regulator info for SDCC slots 1 and 2.

Change-Id: If5c4793382b7d56137034c846e941ff29f20ef23
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
cpufreq: Save user policy min/max instead of policy min/max during hotplug

When a CPU is hotplugged off, various fields of the policy are saved so
that they can be restored when the CPU is hotplugged back in.

The existing code saves the policy min/max field during hotplug remove and
restores it into user policy min/max during hotplug add. This results in
the loss of the user policy min/max values across a hotplug remove/add.

Fix it by saving the user policy min/max instead of policy min/max during
hotplug remove. During a hotplug add, after user policy min/max is
restored, the policy min/max is already recomputed. So, there's no risk of
going beyound any limits imposed by the CPUFREQ_ADJUST/INCOMPATIBLE
notifiers.

Change-Id: Ib8e09fa324c1f80f095c5754b5dcf2685e8e4a66
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
msm: smd: use appropriate interrupt names while registering

The driver passes "smd_dev" as the interrupt name while requesting
interrupts. It is best to pass the node name for which it is requesting
the interrupt so it becomes easy to know which device is the interrupt
for.

Change-Id: I69bc1ce28a454510c40bdb874b332e4485e3a72b
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
msm: mdss: access copy of userspace buf only

Copy buffer data from userspace and access only the
pointer to buffer in kernel memory. Copy back this data
back to user space memory once the operation is completed.
This prevents accessing user space virtual address from
driver.

Change-Id: I319bf08055cdf914803c4a35c5a607f92017d9a0
CRs-Fixed: 520129
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
platform: msm: usb_bam: ack cons request only after ipa_resume

This changes the timing of the ack on consumer request to happen
only after the ipa_resume.
In ECM suspend scenarios customer was reporting a crash after resume
event was received. After further investigation the crash occurs due
unclocked access to IPA BAM, due to ack on cons request before
ipa_resume is called.

Change-Id: If6d32d64ab7c20e4545edf6bd3c35356144088c1
CRs-fixed:  522425
Signed-off-by: Lena Salman <esalman@codeaurora.org>
msm: camera: Change CCI I2C write interface

Every CCI I2C write involves one I2C transaction to CCI core.
Since CCI queue has maximum of 64 words, Write CCI commands
to CCI core and handle it in hardware.

Change-Id: Ic3b03bf70b1a5a23d4bdd42d2cbf8528fa8bd413
Signed-off-by: Sreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>
msm: vidc: Fix scope of "mode" variable at try_set_ctrl function

The variable was declared inside a switch case
statement but it is used outside the statement
causing random errors if use.

Change-Id: Iffe2c182f8057720d8e9db9e73fba1512a1c88f1
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
msm: thermal: Make core control and PSM independent of cpu frequency

Updated the KTM to perform PMIC SW Mode(PSM) threshold monitoring
and core control independent of the CPU frequency table
initialization.

Change-Id: I45653ef3087830cc96326b8e770d826530b7fed5
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
qseecom: Fix issues with failure to release client handle

There exists scenarios when qseecom_release is called,
the client handle type is incorrect; hence proper cleanup
is not done with regards to unloading app or cleaning up
memory allocated for the device handle.
This change addresses all cleanup issues related to qseecom
client in qseecom_release call by ensuring the handle type is
set correctly and cleanup is done properly based on client type.

Change-Id: I126aa431ce635ae98100b774e3d92b704635d199
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
ASoC: msm: qdsp6v2: Add DTX support

Add support to set DTX mode ON/OFF for EVRCB, EVRCWB and
EVRCNW vocoder formats.

Change-Id: I1fcfdb39e22edd4063080be5a0451cb81dcdbdd5
Signed-off-by: Narsinga Rao Chella <nrchella@codeaurora.org>
kernel: rng: Add IOCTL support to disable bus bandwidth

QRNG bus scale is set to high before qrng_read & set to
low after qrng_read, this impacts the performance during
boot-up, as there are various clients using qrng during
bootup. Inorder to fix this problem, a daemon is introduced
which calls into kernel module (that sets low bandwidth).
This change supports the IOCTL call to disable the bus bandwidth.

Change-Id: I386d1eb4c50c057ae2852e7f9d47c8db8e522ca5
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
socinfo: msm8226: add support for QRD subtype table in legacy socinfo file

Add QRD subtype table to indicate different customer
hardware in legacy socinfo file. The change will take
effect in /sys/devices/soc#/platform_subtype.

Change-Id: Ifdb919847afed14a078b0ba1dab0ca24358cc71c
Signed-off-by: Maria Yu <aiquny@codeaurora.org>
ALSA: usb-audio: Fix the mixer control range limiting issue

- mixer_ctl_set() function is limiting the volume level
  to particular range. This results in incorrect initial
  volume setting for that device.
- In USB mixer while calculating the dBmin/dBmax values
  resolution factor is hardcoded to 256 which results in
  populating the wrong values for dBmin/dBmax.
- Fix is to use appropriate resolution factor while
  calculating the dBmin/dBmax values.

CRs-Fixed: 515012
Change-Id: I502355af66f850bb65380c27333c3341fa43a947
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>
tspp: Add performance counters to debug-fs

Performance counter are useful in detecting errors
in TSIF input stream.

Change-Id: I6d8a1263a9c84805114e04b0af5ddedc0652f678
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
msm: kgsl Check NULL return from kgsl_get_device_from_dev

The function kgsl_get_device_from_dev() might return NULL, which
was not checked in a few places. Check the return value wherever
it is called.

Change-Id: I764b23a7b13acd692ce0e1bf4bd040c7e180c7d8
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
msm: kgsl: Re-add the irq_last functionality

irq_last is a flag to indicate kgsl should busy wait in an
attempt to NAP because the GPU is likely done with its last
batch of processing.

The setting and clearing of the irq_last variable was removed
with the dispatcher.  Although there are no visable instances
of trouble getting to NAP in current builds, re-add the functionality
until it can be fully replaced.

Change-Id: I8b4d2b72aec8948919fbeed9939684a09cb4f7f9
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
msm: mdss: Add 8084 display clocks

Add new clock structures for 8084 display subsystem. The PLL
programming is same for 8974 and 8084. Hence, the functions
for PLL enable sequence is reused.

Change-Id: Ia8f29227f4688edd84b29337ab1c5787d8ab26a6
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
qdsp6v2: Use ADSP loader as in-kernel component using sysfs node

ADSP is loaded as a seperate module using insmod. Use adsp loader
as in-kernel component. Loading the adsp is triggered using sysfs
node. Once file system is loaded an entry is written to the sysfs
node. This triggers the registered callback function and loads
the ADSP.

Change-Id: Id25ae2c16a8f1de04136a44d2da5c319cf0173aa
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>