ARM: dts: msm: Update flash LED headroom and startup delay

Per PMIC system suggestion, headroom should be set to 500mV and
startup delay should be set to 128us to avoid any potential issue.

Change-Id: Iae8d866adde573ddf775b528896dd9a5e9bcd9dd
Signed-off-by: Chun Zhang <chunz@codeaurora.org>
ARM: dts: msm: Add support for Synaptics touch controller

When 8x10 is equpped with 720p display panel, touch controller that
comes with the panel is from Synaptics. This patch provides support
for Synaptics touch controller to enable touch on 720p panel.

CRs-Fixed: 539071
Change-Id: I12109c39356c1f62ea7a637ea441f743f525d530
Signed-off-by: Chun Zhang <chunz@codeaurora.org>
msm: ipc: Pass the local service events to local clients

When a service gets registered or unregistered locally, the concerned
events are sent only to the remote subsystems.

Pass the local service events to local clients so that clients and
services can be started in any order.

Change-Id: I1f672cb3e7cac2ae2f26922add0320ffd84a38ad
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
msm: ipc: Add support to handle version 2 header

IPC Router Message header is 32 bytes in size since each element uses
4 bytes in size regardless of the data range being represented.

Add a version 2 header format that compacts the header into 16 bytes.

Change-Id: I5e6cfc0672ca1dc3365b31c26d2ce4b3c6230cfc
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
msm: pil-q6v5-lpass: Remove disabling watchdog irq multiple times

Disabling watchdog irq twice requires enabling it an equal number
of times. Due to the watchdog irq being disabled twice while being
enabled only once; on watchdog bite happening muliple times, the
watchdog handler is not fired for the subsequent ones.

This change makes sure that this is rectified by disabling the
irq only once when the subsystem is shutdown during restart.

Change-Id: I58732e6a6d3d484bed53dc8198e8794eefd1b45c
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
Config-8960: Disable Bluez dependant modules

Since MR2 comes with Bluedroid stack, disable Bluez dependant
modules from kernel.

CRs-Fixed: 542077
Change-Id: Ie2e1ef786c45d31b6705ddf1dd02eecfff2ba365
Signed-off-by: Juffin Alex Varghese <jalex@codeaurora.org>
msm: mdss: Store AD backlight notification function

Store Assertive Display backlight notification function while locked to
prevent race condition where AD is disabled while lock is released,
setting function pointer to NULL.

Change-Id: I7996a29595854ed8e50d0fff663a779c3ccd388f
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
msm: acpuclock-krait: Work-around retention corner-case

The CPU clock source MUXes cannot switch while a CPU is in
retention, but callers of acpuclock APIs may not known that
the CPU is in retention.

Work around this problem be always performing the CPU MUX
switch on the affected CPU using smp_call_function_single()
in cases where cross-calling might otherwise be possible.
The one exception to this is during hotplug code paths,
where cross-calling is expected by design (since the target
CPU is not online and cannot be in retention).

Change-Id: I76b6de436e71da7979f30bdce841f414c26bfe44
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: mdss: Update screen resolution for Assertive Display

Apply the latest screen resolution to AD hardware so that banding
artifacts are not generated.

Change-Id: I5df8a3de4551c5e45e0e8ff2b21b60549b479788
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
USB: hsic: Add support for overriding corner voltage levels for VDDCX

Currently hsic driver does have support for voting corner voltages for
VDDCX. These corner voltage levels for VDDCX will change from platform
to platform. Hence add required support for passing these corner voltage
levels for VDDCX from device tree file.

Change-Id: I8d3d7e9cd6e9a8fd6ea5354b4940e9405ad0fe78
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
arm/dts: 8974: Use corner voltages for VDDCX voting for HSIC

Currently hsic driver is voting for discrete voltages for VDDCX instead
of corner voltages. This could cause issue as RPM may not able to handle
this descrete voltage request for VDDCX on some platforms. Hence vote
for corner voltage for VDDCX instead of discrete voltages on new platforms.

Change-Id: I580b1fc84b94708acccc5b4e3b92511689a9889e
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
USB: EHCI: Add support for overriding corner voltage levels for VDDCX

Currently ehci-msm2 driver does have support for voting corner voltages
for VDDCX. These corner voltage levels for VDDCX will change from platform
to platform. Hence add support for passing these corner voltage levels for
VDDCX from device tree file.

Change-Id: Id5d8c1d435721d6e2d1640298685b3f701fc3d6e
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
arm/dts: 8974: Use corner voltages for VDDCX voting for ehci-msm2 driver

Currently ehci-msm2 driver is voting for discrete voltages for VDDCX
instead of corner voltages. This could cause issue as RPM may not able
to handle this descrete voltage request for VDDCX on some platforms.
Hence vote for corner voltage for VDDCX instead of discrete voltages
on new platforms.

Change-Id: Iacdaca099252832e37a6653781b03528808e1ebd
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
msm: ipc: Add HSIC Transport for off-chip communication

Register a new transport that enables off-chip communication of
IPC Router through HSIC.

Change-Id: I6c37759fd25cad2d2861dfcadaee0881033003ce
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
watchdog: Fix warning caused by use of smp_processor_id()

watchdog driver creates per-cpu kernel threads that are bound to
separate cpus. Use of smp_processor_id() by such threads in
__touch_watchdog() is perfectly fine, as they are generally pinned to
the cpu on which they are running.

During cpu offline event, however, affinity for the watchdog thread
bound to dying cpu is broken before it is killed. There is a small
time window between affinity broken and thread dying in which thread
can run on a cpu with its affinity not set to that cpu exclusively.
This will trigger a warning from use of smp_processor_id(), which is
harmless in this case as it will provide the required heartbeat on cpu
where it is running and moreover that thread will be shortly killed.

Mute the harmless warning by use of raw_smp_processor_id() in
__touch_watchdog(). This seems less intrusive fix than killing threads
in CPU_DOWN_PREPARE event handler.

Change-Id: I7fa22ff529aeea0ec3d5610cfec87aea92cf95a0
CRs-Fixed: 517188
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
msm: ipc: Return the error codes without modification

The user-space modules perform decisions regarding retransmission etc.
based on the error codes returned by the IPC Router.

So return the error codes as is without any modification to the
user-space.

Change-Id: Ic7012109c446aaeaba74c3a29cffd16c155e7212
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
msm: ipc: Fix SKB ownership for failure case

When a client writes to IPC Router and if the write fails, then in
certain scenarios both the client and IPC Router take up the ownership
of the SKB. These failure scenarios lead to a double-free and
segmentation fault.

Fix these scenarios by resolving the ownership issue. If the write to
IPC Router is successful, then IPC Router will keep the ownership of the
SKBs and free the packets. If the write fails, then the client will keep
the ownership of the SKBs and free the packets.

CRs-Fixed: 530180
Change-Id: Iaba47f5da377cdf0a6b16ae02d99eab91a9a6221
Signed-off-by: Zaheerulla Meer <zmeer@codeaurora.org>
smp: Relax irqs_disable() warning in smp_call_function_single()

The change that long-ago added the interrupts-disabled warning in
smp_call_function_single() cited the following deadlock as the reason:
	CPU A				CPU B
	Disable interrupts
					smp_call_function()
					Take call_lock
					Send IPIs
					Wait for all cpus to acknowledge IPI
					CPU A has not responded, spin waiting
					for cpu A to respond, holding call_lock
	smp_call_function()
	Spin waiting for call_lock
	Deadlock			Deadlock

Such a deadlock is not possible however, in the event that
smp_call_function_single() is called for the currently-executing CPU.
While not a common usecase, relaxing the warning may simplify some
driver implementations.

The 'acpuclock-krait' driver in the MSM ARM sub-architecture provides
one example, where smp_call_function_single() is sometimes called from
a cpuidle path with interrupts disabled, but only ever from the target
CPU. Other callers of that same function may cross-call, but only do so
when interrupts are enabled.

Change-Id: I647b3b46fe6aa4dfb06f7750396986b80b92d700
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: camera: Remove unused code used to map userspace buffers.

Remove MSM_CAM_IOCTL_SET_MEM_MAP_INFO IOCTL support, since the
usage of this IOCTL is now depreciated.

Change-Id: I2ca8477fc804a80587bf40dba38904347e9b25aa
Signed-off-by: Kiran Kumar H N <hurlisal@codeaurora.org>
mdss: mdp3: Validate input from userspace

Fully verify that the values from client are safe to use.

Change-Id: I73d6839f5bccd53b8bc2d812dc7673b13735299c
Signed-off-by: Terence Hampson <thampson@codeaurora.org>