msm: mdss: Prevent ALS data configuration when AD is disabled

If assertive display is disabled, backlight data structure is reset
to NULL, which in some conditons gets dereferenced or casuses
crash.

Change-Id: I535eac6d2f0aef222fc2846f80d72db1f3e3480d
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
msm: Add image version reporting node into socinfo

Get smem block, which stores image version strings for all images and
export those strings to userspace through sysfs entries.

Change-Id: Ifb1a3d0670e6199e0d0d8da752c17bdda370bfe2
Signed-off-by: Yulian Shandorov <jshandorov@codeaurora.org>
USB: dwc3: Fix QDSS data integrity issue

Currently RAM12, RAM13 are being used for data fifo and
descriptor fifo allocations in QDSS BAM <-> BAM usecase. Remaining
16KB out of 29KB is being used for allocation of TX FIFO for
USB IN endpoints in the composition. This resulting in data corruption
when captured with host side application. Due to this, QTF host
application is not able to parse the data collected over USB.
Hence reserve RAM11, RAM12, RAM13 for 16KB data fifo allocation and
5KB descritor fifo allocation in QDSS mode and use remaining 8KB for
TX FIFO allocation for IN endpoints.

As available tx fifo size is reduced in QDSS mode, allocate 1KB for
bulk and isochronous endpoints in highspeed mode and also for nonburst
endpoints in superspeed mode. For burst endpoint in superspeed mode,
allocate 3KB for TX FIFO.

CRs-Fixed: 553147
Change-Id: I6d50d2da631a95a921c47bb1fb1139477840a73c
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
USB: dwc3-msm: Add support for overriding SSPHY deemphasis setting

TX deemphasis value can be different from platform to platform.
This value has to be set to suitable value to pass USB3 complaince
test. Hence add support for overriding this deemphasis value from
device tree.

CRs-Fixed: 536912
Change-Id: Ic3c2213fc0d090407057525115eae1351ecc4668
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
ASoC: msm: Change acdb_mmap size variable to unsigned

The acdb_mmap fuction does a size calculation but
stores the result in an int which makes negitive
numbers possible. Changing the variable to unsigned
ensures that the size used is never out of bounds.

Change-Id: Ie3cf4c0a1037e7f5fef29b8301becc6c19200ed6
CRs-fixed: 548145
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
ASoC: msm: qdsp6v2: Fix buffer overflow in voice driver

Userspace registers calibration data with acdb driver
through ioctls. Voice driver registers the calibration
data with CVD by querying acdb data from acdb driver and
copies the calibration data in apr message.

The size of the calibration data can be controlled by userspace
and can result in buffer overflow if the calibration size is
greater than the destination buffer size.

Reject acdb data if the size is greater than the size of
destination buffer.

CRs-fixed: 548872
Change-Id: I354e9d4ce2d07df25513e8a4398826da0e21179e
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
msm: mdss: Reset Ctl interface during video stop

Interface ctl  needs to be reset by sfotware during video stop
to prevent hardware's state machine from going into bad state.
This is evident when HDMI interface is disconnected during video
playback and up on reconnect the 3D Muxing of left and right
mixers is swapped.

Change-Id: Ib62e39a8399a4e43c3e44f3ab5e0ad0acd5d77a0
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
msm: vidc: Add clocks and power counts

Enable power and clock ref counts in debugfs
to easily debug any ref count mismatch.

Change-Id: If06ef139f5a4517cb29a84e86193a6cc2c0f9e64
Signed-off-by: Sachin Shah <sachins@codeaurora.org>
ALSA: core: Fix crash by avoiding appl_ptr crossing 32-bit boundary

Incase of A2DP usecase using proxy driver, appl_ptr has
boundary value as 0x60000000 frames in sw_params for stereo(2 channels).
When this value crosses 0x40000000, then userspace calculating
appl_ptr at bytes results in crossing 32-bit value 0x100000000,
and points to 0x0 offset which can result in crash or pop.
To avoid above scenario, set the sw_params appl_ptr boundary value
within 0x40000000. Added proper check at sw_params update
to set this value correctly within 32-bit boundary(frames).

Change-Id: I537a04156699d90549a0a468ae19539ecd552d3b
CRs-Fixed: 483203
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
USB: Debugfs: Fix compilation issues when debugfs is disabled

When we disable debugfs some of the function driver does not
handle those error properly so we see error of kind variable
undeclared, too many arguements to function. This fixes all
these obseved issue

CRs-fixed: 551713
Change-Id: I1b60c86b1c489f77edf86a5df44f8766a08dc117
Signed-off-by: Tarun Gupta <tarung@codeaurora.org>
scsi: Remove compilation error introduced by a previous change

This fixes a compilation error introduced by commit
491666a29826ed8f4faa52fd14fe7ef71f527174 "scsi: ufs: created UFS unit-tests
framework" which added a function that uses struct device without declaring
it.

CRs-fixed: 551713
Change-Id: I9d6f73c8d780fa33672b386c1358c667dffc0a79
Signed-off-by: Tarun Gupta <tarung@codeaurora.org>
msm: kgsl: Handle failure of find_process_private()

Handle the case of NULL return from find_process_private() upon
its failure by failing from get_process_private().

Change-Id: Id42ae795d140bd67d8a36496f840387858e5f779
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
msm: acpuclock-8974: Update PVS table for msm8974 Pro

Update PVS table to match the latest voltage plan for msm8974 Pro.

Change-Id: Ieaba3a9b0108f00563c527b4b401a05deae74ec5
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
msm: mdss:  Set rotator output format as pseudo planar 420

Set rotator output format for planar 420 as pseudo planar 420.
Configure BWC output format as MDP_Y_CRCB_H2V2 when
input color format is MDP_Y_CBCR_H2V2.

CRs-Fixed: 549326 552372 552375
Change-Id: I9c39ab3d8a867909853ffd6ecc2120ab160914d1
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
ASoC: msm: Fix for power collapse hostless usecase

For hostless pcm usecases apps processor is not needed
for data path. Once data path is established hostless
driver will remove the pm_qos_request to allow the host
CPU to power collapse. Change adds the support to remove
the pm_qos_request once data path is setup.

Change-Id: Ic6ac8d99628c770061ec785f8549c164f6a9bbd8
CRs-fixed: 561202
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
msm: mdss: Correctly update pwm configuration

Backlight pwm was incorrectly updated while changing the backlight
level. We need to disable the pwm configuration before updating
it with the updated value.

Change-Id: Ie027c26a614c6bb0ffdc51218cf4c81b26ceb736
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
msm: mdss: Update panel on sequence

Enable the display_en gpio before toggling the reset gpio.
This is needed to bringup the JDI panel without breaking
the default panel.

Change-Id: I64399bf070e6ba5bf2355a1fb90bba2460e2bd92
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
ARM: dts: msm:  Add support for JDI 1080p panel

Add new dt file with the DSI specific configuration for JDI
Renesas 1080p video mode panel.

Change-Id: I972c51af4906475d045357871266ac34db32b5bc
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
defconfig: 8226: Set ROW as the default block I/O scheduler

The ROW block I/O scheduler was developed with the mobile devices needs
in mind, where we favor user experience upon everything else, thus we
want to give READ I/O requests as much priority as possible.

The main idea of the ROW scheduling policy is to dispatch READ requests
with higher priority, while write starvation is considered.

The benefit of ROW block I/O scheduler is to improve the READ throughput
and latency in READ/WRITE collisions.
The READ latency worst case is improved both in sequential and random read
scenarios. For example, in random tiotest the worst READ latency
is decreased from 3940 msec with CFQ to 1180 msec with ROW.

In READ/WRITE collisions, the lmdd tests showed READ throughput
improvement from 32.62 MB/s with CFQ to 106.86 MB/s with ROW, with no
degradation to the WRITE throughput. The READ latency histogram shows
that when ROW is the current scheduler, the READ latency of 95% of the
requests fall under latency of less than 10 msec. The histogram for the
same scenario with CFQ as the current scheduler shows that 95% of the
READ requests are spread around latency of 10-40 msec.

Change-Id: I55415c1cd4bbb6f9c66d5d3903f55145b82ed53b
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
ASoC: wcd9xxx: Correct OCP IRQ mapping for Tapan

OCP interrupt mapping bit number is changed in Tapan codec,
so correct the interrupt mapping accordingly.

Change-Id: I9ecdd5174822f807261700478686776413d87667
Signed-off-by: Yeleswarapu, Nagaradhesh <nagaradh@codeaurora.org>