ARM: dts: msm8974: Update MPM mapping to bypass uart_2_irq

Include uar_2_irq in bypass list to allow XO shutdown as this
is not wakeup-capable. uart driver has wakeup gpio on CTS pin and
optional wakeup gpio on rx pin. This should take care of wakeup
from low power state if there is any activity on the pin.

Change-Id: I10d2347eb760146b69f5b13f4cababbfcadb17bf
Signed-off-by: Girish Ghongdemath <girishsg@codeaurora.org>
msm: mdss: Add SMP parameters into hw capabilites

To handle use cases better, expose smp_mb_cnt and
smp_mb_per_pipe to userspace as part of hardware capability.
Pipes availablity for a use case can be computed taking these
values, based on which, composition decisions can be made.

Change-Id: Ia7cc4db153cdb164a29ae2369d3e991b95aaba65
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
msm: kgsl: Remove sscanf() from kgsl_pwrctrl.c

Replace sscanf() in kgsl_pwrctrl.c with a generic function to safely
convert 32 bit unsigned ints.

CRs-fixed: 563585
Change-Id: Ic0dedbad10e2264ec8fccab622d094d123b49b77
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
power: qpnp-charger: fix corner case for JEITA

When the ADC notifier is called there is a possibility
that the measured temperature is exactly equal to the
threshold rather than larger or smaller. In this case
JEITA rules are not applied.

Fix this by fixing the JEITA logic to also include
the exact threshold value and thus applying the
correct JEITA logic.

CRs-Fixed: 620291
Change-Id: Ib9462e7d28f6534c359873487420ec21b3e8aaa1
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
msm: kgsl: don't use sscanf()

Friends do not let friends use sscanf().

CRs-Fixed: 563605
Change-Id: Ic0dedbad56af5bbee4fc833701d8bc93b118efa9
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
WLAN subsystem: Sysctl support for key TCP/IP parameters

It has been observed that default values for some of key tcp/ip
parameters are affecting the tput/performance of the system. Hence
extending configuration capabilities to TCP/Ip stack through
sysctl interface

Change-Id: Ia92fc229c0a4a8c3f7e4e02cf7e3c8849719ddff
CRs-Fixed: 507581

Signed-off-by: Kiran Kumar Lokere <klokere@codeaurora.org>
msm_serial_hs: Manage clock path-vote correctly

clock path vote is needed for core and iface vote,
so remove it after these votes are removed, and
make sure clock path vote/unvote are balanced by
removing unnecessary clock path vote

CRs-Fixed: 606403
Change-Id: I2ca2ef1cac3f0aacb7d21eb4da8bed3d39e0158c
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
msm: vidc: Free smem client after moving core to UNINIT

If userspace crashes prematurely, there will be a good chance that the
driver hasn't unmapped or freed certain buffers.  These buffers will be
freed in the state transition to UNINIT.  At that point the smem client
needs to be valid for the free/unmaps to be valid.

CRs-Fixed: 611946
Change-Id: I089dcbd1e79f1c2a8671e5719d3a5dbc9926b252
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
msm: vidc: initialize venus hfi locks during hfi creation

Venus hfi locks were initialized during core init,
which is invoked when the first video instance is
created. If a debugfs command is executed before
starting the first video instance, then video driver
crashes trying to lock an uninitialized mutex.

Change-Id: I472e9de91dada94a2728dd02c747e7fde63e3e4f
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
msm_serial_hs: Dynamic allocation of port structures

This patch allocates the msm_hs_port structures
dynamically during probe and cleans up during exit.
The msm_hs_get_uart_port function now looks up the
uart_state data structure to find the right uart_port.

Change-Id: I3876959eb41173d2115d2c1acfc612b75ca2e46a
Signed-off-by: Naveen Kaje <nkaje@codeaurora.org>
msm_serial_hs: Implement driver functionality to be closer to HW spec

Implement TX callflow to be in accordance with HW spec and make
sure TXEMT clock off logic is correct. On receiver side, issue
force stale interrupt and make sure upper layer get bytes upto
size of RX buffer

CRs-Fixed: 575119
Change-Id: Iee469b0ba489386b571a86897b62eae84ff34ca5
Signed-off-by: Naveen Kaje <nkaje@codeaurora.org>
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
msm_serial_hs: Defensive checks

Add defensive checks in the APIs exposed to clients
and tty layer to avoid unclocked access

CRs-Fixed: 593860
Change-Id: Ibb80b18143a3b90156a7043fd66d4097f7c073e1
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
ASoC: msm8x10: Add backend DAI Link for incall music delivery

A new backend DAI link is required for DSDA incall music
delivery. This is because two different voice sessions will
use different ports and backends.

Change-Id: Icff8676872d40094f49b52df8ee3219a2f3283cd
CRs-Fixed: 571380, 616154
Signed-off-by: Avinash Vaish <avaish@codeaurora.org>
ARM: dts: msm8610: Add support for incall LCH tone playback

Add incall local call hold tone playback device required
for delivering LCH tone to the farside. A separate device
is required in the device tree for each different voice
session/subscription.

Change-Id: I6b723be6a025dba80f117c3032c4352952142fb8
CRs-Fixed: 571380, 616154
Signed-off-by: Avinash Vaish <avaish@codeaurora.org>
power: qpnp-bms: fix unbalanced IRQ enables

After a previous patch, the BMS driver's sw_cc_thr and ocv_thr IRQs were
being enabled twice, causing a warning in the kernel log. This happened
because the bms_irq_disable function was being called after the BMS
driver found the IRQ number but before it was requested.

Disabling the IRQs from the bms driver before they were requested
resulted in a situation where the BMS thinks that the IRQs are disabled
but the request function had reset the IRQs so that they were enabled
once again.

Fix this by adding a ready bit to the bms_irq struct and setting it
after the devm_request_irq call. If an IRQ is not ready, then do not
enable or disable it.

Change-Id: I52dfbe6c21b8c5cadf60874beab0fe1a4ec7a63f
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
msm: vidc: Re-program the vbif settings post-power collapse

As part of power collapse we turn off the venus GDSC. When we turn it
back on, we need to re-program the VBIF registers to overwrite the
reset values.

CRs-Fixed: 585609
Change-Id: Ic2ac40274773f9592f510ccb573b9d4920a8647f
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
wcnss: Correct the logging sequence of certain registers

PMU_PLL_STATUS and PMU_CPU_AHB_CFG_RCGR registers should be dumped
despite common_ss being collapsed.

CRs-fixed: 615461
Change-Id: Iac7da726ad70420d29411e0c9f6bcd75c776ba50
Signed-off-by: Yue Ma <yuem@codeaurora.org>
msm: wcnss: Add the support to access IRIS registers using bit-bang

During cold boot, if firmware watchdog bite happens, WCNSS platform driver
will try to log Pronto registers, but in some cases it cannot access them
since there is no clock on Pronto. Add the support to log IRIS registers
using bit-bang in order to debug this issue.

CRs-fixed: 616588
Change-Id: I9315c295d33d131224605adddca26796de25e1fb
Signed-off-by: Yue Ma <yuem@codeaurora.org>
mmc: sdhci: add asynchronous interrupt support for sdio card

Some controllers can gate the clock to save power
even for SDIO cards. In such cases, an asynchronous
interrupt mechanism is used to receive interrupts
even when clocks are off.

This patch wakes up the sdio thread if interrupts
were received when clocks were off.

CRs-Fixed: 585481
Change-Id: Ifcfafad251dedc992637596b6bb9349cfbca5d8b
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
mmc: core: add wakeup functionality to sdio cards

This patch initializes wakeup source if the detected card
is a sdio card and enables the wakeup capability.

Platform drivers would have to invoke:
 * pm_wakeup_event on this card device to signal a wakeup
 * corresponding pm_relax have to be invoked

CRs-Fixed: 585481
Change-Id: Ic8d5c98073e8ed3f676eb42fc0ce1f13a11cb40f
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>