msm: kgsl: rename iommu version specific data

The iommu hardware versioning scheme recently changed in the iommu driver.
Rename version specific defines and structures in kgsl to match.

Change-Id: Ib2ca5e40d8f5ed6c79b9f4f5a013263fd8d4aae4
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
msm: kgsl: Bump up the GPU frequency for long batch processing

Compute workloads run without kernel interaction for long periods
of time.  If one is identified early, increase the frequency to
finish it as fast as possible, rather than waiting for the standard
algorithm to do so.

Change-Id: I213ccabfae5e1000cdc34bc1d92bdc3bad86383d
CRs-Fixed: 441847
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
usb: dwc3-msm: Add voting for mock UTMI clock

Starting with 8974v2 the mock UTMI clock is required to allow
DWC3 to operate properly in host mode.

Change-Id: Ib4e765fd891b2ae82d4cfb591adecf115a08fbf8
Signed-off-by: Jack Pham <jackp@codeaurora.org>
msm: 8226: Add 8226 topology to enable bus scaling

This patch adds 8226 bus devices along with the master/slave
data to build topology for bus scaling.

Change-Id: I963272586cf4e2c1f687b9b9e8e424f58bb1cd24
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
msm: msm_bus: Revert the name change for backward compatibility

Bus driver name changes breaks A-series and some B-series
chipsets.

Change-Id: I523ed7611c831bf4b67716fb6cec1f1ffb7f411b
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
arm/dts: Move msm8974-pm.dtsi to msm8974-v1-pm.dtsi

The current version of msm8974-pm.dtsi supports only the rev 1 of the
MSM8974 chipset.

Change-Id: I1864df5eb97e0b21219bd91646d2e89867fc859b
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
usb: gadget: mbim: Change message level from error to debug

Change level of message to prevent excessive logging and
increase mbim throughput from 800 KB/s to 3 MB/s.

Change-Id: Iffec43825c90c8cb5838f9879342e9a021ef087b
Signed-off-by: Anna Perel <aperel@codeaurora.org>
arm/dt: msm8974: Add power management devices for v2

Add devicetree support for power management devices for rev 2 of
MSM8974 chipset.

The new SAW rev2.1 has support for HFPLL be turned off from the Krait
SPM sequence. The rev 2.0 hardware would force PLL on when resuming even
if the PLL was turned off by s/w.

Change-Id: I653d425c4df58b1157d2753305ad2c5cc66eb93b
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
gpu: ion: Add secure CMA heap

CMA can now be used for large contiguous allocations. Add
a dedicated heap for secure use cases. This heap intentionally
removes some functionality such as mmaping to userspace for
secure requirements.

Change-Id: I7de94499bd005b405fed546826dae44ae8bc4e20
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
cma: redirect page allocation to CMA

CMA pages are designed to be used as fallback for movable allocations
and cannot be used for non-movable allocations. If CMA pages are
utilized poorly, non-movable allocations may end up getting starved if
all regular movable pages are allocated and the only pages left are
CMA. Always using CMA pages first creates unacceptable performance
problems. As a midway alternative, use CMA pages for certain
userspace allocations. The userspace pages can be migrated or dropped
quickly which giving decent utilization.

Change-Id: I6165dda01b705309eebabc6dfa67146b7a95c174
CRs-Fixed: 452508
[lauraa@codeaurora.org: Missing CONFIG_CMA guards, add commit text]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
mm: Don't put CMA pages on per cpu lists

CMA allocations rely on being able to migrate pages out
quickly to fulfill the allocations. Most use cases for
movable allocations meet this requirement. File system
allocations may take an unaccpetably long time to
migrate, which creates delays from CMA. Prevent CMA
pages from ending up on the per-cpu lists to avoid
code paths grabbing CMA pages on the fast path. CMA
pages can still be allocated as a fallback under tight
memory pressure.

CRs-Fixed: 452508
Change-Id: I79a28f697275a2a1870caabae53c8ea345b4b47d
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: audio: Fix for WMA seek issue

- Seeking during WMA playback results in no audio.
- Input and output port flush were not called during
  seek which resulted in no WRTE_DONE ack from DSP to
  AIO driver.
- Fix is to add input and output port flush during seek.

Change-Id: I61b7f72211e64bf437566bf48cc009631e918900
CRs-fixed: 453026
Signed-off-by: Amal Paul <amal@codeaurora.org>
msm: kgsl: Increase bus bandwidth to avoid underrun

The GPU is exceeding its bandwidth request at SVS,
increase to avoid underrun.

Change-Id: Ib4cd0cf4a6e96ba235b4222b03c9b7fe16475690
CRs-Fixed: 447123
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
msm: kgsl: Turn off automatic hardware clock gating for 8974v1

The aggressive AHCG values for 8974v1 exposed instabilities during
testing.  Reset the numbers to the less aggressive settings.

CRs-Fixed: 446875
Change-Id: Ic0dedbadcb6e622f3a8d1de059583c352b2d3e06
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
power: qpnp-charger: fix possible race condition

If the dc supply is registered earlier, the
framework misses calling the battery's
external_power_supply_changed().

This causes undesired behaviour in userspace
not being updated correctly.

Fix this by registering the battery supply
first and then registering the DC supply.

CRs-Fixed: 452862
Change-Id: I573289d75854a4293cdbdda6afecea011dd4c3ab
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
msm: krait-regulator: don't turn on MDD unnecessarily

The driver initializes MDD and also turns it on during bootup. MDD
need to be turned on only when LDO path is in use. Remove the enabling
of MDD as the cpu will be operating in BHS mode at bootup .

Change-Id: I797963f271f357a72456666e0c31f65990ef0d0e
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
msm: mdss: enforce display commit during overlay unset

Display commit needs to happen on kickoff to ensure pipes are detached from
the control path. If the pipes remained attached upon control
reactivation it leads to frame drops.

CRs-fixed: 447112
Change-Id: I7b135874acc637501b3e4e7b844e111159b37eab
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
msm: mdss: clean up control path during kickoff

References in the control structure need to be cleared during cleanup to
detach hardware from the current control execution path and make it
available for subsequent executions to avoid buffer drops

CRs-fixed: 452500
Change-Id: I7f9472c51934293e199a2d872edb075b03c03366
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
mobicore: t-base-200 Engineering Release

 - Improve the smc work by not using work_on_cpu anymore
which in later linux versions spawns a new thread.
 - Unmap memory from TLC when freeing.
 - Enable mapping of contigous buffers to trustlets.
 - Logging set up by th IOCTL.
 - Compliant with the 3.4 Linux Kernel Version.

Change-Id: Ied8f024c4dd7e101b23e3ba842fcc47f9ab583fe
Signed-off-by: Oana Medvesan <medvesan.oana@gmail.com>
[hnamgund@codeaurora.org: Modify mobicore_kernelapi/main.c for 3.4
kernel compatibility, reformat commit text]
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
Acked-by: Tony Hamilton <tonyh@qti.qualcomm.com>
thermal: tsens8974 : Add 8x26 calibration mask

Add calibration masks to support reading efuse data
from qfprom for 8x26. Since the calibration fuse maps
are different for 8x26 have a separate calibration mode
to read the efuse regions for this target. Another
difference is there is no back-up calibration region
efuse for tsens on 8x26.

Update the devicetree property to include a calib_mode
property that distinguishes different calibration mask
maps to use. Also update the DT example node slope values.

Change-Id: I9e370f1807e4df500638b7547be16e28f26b37b2
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>