spi_qsd: Add vote for clock path

Currently the spi driver votes for its core clock. However, it is
possible that the core-clock's source will be off. When the source
is off, the spi core is not clocked. This patch adds voting for
the entire clock path, thus guarantee clocking to the spi core.
Voting for the path cost a few msecs. A client may choose when
to pay this overhead. By default the votes takes place in the
runtime-pm callbacks which tie to transaction requests. A client
may choose to invoke these callbacks itself whenever it likes
by directly calling the driver's runtime-pm. A third option is
to set the active_only flag in platform data which results in the
callbacks being called when the application processor power state
changes.

CRs-Fixed: 478465
Change-Id: Ib866399c0e84a875a19a0d1506d77bbe77d5fe61
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
mmc: core: fix issue with HPI polling timeout

Out of CPU time for the MMC context included into measured timeout. System
under heavy load will easily exceed out_of_int_time (typically 20 ms),
because  the MMC context is not running and when it is back to running,
timeout already elapsed. In this case real card status checked again and
error reported for wrong card state only.

Change-Id: I0da3bd2e7d41e4933ad3b1333d7135705a1eafec
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Revert "USB: dwc3: ep0.c: Disable U1 and U2 low power modes"

Commit 4f1de530f4d5989022d9594413132ea175c2845e disabled U1 and
U2 low power modes to avoid USB reenumeration issue seen during
data transfers in superspeed mode. This USB reenumeration is
resolved by commit Ibd5d8180202b2f877304be3da9d976fe54df3eed
"USB: dwc3: core: Set elastic buffer mode to zero". Hence revert
the commit to reenable U1 and U2 low power modes, otherwise USB3
complaince tests fail.

CRs-Fixed: 483202
Change-Id: I87443c9dc4cac443137f64998ced9fda1e583a44
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
ASoC: msm: qdsp6v2: Update the routing for aux pcm usecase

Audio can be looped back between primary and secondary aux pcm
for some of the usecases.
Change adds routing table entry and support for allowing loopback.

Change-Id: I33754dac4c88dac3daa2a0d34fcd9a7d9d7d1f4a
CRs-fixed: 495000
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
USB: dwc3: Add support for non standard charger detection

Current driver does have support for detecting non standard
charger. If this support is enabled, there are chances that slowly
connecting device to SDP slowly can be detected as non standard
charger and will start charging with 1500mA. This happens due to
data lines not making contact within 900msec. Hence add support for
detecting these scenarios and detect the correct charger.

CRs-Fixed: 492480
Change-Id: I27518f0090d5c321823d2e632b61f81e523f6087
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
power: qpnp-charger: check if dc is present after probe

If a DC charger is connected during bootup the dcin_valid
interrupt does not trigger after requesting the interrupt.

Fix this by calling the DCIN_VALID interrupt handler
at the end of the charger probe to read the real time
interrupt status bit and take appropriate actions.

CRs-Fixed: 491426
Change-Id: I5dfcc4542a28c4375a5f12acad44207c0ffa237a
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
power: qpnp-charger: add current_max property for DC supply

Allow the maximum input current limit for the DC charge path
to be configured via the power supply framework using the
POWER_SUPPLY_PROP_CURRENT_MAX value.

CRs-Fixed: 469026
Change-Id: I6bf31a127b5eef3d4aca0ee2b99b729a69f9b151
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
ASoC: msm8974: Fix external speaker power amp shutdown sequence

External speaker power amplifier should be disabled when all
the lineout power amplifiers are shutdown. When lineout is
shutdown bit mask was not cleared, due to which external power
amplifier will not be shutdown. Change clears the
bit mask for each lineout that is powered down.

Change-Id: I740653cbb6605708b38c915d59415f5b7f0c6d74
CRs-fixed: 497619
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
mmc: core: add checks for pointers before driver shutdown

Verify drv and card pointers before calling for driver shutdown.

Change-Id: I855e32f988ec1af475df6ed91f04618525e1a59f
Signed-off-by: Eugene Yasman <eyasman@codeaurora.org>
script: dtc: clean generated files

Fix "make distclean" to clean up generated dtc files.

Without this patch the following files are left around:
 - dtc-lexer.lex.c
 - dtc-parser.tab.c
 - dtc-parser.tab.h

Change-Id: I0dd3b4804bd244827b02be9446f239b5bfef3d0c
Signed-off-by: Magnus Damm <damm@opensource.se>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Git-commit: 4f3be1cfa8422c93271dcdb59f223f6c84c70804
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: David Collins <collinsd@codeaurora.org>
dtc: import latest upstream dtc

This updates scripts/dtc to commit 317a5d9 "dtc: zero out new label
objects" from git://git.jdl.com/software/dtc.git.

This adds features such as:
* /bits/ syntax for cell data.
* Math expressions within cell data.
* The ability to delete properties or nodes.
* Support for #line directives in the input file, which allows the use of
  cpp on *.dts.
* -i command-line option (/include/ path)
* -W/-E command-line options for error/warning control.
* Removal of spew to STDOUT containing the filename being compiled.
* Many additions to the libfdt API.

Change-Id: I026548e66cb994b75fe01ee323155bf23938e43e
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Jon Loeliger <jdl@jdl.com>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Git-commit: cd296721a9645f9f28800a072490fa15458d1fb7
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: David Collins <collinsd@codeaurora.org>
dtc: fix for_each_*() to skip first object if deleted

The previous definition of for_each_*() would always include the very
first object within the list, irrespective of whether it was marked
deleted, since the deleted flag was not checked on the first object,
but only on any "next" object.

Fix for_each_*() to check the deleted flag in the loop body every
iteration to correct this.

(upstream dtc commit 1762ab42ef77db7ab2776d0d6cba3515150f518a)

Change-Id: Icfe0cd4bc7903c2ea7b85febfa154e9bcf4b552c
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Git-commit: 205a8eb7ce713c7f1722297dd97d19dcea6f266c
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: David Collins <collinsd@codeaurora.org>
msm: ipc: Make the kernel-space read operation as non-blocking

Update the read operations of kernel space to be non-blocking and
return -ENOMSG when there is no message to read.

CRs-Fixed: 508370
Change-Id: I92f55d8829755078f34ff3cbe2dc9b16ed7988df
Signed-off-by: Zaheerulla Meer <zmeer@codeaurora.org>
Signed-off-by: FNU Ramendra <rramendr@codeaurora.org>
msm: ipc: Handle the Resume_Tx events from remote endpoints

To prevent the QMI clients from flooding the remote services, IPC Router
transport supports a flow control mechanism. When the IPC Router
transport returns -EAGAIN during message transmission, queue the packet
into client's pending transaction queue for transmission during later
time. In addition, handle RESUME_TX events from the remote services and
use that event to transmit the packets in pending transaction queue.

CRs-Fixed: 508386
Change-Id: Ib24256fd0dbeecb9d96ea03ffd86afe2b4cc1483
Signed-off-by: Zaheerulla Meer <zmeer@codeaurora.org>
Signed-off-by: FNU Ramendra <rramendr@codeaurora.org>
msm: qmi: Update the wait-for-response to UNINTERRUPTIBLE

Currently once a QMI request is sent, the wait for the response is
interruptible. Sometimes the wait returns -ERESTARTSYS due to signals or
for reasons other than response reception. Since the interface to send
a QMI request is restricted completely within the kernel-space, the
kernel QMI client is not able to handle -ERESTARTSYS gracefully.

Update the wait-for-response in the interface API to uninterruptible.

CRs-Fixed: 504771
Change-Id: I91262e6a7057b5387adfd4728ba9a6ea7002e5d9
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Signed-off-by: FNU Ramendra <rramendr@codeaurora.org>
arm/dt: 8974: Add enabled interrupts to bypass list

The following interrupts were added to Bypass list
to enable XO shutdown for smart panel during static
display

hwirq: 56 ->  modem_wdog
hwirq: 70 ->  msm_iommu_pmon_nonsecure_irq
hwirq: 97 ->  msm_iommu_nonsecure_irq
hwirq: 105 -> msm_iommu_pmon_nonsecure_irq
hwirq: 181 -> wcnss_wdog
hwirq: 211 -> dwc3_otg

Signed-off-by: Badhri Jagan Sridharan <badhris@codeaurora.org>
Change-Id: I554e8090bcc8168f0f7e60f6962e55871ea44b1b
Revert "msm: pm-8x60: Add PNOC request to prevent PNOC clk gating"

This reverts commit 9b186afca6c206ef1e74c138a10b75bdab4ba422.

Change-Id: Ifb0e0af69f6e63cae74ba2c50cb5d126257bc43d
Signed-off-by: Badhri Jagan Sridharan <badhris@codeaurora.org>
msm: clock-8974: Add PNOC request to prevent PNOC clk gating

Keep a request of 19.2Mhz for PNOC bus when APSS is not
in idle-pc.

Signed-off-by: Badhri Jagan Sridharan <badhris@codeaurora.org>
Change-Id: Ib08b92949c970bc353cca1d5a5e3155a65c02dbb
msm: acpuclock-8974: Modify L2 and DDR mapping

This helps power by voting for DDR to run at 460 MHZ
instead of 614 MHz when L2 is running at 1.04 GHz

Change-Id: I6e285de5d1806adcbedf2e526de9c733814df709
Signed-off-by: Dilip Gudlur <dgudlur@codeaurora.org>
Merge "msm: acpuclock-8974: Modify L2 and DDR mapping"