msm: mdss: Remove deprecated vsync pending variable

vsync pending variable is deprecated and hence remove its
usage from all places in MDSS. Reenabling vsync ctrl once
panel is on now relies on user space application.

CRs-Fixed: 513502
Change-Id: I4b3062012983c1de98a5e59b4368e028eb6b46a5
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
(cherry picked from commit a06c84d4805cc39d457ed269884f7591dd4cb1d7)

Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
msm: mdss: Configure panel's physical dimensions

Parse the panel's physical dimensions from the dts file and
set width and height in frame buffer information accordingly.

Change-Id: Ic76949b14313777b9f3ea1a2c9e60565fe203d67
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
(cherry picked from commit c23fa01ef6b87b0350b6be896b73a370724ab09b)

Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
msm: mdss: Replace vsync work queue with sysfs_notify_dirent

Since sysfs_notify_dirent() can be called in interrupt context,
use it instead of work queue. This should improve latency of
vsync events, especially as work queues run at normal
priority, and the other threads which transmit vsync events use
a higher priority.

Change-Id: I14de54b455ed5cc17b61e1e9ff9078b8c958cdcb
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
(cherry picked from commit 668363f6827083630f94ae971f793bb7081d8f65)

Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
msm: mdss: Return standard errno for error conditions

Replace ENOTSUPP with standard lib error EOPNOTSUPP in order
to update errno. Return EPERM error when VSYNC_ENABLED called
in suspend state in order to reflect the actual state of the
device. if no error returned applications would assume vsync
events are being generated when this is not true.

Change-Id: I72a7347ebecc71376884cf21b7e757f75ba9b40e
Signed-off-by: Ramkumar Radhakrishnan <ramkumar@codeaurora.org>
(cherry picked from commit b073b318866b8bf88327530fe645b1f46fb475e2)

Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
msm: qpnp-revid: Add api to return pmic revision id

Certain fixes in the PMIC (mainly those related to routing) do not
reflect in the revisions of individual peripherals. They show up only
in the revision id of the PMIC.

Drivers need to know whether a change is present in PMIC or not and
looking at the revision registers within the peripheral is insufficient.

So provide an api to lookup PMIC revision in the qpnp-revid driver.

Change-Id: I3bfe8a52d4eb15d1c491f0dd031e866c8b35353a
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
(cherry picked from commit 94f731b43bd52c2dd0c6e17ab67b41c91b87f319)

Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
power: qpnp-charger: workaround for coupling issue

On 8x26, the IADC current readings are off when the battery is charging
and is below 3.8V.

This bug is attributed to charger buck switching with high frequency
especially when the battery voltage is significantly lower than the input
charger voltage. As the battery charges up its voltage increases,
charger starts going towards high duty cycle mode thereby reducing the
switches. This reduction in switches improves the IADC accuracy.

Implement workarounds when the battery voltage is lower than 3.8V and is
in a fast charging state. Reduce the number of power stages helps with
improving the IADC accuracy.

Note that this workaround only needs to be applied when a USB Wall
charger or USB CDP is present. With USB SDP the input current is low to
cause IADC inaccuracies.

Change-Id: Ie7e067973a96d478005ddfdddae7c8c0dc394071
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
(cherry picked from commit e7497007e2785377d02313ec0be67cd96fdc1f1f)

Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
ARM: dts: msm: fix merge errors

The commit 026ffb82cf7a22a23893d74f0bc4ead1ba38405d was merged
incorrectly. Fix the incorrect merge by removing invalid properties.

Change-Id: I7e9835d45829729eac2e798110c8daad0473cb6b
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
(cherry picked from commit 37bd2042e3f81add9325b3793a954efa920f0c56)

Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
Merge "msm: mdss: Remove deprecated vsync pending variable"
Merge "msm: mdss: Configure panel's physical dimensions"
Merge "msm: mdss: Replace vsync work queue with sysfs_notify_dirent"
Merge "msm: mdss: Return standard errno for error conditions"
Merge "msm: qpnp-revid: Add api to return pmic revision id"
Merge "power: qpnp-charger: workaround for coupling issue"
Merge "ARM: dts: msm: fix merge errors"
msm: vidc: Add logic to unregister input buffers

Unregister input buffers when reqbufs is called for input
port with zero buffer count.

Change-Id: I676fa0857d675ae45f4328b26c2f82d7397315b1
Signed-off-by: Surajit Podder <spodder@codeaurora.org>
Signed-off-by: Praveen Chavan <pchavan@codeaurora.org>
Merge "msm: vidc: Add logic to unregister input buffers"
msm: vidc: Set error concealment color to FW.

Add property to inform error concealment color to firmware.
With this change error concealment color is set to green.
If the error concealment color is set to any other color besides
green, then some frames have green padding and some will have non-green
padding(because error concealment color is mostly set on only first frame).
This can cause YUV mismatches between runs resulting in failure in
certification testcases.

Change-Id: I705037b93f7b0e10630e749aa807487f45e6e393
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

Conflicts:

	drivers/media/platform/msm/vidc/msm_vdec.c
	drivers/media/platform/msm/vidc/vidc_hfi_api.h

Signed-off-by: Manish Kumar <manishku@codeaurora.org>
Merge "msm: vidc: Set error concealment color to FW."
sock_diag: Fix out-of-bounds access to sock_diag_handlers[]

Userland can send a netlink message requesting SOCK_DIAG_BY_FAMILY
with a family greater or equal then AF_MAX -- the array size of
sock_diag_handlers[]. The current code does not test for this
condition therefore is vulnerable to an out-of-bound access opening
doors for a privilege escalation.

CRs-fixed: 519050
Change-Id: I1466c4f56f3f4df90cf8a1ae17afa80c89b813e8
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Git-commit: 6e601a53566d84e1ffd25e7b6fe0b6894ffd79c0
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
msm: mdss: validate fb backlight inputs

Ensure backlight level is less than the max backlight
brightness and the backlight scaling factor is at most
1.

Change-Id: I424ed22af48ecae46371291fe88a114cf3fc7c31
CRs-Fixed: 516699
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>