msm: mdss: unstage pipe from other mixers when blending stage changes

User space applications can move a pipe to a different mixer blending
stage by updating the zorder. When this happens driver needs to ensure
that the pipe is only picked up in that blending stage and remove from
any others.

Change-Id: I12992269effc2d60cbba95d35ee6674da1c3ac2a
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm: board-8610: add rpm controlled regulator support

Add a call to rpm_regulator_smd_driver_init() in the
msm8610_add_drivers() function so that the rpm regulator
devices are probed in the correct order (before other
devices).

Change-Id: I8b2ef5299c73ff2416315847e2dc389415727eb8
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
arm/dt: msm8610: switch to rpm controlled regulator support

Switch control of most PMIC PM8110 regulators from direct SPMI
control via qpnp-regulator to indirect RPM control via
rpm-regulator-smd for MSM8610.

Add a pm8110_l3_ao device for acpuclock usage. Add a pm8110_l3_so
device to provide a default sleep set VDD_MX voltage level request.

Modify the voltage ranges for SMPS 1, SMPS 3 and LDO 3. When using
RPM control, it is safe to allow requests all the way down to
retention voltage levels because the RPM is able to enforce system
wide constraints that the APPS cannot.

The voltage ranges when using qpnp-regulator were:
SMPS 1 - 1150000 - 1150000 uV
SMPS 3 - 1350000 - 1350000 uV
LDO 3 - 1150000 - 1150000 uV

Change these ranges to the following under RPM control:

SMPS 1 - 500000 - 1275000 uV
SMPS 3 - 1200000 - 1350000 uV
LDO 3 - 750000 - 1275000 uV

Change-Id: Idae6e6a8733e5987d71af8ab14e7775ac40e8819
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
gpu: ion: Don't call virt_to_page on addresses from dma_alloc

The virtual address returned from dma_alloc_coherent is not
guaranteed to be valid for use with virt_to_phys. Use the physical
address returned from dma_alloc to calculate the page. This
technically may not work if the handle returned is not a physical
address but this is an acceptable workaround until patches are
integrated into the dma subsystem to generate sg_tables.

Change-Id: I658eab86bf69cc23adabe8ac059a8a960e41bdfd
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: mdss: Expose bandwidth compression capability to user

The userspace needs to be aware of the presence of bandwidth
compression use case which is a new hardware feature

Change-Id: I02ec320a2ab9add78000df0459c8095c8f8505fb
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
arm/dt: Add Bandwidth compression feature

Bandwidth compression is an optional new feature in future
versions of mdss.

Change-Id: I9cda3a9c6555c480210114c2770b6b6f68ab472e
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
arm/dt: msm8610: add qpnp charger node to the device tree

Provide support for charger in 8110 by adding the DT node.

Also, enable the charger for cdp and mtp targets.

Note that charging is disabled in this commit.

Change-Id: I305be5d8675cedb54f5261d5ef9b34f029b314a9
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
arm/dt: adsp: Add SMP2P Error fatal and force stop gpios

The new SMSM Point-to-Point (SMP2P) framework allows point to
point communication of state information between subsystems.
Add error fatal and force stop SMP2P GPIOs to device tree used
for exchanging state information between apps and adsp.

Change-Id: I6705bc64c9c34fe7548233b6fead6668fd9215bd
Signed-off-by: Ravishankar Sarawadi <crsaraw@codeaurora.org>
msm: mdss: Enable Decimation during fetch

Decimation is a new mdss hardware feature that facilitates
display of images with width larger than 2048 through a single pipe.
It enables display of high resolution images on multiple interfaces
simulatenously. Also, the presence of this hardware feature needs
to be exposed to userspace so that the usecase can be supported.

Change-Id: I433db46c9f026b4c124ae73d10f1827144631934
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
arm/dt: Add decimation feature

Decimation is an optional new feature in future versions of mdss.

Change-Id: I435ca5e8c0b61fe443eea09496e190a4aea22b57
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
msm: mdss: add check for source width bigger than allowed

Source surface pipes don't support source rectangle width larger than
2048.  This check is currently only enforced on destination rectangle,
need to apply the same for source and avoid possible MDP hang.

Change-Id: If8bace84c7fab50f9b807deecd776a6f242354eb
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
arm/dt: 8610: Add debug and ETM register entries for save-restore

Add device tree entries for debug and ETM save-restore driver. This
driver saves and restores the Debug and ETM registers on power
collapse using memory mapped access since cp14 access is not permitted.

Change-Id: I2ff50c2244e4623c2c5f7d425d3df3ad5444e88c
Signed-off-by: Aparna Das <adas@codeaurora.org>
msm: mdss: Prevent kernel log overflow

Pipe initialization log needs to be a debug message instead of info
as the pipe_init function is called frequently during calls to
overlay set.

Change-Id: I5251918afef1104d4e210283fe09b5a9c715ea3f
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
USB: dwc3: otg: Turn off VBUS before removing hcd

Currently turning off VBUS is done after removing hcd when
micro A cable is disconnected. Removing hcd might take time for
processing device disconnect and during this time, PMIC will
not notify VBUS valid event if micro B cable is connected. This
results in USB cable not getting detected. Hence turn off VBUS
before removing hcd so that PMIC will notify VBUS events.

CRs-Fixed: 473424
Change-Id: I3cc84c4fa403d93d9ea541ce6c9654a42841917c
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
thermal: qpnp-adc-tm: Add thermal nodes

Add VADC channel thermal nodes that are used for
reading the temperature and setting temperature
thresholds.

CRs-Fixed: 476339
Change-Id: Ic591a9801ed043f01ffada1c23ee1dad50931d86
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
thermal: qpnp-adc-tm: Add peripheral type check

Add a peripheral type check to verify run-time if the
existing peripheral can support more than 5 BTM channels.

Change-Id: Ieaf1486c41f0c75c64d3a1cbce49cb1d314e0377
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
hwmon: qpnp-adc: Modify rsense parameter

Add support to read external rsense. We have an
existing DT property to pass the external rsense
value. Modify it as an optional property and when
present use it determine using the external rsense
and the corresponding value for computing the current.

Change-Id: Ie372bd25687b49d399f91bfcb803c669087655f0
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
thermal: tsens8974: Initialize sensor sw_id index

Not initializing the sw_id index results incorrect
hw sensor id index or invalid return value.

Change-Id: I42b1f5b17bc68460bc854706fe695ab0a8d46066
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
arm/dt: msm8226: adjust vin-sel from 2 to 3

The output voltage level of 2 which maps to 1.2V is
incorrect. The correct mapping is VIN3 which maps
to 1.8V.

Fix this by adjusting the appropriate GPIO entries.

CRs-Fixed: 471934
Change-Id: I52c16211997dd90ed5c7d8db3264c686109307ee
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
arm/dt: msm8226/msm8974: disable charging on MTPs

The MTP uses debug boards that emulate
battery presence. The SMBB peripheral
then continues to try to charge the
debug board which results in undesirable
behaviour.

Disable charging on 8x26/8974 MTPs until this
issue has been addressed.

Change-Id: I9da5cad8604fffb24bc217cea7cf39eeb4cf33dc
Signed-off-by: David Keitel <dkeitel@codeaurora.org>