msm: clock-9625: Add NAND device for RPM clock handling

QPIC NAND has three clocks viz. gcc_qpic_system_clk, qcc_qpic_ahb_clk,
and gcc_qpic_clk. Need to set_rate and enable only qpic_clk and then
RPM will enable system_clk and ahb_clk as well.

Add NAND device to the list of RPM clocks to facilitate clock handling
for these QPIC clocks.

CRs-Fixed: 488510
Change-Id: Ic4053bd6ba19c7396ca084b85f42ae782e946057
Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org>
mtd: msm_qpic_nand: Add clock gating and bus bandwidth voting

QPIC NAND has three clocks viz. gcc_qpic_system_clk, qcc_qpic_ahb_clk,
and gcc_qpic_clk. Need to set_rate and enable only qpic_clk and then
RPM will enable system_clk and ahb_clk as well.

But the clocks are always on even when there are no requests to process.
So add support to gate/ungate the clocks accordingly. Also add support
to vote and unvote the bus bandwidth for better performance.

But if the clock is set and immediately suspend is triggered the clocks
would remain still enabled along with bus vote. So introduce both the PM
and Runtime PM suspend/resume to handle these cases as well.

CRs-Fixed: 488510
Change-Id: I373b39e15f6f7e2c10a8ebe182992743a1cb7838
Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org>
ARM: dts: msm: Add bus voting properties for QPIC NAND device for msm9x25

QPIC NAND has three clocks viz. gcc_qpic_system_clk, qcc_qpic_ahb_clk,
and gcc_qpic_clk. Need to set_rate and enable only qpic_clk and then
RPM will enable system_clk and ahb_clk as well.

But bus clock enabling requires voting for bus bandwidth. So add the
properties for bus voting for QPIC NAND device.

CRs-Fixed: 488510
Change-Id: I0fe9d7f6828304e36e629ce1b21ec063b5ba8b1c
Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org>
ASoC: msm: Do not set volume to zero during session open

Setting stream volume to 0 will cause problem when user
starts playback from aplay. The previous volume which is
set gets overwritten with 0 when the playback starts. To
avoid this user space can control the volume setting at
the start of the playback.

Change-Id: I3776bb7ffd390ff0cfb56462bebb60a9163a7796
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
msm: scm: Add logging of actual return code from scm call

When an error occurs during an scm call the error returned is
remapped so we lose the original error code. This means that
when an error occurs we have no idea what actually failed within
the secure environment.

Add a logging statement that will log the actual error code from
scm call allowing us to easier determine what caused the error
to occur.

Change-Id: I8439cf53e324fee136b78c1f9e55c4f3d54679eb
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
ARM: dts: msm: Add PIL LPASS device for apq8084

Introduce the PIL LPASS device so that the LPASS can be
brought out of reset and shutdown.

Change-Id: I17dc0608e6a37d5e194aaa84667639a62782465d
Signed-off-by: Tianyi Gou <tgou@codeaurora.org>
mdss: hdmi: Support for raw EDID data

Output edid raw data via sysfs. The size is fixed to
5 EDID blocks.

Change-Id: I46330db5e9507850ac9e82b766bcd4e4356c8755
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
mdss: hdmi: Set ITC and CN0_1 bits in AVI infoFrame

Changes ITC and CN0/1 bits in AVI hdmi infoFrame through
sysfs attributes.
Itc can be set either 1 or 0. CN0~1 bits can be set 0x00~0x11.

Change-Id: Ic6ae98ecd4c4b4a425e0219151c91eedab8d50e6
Signed-off-by: Lei Zhou <leizhou@codeaurora.org>
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
ARM: dts: msm: Add regulators for SDC1 and SDC2 slots for msmsamarium

Add the voltage, current and regulator info for SDCC slots 1 and 2.

Change-Id: If5c4793382b7d56137034c846e941ff29f20ef23
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
msm: mdss: Introduce error checks for rotator sessions

When there are more virtual rotator sessions allocated than
DMA pipes available, rotator pipe allocations might fail and
corresponding error messages are printed which can lead to a
watchdog bark. This change silences those error messages and
also implements an extra check to avoid null pointer
dereference when a session is dequeued without a pipe.

CRs-fixed: 523701
Change-Id: I128ab85aac9e091b13a8772a43342d655c6f736f
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
power: qpnp-bms: disable interrupts at probe

The ocv and cc threshold interrupt are required when the battery is
FULL. Disable them at probe time and enable them once the battery is
reported full.

Change-Id: I75bc0b9128f7a8552380ba184d8a72e54159c01d
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
usb: msm_otg: wake from apps power collapse during bus resume

In case D+ and D- MPM pins exists in the platform, turn on/off
the level shifter that drive these signals into the MPM as well
as the corresponding MPM pins.

This will allow the chip to wake up from apps power collapse by
the MPM when the USB cable is connected and USB bus resume occurred.

Change-Id: I4785f73dd45e69eb389fa812f7aec8fa48c756c5
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
ARM: dts: msm: enable D+ HV interrupt for 9x25

On 9x25, the USB D+ and D- signals are routed from the HSUSB PHY to
dedicated MPM pins. This way the MPM can wake the chip  when these
signals change.

In this commit we enable only the D+ MPM pin, since we would like the MPM
to wake the chip on USB bus resume, which happens when the D+ is dropping.

Change-Id: I2b1075cc97fa9a1004aafedfc59a9eb9ecc70035
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
ARM: dts: msm: shut off usb clocks on suspend for 9625

So far, when the usb bus was in suspend state the usb driver used
wake up interrupts from the usb bam to in order to start remote wake up
signal to the host due to a packet arrival in the bam pipe. In order
to this interrupt to work, we had to keep usb clocks enable during
suspend.

Today, after implementing handshake with the IPA resource manager, upon
start of remote wake up, the consumer will be first requested by the
resource manager to signal the usb to exit from low power mode, before
the first packet is pushed into the bam pipe, so before the wake up
interrupt will be received.

This allow us to shutdown the usb clocks during suspend and therefore to
support XO shutdown during suspend.

Change-Id: Idd0acfa0a760ada10c25b7ef0be498724acff868
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
usb: msm_otg: add a support for vdd minimization gpio

Add a support to add a dedicated gpio to platform data that will allow
vdd minimization during peripheral suspend. This gpio is used to pullup
the D+ line during suspend, therefore allowing PHY to go to retention mode
and vdd minimization.

Change-Id: I65b287ba1ccbafbd1186677c88204f53e6b9a210
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
usb: msm_otg: workaround for D+ D- HV interrupts in PHY retention

This commit clears HW chicken bit in the D+ D- HV interrupts mechanism.
When this chicken bit is set (by default) then when USB PHY in retention
mode and these interrupts are active, an extra interrupt is fired, causing
for immediate wake up from bus suspend.

Change-Id: I69b281403023bcd15032a181eed43ddb6abcd919
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
Soc: msm: qdsp6v2: Fix invalid params handling

Alloc and free apis should sanity check all input params.
If allocation fails set client and ion handle to NULL.

Change-Id: Ide3bd782eb90ee8b033e39de232929a1ca7174b7
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
ASoC: msm: qdsp6v2: Clear ION handle after freeing

Once ion memory is freed ion handle should be set to
NULL to avoid double free or any unintended access.
This change clears the ION handle after freeing up
the memory.

Change-Id: I37d76fe2641c111fa4376eff8f7e45f6795414ca
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
ARM: dts: msm: Add KTM hotplug feature for msm8974

Add entry for hotplug threshold. Set hotplug threshold and threshold
hysteresis to 110degC and 90degC respectively.

Add cpu sensors mapping.

CRs-Fixed: 515110
Change-Id: I86335b0e5d19894ada82ee8a2113ed0940276aad
Signed-off-by: Jennifer Liu <chihning@codeaurora.org>
ARM: dts: disable PMIC WLED for skuf

SKUF doesn't use WLED as backlight driver, so we need disable it to
avoid bottom current leakage.

CRs-fixed: 525921
Change-Id: Ifed07945c038389956cc5a6cad4449fcd91bee88
Signed-off-by: Ray Zhang <rayzhang@codeaurora.org>