ASoC: msm: update min buffer count and size

Update minimum buffer size and count to provide more
options to the client.

Change-Id: Ia303978f4e4b230e021a2ae35146328b1c594460
Signed-off-by: Divya Narayanan Poojary <dnaray@codeaurora.org>
ASoC: wcd9320: fix the no audio issue on triggering SSR

After the SSR is triggered there is possibility of the  mismatch
among  the cache register values and the actual hardware registers
values. Due to this some of the registers doesn't gets updated when
the enable sequence is triggered. This results incomplete path
getting enabled resulting in no audio.
Fix by updating the registers to the reset state and updating the
cache also. Also restart the mbhc for the proper headset detection

LNX.LA.3.7 Change-Id: I851c303928dad1a0f36951ad40ac0b6a912e1757

Change-Id: I00b6bc97ca8ab26bd2d4d25b5e0d967595075f65
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
Signed-off-by: Divya Narayanan Poojary <dnaray@codeaurora.org>
ASoC: msm: reorg q6core header file

This is needed to allow include from
non soc folder.

CRs-Fixed: 689849
Change-Id: I753012d5ce9c5a788e75b4edf9b0099b58b30ec0
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
avtimer: msm: allow driver to register to SSR framework

Sub System Restart[SSR] framework allows driver to handle
unexpected crash in middle of operation.
Also, adding support clk_div dtsi entry to calculate
avtimer_lsw value.

Change-Id: I521e3c010dadd00a06a0fe8998a1759b2eb81b55
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>

Conflicts:
	drivers/media/platform/msm/camera_v2/isp/msm_isp.h
avtimer: msm: fix to avoid timejump in avtimer

In VT call, observe timestamp jump in avtimer
causing issue in camera timestamps.
By doing division with clk_div on avtimer tick,
timestamp is calculate correctly now.

Change-Id: I8d1c8d162ee28b6430c9c2e6ca323e212bacfbf2
CRs-Fixed: 726296
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
avtimer: avoid timer query from clients during SSR

Update AV timer driver to schecdule a workqueue to
make sure the ADSP on modem is up while honouring the
requests from client for timer query.

Change-Id: I3c3283e778c836fce1a68cf8a5dc439124ef2f1f
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
msm: wlan: Update the wifi regulatory database.

Update the regulatory database from the mainline kernel.

Change-Id: I960f87a46defa60b281bee965c2af32bbea8520f
CRs-Fixed: 725522
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
ASoC: msm: qdsp6v2: Add SLIMBUS 3 TX port as valid port

Add Slimbus 3 TX port to the list of valid ports.
Otherwise opening of this port will fail.

CRs-fixed: 682168
Change-Id: I53bdde37afb4c5b0773eff86bfcc45541532e4e7
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
msm: vidc: Add support for different errors

When hardware is overloaded or when max number of clients are
reached in driver or firmware, hardware error is sent to video
client. This change is to replace hardware error with actual
errors.

CRs-fixed: 575852
Change-Id: I07e599f894a3716a3dc4fed5eb7c987311f5bdde
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
msm: vidc: configure and set hier-p layers

Firmware requires the max number of hier-p layers
to be used during the encode session to be set
in load resources state. Without this change,
firmware will not enable hier-p encoding. Also
switch to using HFI_PROPERTY_CONFIG_VENC_HIER_P_ENH_LAYER
to set the number of hier-p layers.

Change-Id: I1fbf835acdb7d0a06d33cf9c2d038fb87c10010d
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
msm: vidc: Add support for setting initial qp

Adds support to set initial qp, thereby allowing the client to set
initial qp for I,P, and B frames.

Change-Id: Ie956651bde85e800d97a0007769af9aec8ca16a4
Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>
msm: vidc: Add AFD and CC metadata support to extradata

Add support and control for setting Active format
description and closed caption meta data in the
extradata. FW parses metadata and adds it to the
extradata. Client can use control to parse extradata
for the metadata information.

Change-Id: I79fb71e635927c95e0792862c9dea7d96f58e895
Signed-off-by: Jayasena Sangaraboina <jsanga@codeaurora.org>
msm: vidc: Amend calculation of buffer sizes in VENUS_BUFFER_SIZE

Add 8KB worth of padding for extradata. This is required to accommodate
some of the larger extradata types that didn't fit into the residual
space between the actual buffer size and its aligned size.

CRs-Fixed: 647378
Change-Id: I550f806079dfbdece229f68ffdfc5c0e20b3c9e1
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
msm: vidc: Expose extradata size to userspace

Previously, the extradata size was included within VENUS_BUFFER_SIZE
and callers (primarily in userspace) wouldn't know how much extra
padding was added to the buffer size. Exposing it allows userspace to
query directly instead of doing guesswork.

Change-Id: I7f9701a4adfe364d757028514bdd4fa84402a995
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
msm: vidc: change concealment color

0x8080 is gray color concealment, changing it to
black color, which is 0x8010.

Change-Id: I50897d771913ee33a5b2c2ea486996dfc0c294bf
Signed-off-by: Manikanta Sivapala <msivap@codeaurora.org>
msm: vidc: Change in input buffer size calculation

Right now, input buffer size is calculated based on
maximum supported height and width returned from FW.
These values are not true representation as they are
calculated for rotation usecase. Driver needs to use
max MB supported from FW. This change fixes the same.

CRs-Fixed: 599818
Change-Id: I5b5f7d0db1088a4bc16ec7a32b31e1f763d5da7c
Signed-off-by: Manikanta Sivapala <msivap@codeaurora.org>
msm: vidc: add new control for limiting i/p buffer size

Take the minimum of the size calculated by driver using
max width and height supported and the size set by client
for input buffers. Change interface to get input and
output buffer sizes.

Change-Id: Ia3eb4cc7ae7bb38e2650fff1b694623e2aab62ef
Signed-off-by: Manikanta Sivapala <msivap@codeaurora.org>
msm: vidc: flush queued work during device suspend

This change flushes any queued work related to power collapse,
once the device is power suspended.
There are applications which do not destroy video instance
on suspending the device. For such applications, if the device
is power suspended, video driver does not prepare venus for
power collapse.
Considerable power saving is observed by power collapsing
venus before the device goes in suspend state.

Change-Id: I11252e45b10d0d3d3eefb38994acd083c847bbb8
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
msm: vidc: Add instance to instance list prior to CORE_INIT

During CORE_INIT, driver votes for bus only if core->instances list
is not empty. Since the current video instance is added to core->instances
list after core init, driver fails to vote for bus. This causes ion_map to
hang and resets the device.

Change-Id: Ia68a953572852db63737f30998cf10c5db151292
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
msm: vidc: Delay firmware unload during session close

Video driver loads and unloads firmware at the start
and end of each session. Firmware download takes up
to 100 msec. When there are many b2b video sessions
e.g. thumbnail generation, this is an unnecessary
overhead. To overcome this problem, video driver will
unload the firmware 10 secs after the session is closed.
If a new session starts during this period, it will not
be required to download the firmware again.

Change-Id: Ia515c3ed89c75ea9e43852958d1cbb2d77fe4c51
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>