cpufreq: ondemand: Resolve deadlock when waking up sync thread
msm: mdss: add tracing events in mdss driver

Add tracing points in key points in driver.

Change-Id: Ie31e27be4890e2e7cd573c00dbf3f66fa9c62060
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Signed-off-by: Vineet Bajaj <vbajaj@codeaurora.org>
msm: mdss add bw related events for command mode panels

Add events to observe when bandwidth is requested,
when bandwidth is needed and when bandwidth is released
for command mode panels.

Change-Id: I56b8ce28683696bee50e9cd10351076c49e4a84c
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Signed-off-by: Vineet Bajaj <vbajaj@codeaurora.org>
msm: mdss: add systrace begin/end trace events

Adding trace points for systrace at various points in
the driver.

Change-Id: I4783fd2982bddb7f111de9e064bcaff153eb1ce1
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Vineet Bajaj <vbajaj@codeaurora.org>
msm: mdss: Issue ctl sw reset when underrun happens

If underrun occurs in dual pipe mode (edp, or HDMI) then
there is a chance the 3d_mux will get confused and route
right to left and left to right. This will happen if it
is on the right side when the underrun condition happens.
To fix this following steps are required:

 - Disable HW recovery
 - When underrun is detected, wait for vsync.
 - Issue sw_reset to the ctl path.

This is required to cleanly reset the 3d_mux in case the
swap has occurred.

Change-Id: I8fbf747da4720c12d48bc1ee431bab6224148e31
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
mdss: dsi: Fix null dereferences

Fix potential null dereferences in driver.

Change-Id: Idd8d4eb16bb1b9562da1f5225d91cf90d8230bfe
Signed-off-by: Charles Bin <cbin@codeaurora.org>
msm: mdss: Check ctl power on status before BTA status check

Control path power on status should be checked before BTA status
check else command sending failure and IOMMU page faults during
bootup can be observed if ESD is enabled for device. Currently
IOMMU is not powered on when commands are being sent.

Change-Id: Ice66f38e79755eb14843fc63afe058e4bab2f0e2
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
Signed-off-by: Anusha Koduru <kanusha@codeaurora.org>
msm: mdss: Wait for vsync before iommu attach during cont splash

During first borderfill commit in splash cleanup, wait for vsync
before iommu attach to prevent IOMMU page faults during bootup.

Change-Id: I68b7162d090513b082cbd4c0013731cedc0ebdbe
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Signed-off-by: Vineet Bajaj <vbajaj@codeaurora.org>
Signed-off-by: Anusha Koduru <kanusha@codeaurora.org>
msm: kgsl: Do not return invalid power stats when the device is off

adreno_power_stats() was returning unitialized data when the device
state was not active. Leave early from the function if the device
is not active and return 0s instead.

Change-Id: Ic0dedbadf6201cadb4472327c4ce7f9d9d32b82d
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Prabhat Awasthi <pawasthi@codeaurora.org>
leds: At disable, set the trigger to default instead of wiping it

Change-Id: Ifb4a3b3034c441d29fd1d9f209ed829adfc76a72
Revert "hammerhead: Fix camera flash to use only flash0"

This reverts commit 4003da2254ac7e9ee5907936e9cec80da1cc5e94.
Revert "leds: qpnp: Use LGEs LED driver"

This reverts commit f513c04d8b3c619be92d442f62316f0308ed817d.

Revert "hammerhead kernel: implement always on rgb led support"

This reverts commit 03691a8f8ccf3d681b8129bff643b518642fdd42.

Change-Id: I4fc373c11f3b8d33829f166c56192b6f0933206a
leds: leds-qpnp: add time based rgb LED control

Notification led driver has no time based control.
It adds "on_off_ms, rgb_start" as sysfs.
With these sysfs nodes, HAL can handle notificiation LED
without calculation frequency.

Change-Id: Idbc22619d96b953a3755ec41e96db886b8666a61
Signed-off-by: darren.kang <darren.kang@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
leds: leds-qpnp: define rgb led's duty cycle start-index

Configuring the start-index in rgb led's duty cycles.
Because rgb leds use different LUT entries.
Bug: 9772457
Change-Id: Ic860207aa0991a3e990d85ef8494229866f59fbb
Signed-off-by: sungjin.yun <sungjin.yun@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
leds: leds-qpnp: define indicator LED's lut start-index

Previously, indicator LED worked with erratic color.
Using its own LUT start-index, indicator LED works correctly.

Change-Id: I1830c71e0c7ecf40bd32ff15d16825dacb8d83b1
Signed-off-by: sungjin.yun <sungjin.yun@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
leds: leds-qpnp: scaling the brightness of indicator LED

Since each brightness of indicator LED is different,
scale the max brightness for mixed color.

b/11011148
Change-Id: Ie9e2f2bf36bfb8bb2ee13b49675e17a89a0460bf
Signed-off-by: sungjin.yun <sungjin.yun@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
leds: leds-qpnp: set VPH_PWR_DROOP threshold to 2.9V

For consistent flash firing current, adjust VPH_PWR
droop threshold to 2.9V.

Change-Id: I337d3daa7ace3d5ab364729c830a2c352cdfd3ad
Signed-off-by: youmi.jun <youmi.jun@lge.com>
Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com>
hammerhead kernel: implement always on rgb led support

When offms is set to 0, configure a single point
duty cycle at the desired led brightness.

Change-Id: I93b61af52ee2f695035e7f5d78814251c8d1da8d
leds: leds-qpnp: check if flash_wa regulator is obtained before enabling

The flash led requires the use of an optional regulator, "flash_wa_reg".
This regulator is enabled without checking if the regulator is obtained
or not. Hence, a check is made before enabling/disabing the regulator to
ensure that the "flash_wa_reg" is obtained first.

Change-Id: I8fda00274ad3bc21d9ed32d0f3f2ca09e1079f87
Signed-off-by: Abinaya P <abinayap@codeaurora.org>
msm: mdss: dsi: Share panel alignment restrictions through sysfs node

Read panel alignment restrictions on left, top, width and height values of
the updating ROI from the dtsi file and share through sysfs node.
Framework needs these details for configuring MDP for certain
features (e.g. Partial frame update).

Change-Id: Ibe6973b721bb20120a6d7a217bad2d0d159cc836
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>