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
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: Idc6e57a68741dd6e52f0f1be57b8c85c586df59f
Signed-off-by: Panwar Vivek <vpanwa@codeaurora.org>
ASoC: msm: qdsp6v2: Increase the DSP response timeout

Due to updates in the Fluence V5 algorithm, the initialization
sequence for Fluence V5 takes longer than 200ms. Voice driver
has a timeout of 200ms for DSP response. Increase the timeout
to 300msec to prevent voice call failures.

CRs-Fixed: 595881
Change-Id: I755dd13b796dbf9e0213a09b2925b1fc896b1e70
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>
i2c_qup: Improve implementation of PM callbacks

Refactor PM callbacks and remove redundant variable.
Add support for configuration of clockcontrol event.
Now the clock's state may be set by pm calls (as before)
or by a transfer's begining and ending.
Runtime-PM is still used in autosuspend configuration for
expensive NoC voting/unvoting since that may go to remote
processor.

CRs-Fixed: 592435
Change-Id: I54f7c67f768336f66765a04006b4c8e4734ac277
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
thermal-core: Fix invalid sensor request not accounted correctly

Add NULL check for sensor name before using it in sensor_get_id and
return NULL explicitly when sensor id is not valid in get_sensor of
thermal core.

Change-Id: I4200a5691183aa2d40ef8ed64554f0beb8ce6d0d
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
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>

Conflicts:
	arch/arm/mach-msm/qdsp6v2/apr_tal.c
msm: mdss: Display splash screen during boot up

It is required to display the splash screen as soon
as fb driver is probed. This shows the device life
at early stage before boot animation rendered by
surface flinger. Current implementation shows the
splash screen only when continuous splash is disabled.

Change-Id: Ib1e049c9ae82a621cc709339414096b954d79a09
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_mdp_overlay.c
msm: mdss:Add splash logo configuration entry in fb

Framebuffer driver displays penguin logo image
for all targets. Bootloader also displays the
same image. However, customer has to change this
boot image at two places if they want to display
different image than penguin logo. This change allows
customer to disable/enable the splash image from
framebuffer driver.

Change-Id: I56e78ce93aa8c218adffef03bfebd462d6bda254
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_fb.c
msm: mdss: Returning NOTIFY_SUSPEND while polling NOTIFY_UPDATE

mdss_fb_update_notify does not return Suspend in NOTIFY_UPDATE
case. Daemon polls on NOTIFY_UPDATE but does not get Suspend
notification. Hence Daemon would not stop polling.

Suspend Case is added in UPDATE case.

Change-Id: Iaeaf819a6849acda2eb7eb78f0fc3306866d1b64
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
ARM: dts: msm: Disable Venus GDSC collapse for 8974v2.2 and 8974Pro

The sudden current draw occurring when restoring Venus from GDSC
collapse may cause general instability on some platforms. Disable
this feature by default.

CRs-Fixed: 597489
Change-Id: I4e62b913d0206063547ad59ccd8029aa1c5aee16
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>

Conflicts:
	arch/arm/boot/dts/msm8974pro.dtsi
msm: msm_bus: Don't program bw regs in dual config

When in dual configuration mode, don't program the bw registers
since they are already programmed at boot up.

Change-Id: I74d559f997b6374df7b68ffd022aa6d36beb7a9d
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/msm_bus/msm_bus_bimc.c
ARM: dts: msm: Modify bus vector for RNG client on msm8974

Modify the RNG (Random Number Generator) bus vector to use a different
originating master id, this change helps alleviate some slowdowns in boot
time noticed in targets where CPU is artificially bus throttled below a
threshold frequency.

Change-Id: Idf2a1d128f56e6aafebcbf0184ef2454d385be34
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
input: atmel_mxt_ts: Allow driver to compile in all scenarios

Driver needs dummy functions defined for cases when CONFIG_PM
is not enabled.

Change-Id: I4e9f0885eb9f7a45589b2362e468335a3ca57cba
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
msm: mdss: Return suspend without delay in NOTIFY UPDATE

NOTIFY_UPDATE returns Suspend after 4 seconds delay.
Delay would cause HISTOGRAM_STOP ioctl to be called late.

Return suspend case without setting timer for no delay.

Change-Id: I356086de96cab85cd203bf1ad529ecf0b3bbfce3
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
crypto: msm: Handle error case

Release memory and disable clk when sps_init fails.

Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
crypto: msm: Add support for setting XTS data unit size

Based on the context flags set by client, set XTS_DU_SIZE
register to sector size of 1KB, or the actual total length
of the packet.

Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
ARM: dts: msm: bus scaling for crypto operation

Add documentation for optional flag "support-bus-scaling". This
flag indicates if platform supports bus scaling request for
crypto operation.

Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
crypto: msm: optimize ce bandwith scaling

Encryption processing at qcrypto driver includes three main steps:
set ce high bandwidth and enable ce clock in cra_init, then send
encrytion request, and at last set ce low bandwidth and disable
clock in cra_exit. This process is fine for the use case where
there are lots of requests between cra_init and cra_exit, but will
introduce large overhead for mmc layer disk encryption as it calls
cra_init, queue request and cra_exit for every encryption request.

It is not necessary to set low bandwidth and disable clock for every
encrypt request when it is completed. So we delay these scaling down
tasks for a while, and just scale down the last request when timer
expires so as to amortize and decrease the overhead.

Signed-off-by: Zhen Kong <zkong@codeaurora.org>
crypto: msm: fix issues in ce clock disable processing

In the situation of more than one requests, the ce clock may get
errorneously disabled even when there are active requests. The
scaling operation is then modified to fix the problem and ensure
all requests are completed when disable the clock. We also clean
up the related codes.

Signed-off-by: Zhen Kong <zkong@codeaurora.org>
crypto: msm: multiple qcrypto support

This patch provides support for multiple qcrypto devices
with the qcrypto driver.

Acked-by: Chemin Hsieh <cheminh@qti.qualcomm.com>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>