msm: Adding mechanism to Stop CAMIF Immediately

Currently we have the mechanism to stop CAMIF immeidately from
Kernel Space. This change provides access to this mechanism.

Improving the procedure for CAMIF Stop:
Implemented the recommended mechanism for CAMIF Stop.

This changes improves latency to meet 100ms requirement for
flush() call.

Signed-off-by: Abhishek Kondaveeti <akondave@codeaurora.org>
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
power: max17048: power down if the battery voltage is too low

The battery could be not charged depends on system load even
if the charger is plugged. Since application doesn't power
down the device when the charger is plugged even if battery
level reach to 0%. As a result, the battery could be severely
drained under this condition.
To avoid sudden power loss by UVLO, monitor the battery voltage
and power down the device if the battery voltage drop below the
threshold.

Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
arm/dt: hammerhead: set power down vbatt level to 3.05V

To prevent sudden power loss by UVLO, fuel gauge driver
monitors the battery voltage and power down the device
if battery voltage falls below 3.05V.

Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm_bam_rmnet: Check for sufficient headroom

Check for sufficient headroom before attempting transmit. Prevent
crash when skb_push() with insufficient headroom. Added module parameter
to track number of times packet expansion required.

Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: hdmi-cec: bounds check cec frame size

Ensure that the frame size for the HDMI-CEC message
frame size doesn't exceed the maximum size when
reading message from userspace through sysfs interface.
This avoids potential overflow in cec send msg routine.

Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: hdmi: Proper HDMI feature check

Checks for the proper HDMI feature before providing the
corresponding feature data to avoid invalid memory access.

Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: hdmi: Security check for EDID 3D data parsing

While parsing EDID (Extended display identification data) received
from TV for 3D data and other, proper buffer overflow check is done
to avoid data overflow or overwrite.
Also, replace snprintf with scnprintf for better memory copy results.

Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: qdsp6v2: memset stack buffer allocation.

This is needed to avoid garbage data in uninitialized variables.

Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: qdsp: memset stack buffer allocation.

This is needed to avoid garbage data in uninitialized variables.

Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: hdmi: Proper permissions for CEC logical address

Do not give universal access to CEC (Consumer Electronics Control)
sysfs nodes for logical and physical addresses to avoid unauthorized
access.

Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera_v2: cpp: initialize inst info

memset inst_ifo structure to aviod sending
uninitialized data via ioctl

Signed-off-by: Georgi Hristov <ghristov@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
POWER: Add an API call to log wake wakeup reason

Signed-off-by: Ruchi kandoi <kandoiruchi@google.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ARM: gic: remove redundant debug message

Remove log message which was made redundant.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: kgsl: Enhance GFT to avoid hang->recover->hang cycle

If GFT recovered more than X times in Y ms invalidate the context
and do not attempt recovery. this is to prevent the case where GFT keeps
recovering continuously.

Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
gpio: msm-common: Add wakeup reason logging

Add call to log_wakeup_reason from msm_gpio_show_resume_irq
and remove redundant print.

Signed-off-by: Patrick Tjin <pattjin@google.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Revert "ARM: msm: hammerhead: Update wlan locale translation table"

This reverts commit 2063faa0a2a2f0b1cd57091a79e1f586cd2592a7.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ARM: msm: hammerhead: Remove DFS channels in default locale

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: Add support for RAW streams in camera

Add suport for raw streams in ISP driver.

Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera2: cpp: Append frame buffers to the list

In case of late buffer allocation, allocated buffers
have to be appended to the existing queues.

Signed-off-by: Iliya Varadzhakov <ivarad@codeaurora.org>
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera_v2: Fix CAMIF stop sequence

Only stop CAMIF immediately if all active PIX and RAW streams
are stopped.

Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>