msm: camera: Fix improper memory free in failure case

Remove improper drv_priv free in failure case and
add NULL pointer check to avoid kernel panic

Signed-off-by: Yiduo Wang <yiduow@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: Make ISP and camera kernel not interruptible

Change wait_event_interruptible_timeout to wait_completion_timeout
in camera kernel and change wait_completion_timeout_interruptible
to wait_event_timeout to avoid getting interrupts from kernel.

Signed-off-by: Yiduo Wang <yiduow@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: Fix race condition between camera driver and camera daemon

Delete checking command list before calling
wait_for_competion_timeout which could cause race condtion
if camera daemon may respond fast and there is one context swtich
between msm_enqueue and completion.

Signed-off-by: Yiduo Wang <yiduow@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: Limit prints in isp

Change every pr_err in msm_vfe_process_error_status to
pr_err_ratelimited to avoid watchdog reset

Signed-off-by: Yiduo Wang <yiduow@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: Fix sensor info parsing logic

Fix parsing logic as below to fix camera preview rotation
and camera app detection in UI.

0-7: media entity flags
8-15: mount angle
15-23: facing

Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: Fix long overflow on the pix clk

Using unsigned long to avoid overflow because
pix clk frequencies might cause long overflow.
Fix this by using unsigned long instead of long.

Signed-off-by: Peter Liu <pingchie@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: sensor: Update CCI WR comamnd buffer size to 11 bytes

I2C command length is of 11 bytes, it includes 10 bytes of data and
one byte of WR command. Use 11 bytes char array to create command.

Signed-off-by: Rajesh Bondugula <rajeshb@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
HID: add missing hid usages mappings

Integrate several new definitions (not code) that
add additional hid mappings from the HID HUT 1.12
and approved additional requests.

Signed-off-by: Mathieu Meisser <mmeisser@logitech.com>
Signed-off-by: Olivier Gay <ogay@logitech.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: hotplug: Tune msm hotplug

* Terminate load threshold table - https://github.com/myfluxi/kernel_msm/commit/0d19811cb40dacb7ce669c05dc9115340d0bd25a
* Change attribute names. Thanks @Dorimanx
* Lower load thresholds for more interactive response.
* Change default boosted CPU to 1.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
soc: qcom: smd: Validate read and write addresses

The address from which data has to be read and the address to which the
SMD data has to be written is calculated based on the head and tail
indices for that SMD FIFO. If the indices are corrupted, then the
calculated pointer may be outside of the FIFO and may even be outside of
the range of SMEM.

Validate the read and write addresses to be with in the limits of
receive and send FIFO limits respectively.

Signed-off-by: Zaheerulla Meer <zmeer@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
[s2w/dt2w pwrkey suspend]: Make it more robust

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
defconfig: Initiate Chaos 12.0 nightlies

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: Cleaner implementation of Alucard Hotplug driver

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
rtc:alarm: remove alarm_shutdown hook in alarm driver

Putting alarm_shutdown into set_power_on_alarm is to set rtc alarm
time immediately after an alarm being set. It can avoid shutting
down unexpectedly before calling alarm_shutdown hook like removing
battery.Then power_on_alarm will be set to rtc twice when an alarm
is created and the device performs shutdown for a power off alarm.
The set process during shutting down is duplicated to the set
process when an alarm is created. So the alarm_shutdown hook become
unnecessary.

Signed-off-by: Xiaocheng Li <lix@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
alarm : Fix the race conditions in alarm-dev.c

There will be race conditions between alarm set and alarm clear if
set_power_on_alarm is out of the lock.But set_power_on_alarm can't
be put into spin_lock. So add it into mutex_lock.

Signed-off-by: Xiaocheng Li <lix@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
binder: NULL pointer reference

This fix handles a possible NULL pointer reference in
debug message.

Signed-off-by: Paresh Nakhe <pnakhe@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
selinux: Report permissive mode in avc: denied messages.

We cannot presently tell from an avc: denied message whether access was in
fact denied or was allowed due to global or per-domain permissive mode.
Add a permissive= field to the avc message to reflect this information.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: Implement Intelli HotPlug Driver

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
LCD_KCAL: Color Control driver for Nexus 5

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
defconfig: Update

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>