msm: video: wfd: Move WFD related files out of camera directory

The msm/ directory is intended for camera. Hence moving up the wfd/
directory one level higher and renaming it as msm_wfd/.

Change-Id: I9309ccfee91a04b6d55cf3be7ed88da15364b475
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
msm: acpuclock-krait: Don't change HFPLL rates unnecessarily

If two CPU speeds vote on the same L2 rate we unnecessarily set
the rate of the L2 PLL again even though the resulting rate of
the L2 will be the same. On 8960 for example, setting one CPU's
rate to 1512 KHz and another CPU's rate to 1458 KHz will cause
set_speed() to be called on the L2 scalable with a rate that is
the same as what the L2 clock is already programmed for.

Skip the rate switch in this case by bailing out early if the
target rate is the same as the current rate.

Change-Id: I6824a9ee1c74dcecd63d6b78983ce563eda1c4a9
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
usb: gadget: Introduce qdss function driver

The QDSS function driver supports high throughput debug information
delivery from the QDSS core to the host via the USB port.

Change-Id: Ia9397944d39d767c1200ad87aac67d5627233282
Signed-off-by: Shimrit Malichi <smalichi@codeaurora.org>
usb: gadget: qdss: Add support for CI 2.0 gadget

QDSS function driver currently works only with DWC3
core which uses DBM APIs for bam2bam mode of opearation.

Allow this driver to work with CI gadget by determining
the type of gadget it is operating with (DWC3 or CI) at
runtime and then submit the usb_request accordingly.

Change-Id: I2f0ce4092e55c6d2cabbfcc74251637a540be61f
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
ARM: ftrace: Remove mismerged code from 3.4 upgrade

This code was duplicated in a bad merge during the 3.4 kernel
upgrade. Remove the duplicate code.

Change-Id: Ic9a12b02a6209a5d55fbdb8ae5ed12e8214091a7
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: rpm-regulator: Add support for TCXO workaround

Certain NLDO type PMIC regulators require that the CXO oscillator
input into the PMIC (either CXO or TCXO depending upon the board)
is enabled in order to turn on successfully.  The RPM is able to
handle this requirement for platforms which utilize a CXO
oscillator but not on platforms which use a TCXO oscillator.
This is because the TCXO oscillator cannot be disabled within its
4 ms warmup period.  Any TCXO hardware disable attempted during
the warmup period will be ignored and will result in the TCXO
being latched on until another disable is attempted which has
sufficient delay.

Add conditional CXO clock resource enable and disable calls
around regulator requests which are sent to the RPM for affected
regulators on systems using a TCXO.  The CXO disable calls should
be made from a delayed work queue task which is scheduled to run
4 ms after CXO is enabled.

Change-Id: I4093eeff3076bf5e6907593ed23f0bd2844f377e
Signed-off-by: David Collins <collinsd@codeaurora.org>
msm: rpm-regulator: Mark NLDO regulators which depend upon CXO

Modify PM8921, PM8038, and PM8018 rpm-regulator configuration
data to identify the NLDO regulators which require CXO to be
enabled in order to turn on properly.

Change-Id: I902b00a619e0d864b3c2a923c72d81769ad13cd7
Signed-off-by: David Collins <collinsd@codeaurora.org>
msm: clock: Add clock mapping for rpm-regulator device

Add a CXO clock mapping for the rpm-regulator driver for all
targets which utilize a PMIC which requires CXO to be on in order
for its NLDOs to enable properly.  The workaround is only needed
if the target is utilizing a TCXO oscillator.

Change-Id: I7950641a5196e647d13de1e7529c97bd9894d8f0
Signed-off-by: David Collins <collinsd@codeaurora.org>
msm: board-8064: Enable NLDO TCXO workaround for APQ8064

APQ8064 targets utilize a TCXO; therefore, enable the
rpm-regulator driver TCXO workaround so that they may be
properly enable and also not incur a power hit due to TCXO
being stuck on.

Change-Id: I89cd2cd530deea20f81b31cfb40c1628c3a75844
CRs-Fixed: 375809
Signed-off-by: David Collins <collinsd@codeaurora.org>
msm: kgsl: Add postmortem dump for 2D (z180) cores

Add ringbuffer and register dump as part of postmortem dump for z180
cores. Also, add kgsl_postmortem_dump as a preparatory general function
for postmortem dump for both types of kgsl devices, adreno and z180.

Change-Id: I8b538771bfa8f6bfdfe0b1b993afa3c53f8eb8cf
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
drivers: staging: android: Fix ashmem vm range comparison to stop roll-over

Every time ASHMEM_CACHE_INV_RANGE was sent to an IOCTL a roll-over was
occurring, causing the check to fail. This was comparing a start + size
range with a start + end range, and if the start + end was less than the
start + size the ioctl would fail. The end value was always equal to
start + size from all tests I ran, and since the roll-over occurred with
start + end, it was always less than start. Setting the check to compare
start + size > end fixes this.

Change-Id: I3e4356ab40d8c745fd91eb0cc6b1aaed73494140
Signed-off-by: Matthew Trusten <mtrusten@codeaurora.org>
msm: 8974: Add qcom,msm-id entry to MSM8974-sim/rumi device trees

The qcom,msm-id entry specifies the MSM chipset, platform and
hardware revision.  This is used by the Android dtbtool utility
to generate a table of device tree used in the boot.img.

The qcom,msm-id syntax is:
   qcom,msm-id = <chipset_id, platform_id, rev_id> [, <...>];

The entry can optionally be an array with variable number of
triplets indicating the device tree supports more than one
chipset/platform/hardware rev.

Note that the id's are hardware ID's reported by the hardware
and not commonly used literal ID's.  E.g. MSM8974's chipset ID
is 126, not 8974.

Change-Id: If65b40d6e947504cb4b07a36aa895f8ec6f9d300
Signed-off-by: David Ng <dave@codeaurora.org>
tty: n_smux: Add/remove platform devices for SSR

Subsystem restart is handled by sending DISCONNECT notifications to
clients.  In addition, a subsystem restart may trigger the mdm helper to
unload the line discipline to capture a memory dump before reloading the
line discipline.  This requires SMUX clients to handle two different
disconnect cases properly.

To converge the two use cases and simplify client code, both a subsystem
restart and line discipline unload will result in removing the platform
devices.  The platform devices are re-added after the line discipline is
loaded or the subsystem restart has been completed.

CRs-Fixed: 386186
Change-Id: Ic61c97acef2a9909f180ac4c81e944351ba9d348
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
msm: irqs-9625: Fix the TLMM summary irq number.

TLMM summary irq number does not match H/W description, fix it.

Change-Id: I4d52af9d6d11576d43c7bde90f1cdbf1cd79f3e6
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
msm: hotplug/platsmp: Fix cpu invaldation pointer arithmetic

These functions take two void pointers indicating where to start
and end the invalidation and cache flush. The pointer arithmetic
is considering the pen_release pointer as an int pointer so
adding sizeof(pen_release) is adding 16 bytes to the pointer and
specifying that as the end. This inadvertently invalidates data
next to the pen_release variable which could be bad. Fix the
pointer math to only invalidate or clean the region for the
pen_release variable.

Change-Id: If0cf0e5de7c9f4b8c70662b29957a1f347809124
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
usb: msm_otg: Enable VBUS MPM interrupt

When otg_control is set to OTG_PHY_CONTROL and PMIC interrupts are
not used for VBUS notification, a cable connection will fail to
wake up the device from VDD minimized low power mode. The MPM needs
to be configured to wake up the system when the USB_PHY_OTGSESSVLD
interrupt is triggered. As this interrupt may vary by SoC populate
it in the msm_otg_platform_data->mpm_otgsessvld_int member in the
various board files.

CRs-fixed: 376740
Change-Id: Ia54828f538c695ff6b28f5d7b2b49630a45cc673
Signed-off-by: Jack Pham <jackp@codeaurora.org>
board-msm7x30: correct the voltage range request for ldo20

At boot up, mddi interface is initialized first and if the mddi
panel client is not detected, LCDC panel will be initialized.
While mddi panel is initialized, ldo20 has request for 1.8v in
both min and max and lcdc panel requires 1.5v only. Hence the
target is not booting up as the currently (LCDC) requested range
is not in the previously requsted voltage levels.

Correcting the voltage range for mddi panel will fix the issue
for LCDC

Change-Id: I6dd6d2823e0c1fb3c5bae1daa13598659d69e32c
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
msm: clock-8974: Add measurement-only clocks for CPUs and L2

The CPU and L2 clocks are not managed by the clock driver, but
are measurable using the clock driver's measurement hardware.
Add support for these measurement-only clocks.

Change-Id: Ia8ec54da3064d168f71ea863f60a34598cdc7a62
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
arm/dt: msm8974: Add ocmem power control

Add device tree entry for OCMEM power control on 8974
using the existing bindings.

Change-Id: I0b5e09b62f072a860f8506c9c1a4a9b7a4a36e4b
Signed-off-by: Naveen Ramaraj <nramaraj@codeaurora.org>
msm: 9625: Add support for the external L2 controller

The 9625 chipset has an external L2 cache controller; add support for it
to the device tree and board config.

Change-Id: I900aa28ded4dc6968c5305f9b5a31aa44d2f9774
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>