qseecom: Free ion memory even if keymaster app is not unloaded

Make a change to free the ion memory allocated for keymaster client
even if keymaster app doesn't need to be unloaded from TZ, so as to
avoid memory leak.

CRs-Fixed: 724638
Change-Id: I3ddb68c8a3f96b0a44afc3efc63e93f0a8be51bb
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
ASoC: wcd9xxx: use hwdep node for codec calibration

Currently codec driver uses request_firmware to get
calibration data but as this firmware file is also written by
userspace process after bootup, it is not recommended to
use request_firmware. ALSA core provides mechanism to get
hardware dependant data using hwdep nodes. Tomtom codec will
use aforementioned nodes to get calibration data from userspace.

Changed ANC calibration data size

Change-Id: Iace6e239029c7b0d93a5d61a0025ee551acf952f
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Signed-off-by: Pavan Chikkala <pavanc@codeaurora.org>
ASoC: wcd9320: use hwdep nodes to get calibration

Use hwdep node to use calibration and at the same
time keep the code backward compatible. Codec
driver can still use request_firmware to get the
calibration if hwdep is not available.

Change-Id: Ifb4c36632b890b61a0bc67d8af44a5a10233d7bd
Signed-off-by: Pavan Chikkala <pavanc@codeaurora.org>
dtc: add integer overflow checks in fdt header

Protect against integer overflows caused by malformed fdt headers.

CRs-Fixed: 749977
Change-Id: I51d87038f520bc761b163d291b0138c513c69a33
Signed-off-by: Vijay Kumar Pendoti <vpendo@codeaurora.org>
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: vidc: Handle hfi session creation failures properly

Previously, when the hfi session creation failed, the hfi session was
left intact.  So, in case of timeouts, if the core responded beyond the
time out, the driver would handle the message thinking that it's a valid
session.  This commit cleans up the hfi session in case session_init
fails (or times out).

Also rename msm_comm_recover_from_session_error to msm_comm_kill_session,
as the latter was a misnomer, as the function was used to abort a session.

CRs-Fixed: 762541
Change-Id: I9ec4337014f012b6c0f677c5c4844bf9b28c9899
Signed-off-by: Manikanta Sivapala <msivap@codeaurora.org>
Signed-off-by: Balamurugan Alagarsamy <balaga@codeaurora.org>
msm: vidc: Handle max clients error from video hardware

Use instance "lock" instead of "sync_lock" variable for
mutex lock/unlock for video instance state change operation
else session init will be timed out due to dead lock when
max clients error is received from video hardware because
"sync_lock" is already acquired before session init.
At the same time do not free the session when any error
is received from video hardware, if freed results in
dangling pointer access when video driver wants to send
any commands to video hardware after session error,
leading to device reset. The proper way of session cleanup
is already being done upon receiving any errors from
video hardware.

CRs-Fixed: 762541
Change-Id: I689dd255681826508069fa86fb5a87f92fc775b5
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Signed-off-by: Balamurugan Alagarsamy <balaga@codeaurora.org>
msm: camera: Fix CCI sequential write

This is a fix for 2b490d2c27679d09b2972b7a2d3212fa6359625b.
The previous change is to allow writing a register address 0x00.
To delete a condition of "if the address is 0", it removed the
multiple data writing part for sequential address. The change
introduces the issue from sequential addreess/data writing.
(Instead of making a packet :
<address_0x20><data_0xA><data_0xB><data_0xC>,
It makes seperate packets with a wrong address. The addresses
of all packets from the second are 0x0 that is not valid. :
<address_0x20><data_0xA>, <address_0x0><data_0xB>, ...)

For proper change, revert the sequential address/data writing
part. But to write the packet which address is actually 0x0,
add the seperate command of "MSM_CCI_I2C_WRITE_SEQ" and
use this condition to differentiate
between normal packet writing and sequential address writing.

Change-Id: Ibd8f7fad2629504abfee1fa66b08258e04865530
Signed-off-by: Kyong Hwa Bae <kbae@codeaurora.org>
Signed-off-by: Viswanadha Raju Thotakura <viswanad@codeaurora.org>
Merge "msm: vidc: Handle hfi session creation failures properly"
Merge "msm: vidc: Handle max clients error from video hardware"
Merge "dtc: add integer overflow checks in fdt header"
NFC: Read NFCC is fused or unfused

Implement kernel ioctl to read if NFCC is fused or not

CRs-Fixed: 692604
Change-Id: I588c3bcf0fc52e8b857fdeaa1f9f2a343efec744
Signed-off-by: Nakul Kadannavar <nakulk@codeaurora.org>
Merge "msm: camera: Fix CCI sequential write"
ASoC: msm: qdsp6v2: Unblock EOS on reset event callback

Issue: When SSR command is issued in the end of stream of
compress offload playback, ANR is seen in music app. Because
EOS is waiting indefinitely and will not return since ADSP is
dead in this case.

Fix is to unblock EOS on reset event callback from DSP.

Change-Id: Ifc379360b0ba7c589c3e2dddb7b2a3c712af7fb0
CRs-Fixed: 731606
Signed-off-by: Divya Narayanan Poojary <dnaray@codeaurora.org>
Merge "qseecom: Free ion memory even if keymaster app is not unloaded"
Merge "NFC: Read NFCC is fused or unfused"
msm: kgsl: Disable shader memory dump during snapshot

Disabling shader memory dump for these chipsets(8974, 8x26, 8x10).

CRs-Fixed: 650035, 637989, 631728.

Change-Id: I3a56810147e16763eaf3131aa837ed535a447e69
Signed-off-by: Anupam Sakargayan <asakarga@codeaurora.org>
msm: kgsl: Disable index reg dump during snapshot

Disabling index reg dump for these chipsets (8974, 8x26, 8x10).

CRs-Fixed: 751620
Change-Id: Ie1014bd18b49692f718279cfe7abaed874a376af
Signed-off-by: Anupam Sakargayan <asakarga@codeaurora.org>
Merge "ASoC: wcd9xxx: use hwdep node for codec calibration"
Merge "ASoC: wcd9320: use hwdep nodes to get calibration"
Merge "msm: kgsl: Disable shader memory dump during snapshot"