msm: adsp: qdsp5v2: Increase retry duration to 5msecs. When DSP is not ready to accept a command, ADSP driver retries for 40 times with 50 usecs delay each time which amounts to 2 msec in total. But when DSP is busy processing commands it may take more than 2 msec to respond to requests from application processor.

Hence updating the number of trials to 100 with 50 usecs delay each
time thus increasing the maximum delay to 5 msecs.

CRs-fixed:242965
Change-Id: I80eafe06d8b2188214e3cc81d144e2a51d470eb7
Signed-off-by: Suresh Vankadara <svankada@qualcomm.com>
PM: Provide generic subsystem-level callbacks

There are subsystems whose power management callbacks only need to
invoke the callbacks provided by device drivers.  Still, their system
sleep PM callbacks should play well with the runtime PM callbacks,
so that devices suspended at run time can be left in that state for
a system sleep transition.

Provide a set of generic PM callbacks for such subsystems and
define convenience macros for populating dev_pm_ops structures.

Change-Id: If7f7a063918db76c5c14adb4c1e393cce675c747
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
[dkulinsk@codeaurora.org: added KConfig change and resolved conflicts]
Signed-off-by: Derek Kulinski <dkulinsk@codeaurora.org>
PM / platform_bus: Allow runtime PM by default

Currently the default runtime PM callbacks for platform devices return
-ENOSYS, preventing the use of runtime PM platforms until they have
provided at least a default implementation. This hinders the use of
runtime PM by devices which work with many platforms such as memory
mapped devices, MFDs and on chip IPs shared by multiple architectures.

Change the default implementation to the standard pm_generic_runtime
one, allowing drivers to use runtime PM without per-architecture
changes.

Change-Id: I8b985a20bac055b512e94594694b98500a8249ce
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Derek Kulinski <dkulinsk@codeaurora.org>
msm: alsa: fix for routing to external codec devices

Problem
The current implementation does not handle external codec
routing properly.The driver attempts to route to icodec device
ignoring all routing.

Impact
audio playback failure on all devices except icodec

Solution
modified to handle runtime switching and cache all routing
done before playback and record starts.

CRs-fixed: 246640
Change-Id: Ie5fbd424fc09a741a9842118cb5ebdab34122bfe
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
msm: mm: Fix errors when turning on SPARSEMEM

Carry forward the fix from 2.6.29b kernel to handle the
NR_SECTION_ROOTS == 0 case when turning on SPARSEMEM on MSM.
Also fix the linux coding style typos by replacing
"foo* bar" with "foo *bar".

Change-Id: I77f259f3d62980a37f4ae7c4680a3617c9b4f563
Signed-off-by: Naveen Ramaraj <nramaraj@codeaurora.org>
msm_fb: Write proper FPGA value to avoid conflict with UART

Write proper FPGA value into SIGNAL_EXPANDER registers in HDMI
driver to avoid conflict with UART GPIO's selection.

CR's fixed: 241467

Change-Id: I5880b287454870e2c1fae82691b9584a3ae27027
Signed-off-by: Abhishek Kharbanda <akharban@codeaurora.org>
msm: msm_nand: Configure EBI2_CFG register once during driver probe.

Configure EBI2_CFG register once during driver probe instead setting
and clearing everytime in read/write functions of ping pong mode for
7x30.

CRs-fixed: 247540
Change-Id: I570f654a52ae424cefae4fb9ddbcc58a8ec62152
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
msm: rpc: Modify classification of SDIO XPRT log messages

Log debug message for sure, in case of failure conditions, using
printk. Change certain INFO message types to DBG message types.
Log only INFO messages by default.

Change-Id: Id8a5f7add6397d7c34bab3da6c30fc8271f34866
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
diag: Disable interrupts before acquiring spin locks DIAG uses spinlocks before calling SMD API. Now these SMD APIs can be called from either USB ISR or SMD ISR. Hence disabling interrupts before acquiring spin locks.

Change-Id: I57204c177c8f70a3deb146429f5a60a68e2c44d8
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
msm: rmnet: Initialize the wakelock before taking the lock

Wakelock is being initialized after the sdio_open call.
This introduces a corner case where taking the lock is
attempted from read task before lock is initialized.
Initialize wakelock before sdio_open call.

Change-Id: I32ef6d230c3a5b7fa8b59f9c97bfcea0947c00dc
CRs-fixed: 247808
Signed-off-by: Niranjana Vishwanathapura <nvishwan@codeaurora.org>
USB: Minimize delays involved in root hub initialization during HNP

Host controller driver may register root hub during HNP while
becoming B-Host.  Remove delays involved in debouncing and
applying port power.  This helps B-device to meet TB_ACON_BSE0
timing parameter and A-device will not find bus idle for longer
than TA_BIDL_ADIS.

Change-Id: Ib5df6417b10c6bde5bf5b9fd688c13a305ce7a4d
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
msm: mfd: Use debugfs interface to allow marimba codec register access

To poke
echo "<addr> <value>" > /sys/kernel/debug/marimba_codec/poke

To peek
echo "<addr>" > /sys/kernel/debug/marimba_codec/peek
cat /sys/kernel/debug/marimba_codec/peek

To power on/off the codec
echo "<cmd>" > /sys/kernel/debug/marimba_codec/power
<cmd>: 1-on, 0-off

Signed-off-by: Jay Wang <jaywang@codeaurora.org>
Change-Id: Id7417d01f39d0bbff7a2924cb5761fa273c8f243
cpuidle: extend cpuidle and menu governor to handle dynamic states

On some SoC chips, HW resources may be in use during any particular idle
period.  As a consequence, the cpuidle states that the SoC is safe to
enter can change from idle period to idle period.  In addition, the
latency and threshold of each cpuidle state can vary, depending on the
operating condition when the CPU becomes idle, e.g. the current cpu
frequency, the current state of the HW blocks, etc.

cpuidle core and the menu governor, in the current form, are geared
towards cpuidle states that are static, i.e. the availabiltiy of the
states, their latencies, their thresholds are non-changing during run
time.  cpuidle does not provide any hook that cpuidle drivers can use
to adjust those values on the fly for the current idle period before the
menu governor selects the target cpuidle state.

This patch extends cpuidle core and the menu governor to handle states
that are dynamic.  There are three additions in the patch and the patch
maintains backwards-compatibility with existing cpuidle drivers.

1) add prepare() to struct cpuidle_device.  A cpuidle driver can hook
into the callback and cpuidle will call prepare() before calling the
governor's select function.  The callback gives the cpuidle driver a
chance to update the dynamic information of the cpuidle states for the
current idle period, e.g. state availability, latencies, thresholds,
power values, etc.

2) add CPUIDLE_FLAG_IGNORE as one of the state flags.  In the prepare()
function, a cpuidle driver can set/clear the flag to indicate to the
menu governor whether a cpuidle state should be ignored, i.e. not
available, during the current idle period.

3) add power_specified bit to struct cpuidle_device.  The menu governor
currently assumes that the cpuidle states are arranged in the order of
increasing latency, threshold, and power savings.  This is true or can
be made true for static states.  Once the state parameters are dynamic,
the latencies, thresholds, and power savings for the cpuidle states can
increase or decrease by different amounts from idle period to idle
period.  So the assumption of increasing latency, threshold, and power
savings from Cn to C(n+1) can no longer be guaranteed.

It can be straight forward to calculate the power consumption of each
available state and to specify it in power_usage for the idle period.
Using the power_usage fields, the menu governor then selects the state
that has the lowest power consumption and that still satisfies all other
critieria.  The power_specified bit defaults to 0.  For existing cpuidle
drivers, cpuidle detects that power_specified is 0 and fills in a dummy
set of power_usage values.

Signed-off-by: Ai Li <aili@codeaurora.org>
msm: Add Timpani Sound Device Profile

This header file defines Timpani Codec profiles for
commonly used sound device mode such as handset

Change-Id: I89085560f488ba26c593907bf08196177f21af9e
Signed-off-by: Patrick Lai <plai@codeaurora.org>
msm: socinfo: Add platform type for SVLT

For SLVTE target the mapping for hardware type is not
present and because of that the proper keypad file is
not getting selected. Because of which Alphanumeric keys
are not working on Fusion FFA.

Change-Id: I86c2e32bcf517740c07991c1c57303693ca88988
CRs-fixed: 248720
Signed-off-by: Mansoor Aftab <maftab@codeaurora.org>
msm: Peripheral reset driver

On some MSM targets peripherals such as the modem, qdsp, and dsps
are booted by Linux. In this case, Linux takes on the
responsibility of:

 1) validating images

 2) loading images into memory

 3) bringing peripherals out of reset

The first part is implemented by means of init_image(),
verify_blob(), and auth_and_reset(). The third part is
implemented by the reset_*() functions for each device.

The loading part (2) is handled by the peripheral image loading
driver, which will come in a later patch.

Change-Id: I0415a618ed0ecec2b683a5028c394480106de66e
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
dma: annotating dma for runtime PM

Change-Id: Ia9c4744f6aea124a1e9a7102e454dfe5c6da081e
Signed-off-by: Jeffrey Chuang <fchuang@codeaurora.org>
media: camera: Skin color Enhancement feature

Added support for Skin Color Enhancement on VFE 3.1

Change-Id: I451485c6e6ba9c30c97fb261bc6852752fd050cb
Signed-off-by: Nagesh Subba Reddy <nageshsreddy@codeaurora.org>
msm: rmnet: Add tailroom for sk buffer to be transmitted

sk buffer should have a tailroom so that mux layer may pad
in order to keep the data length a multiple of 4 bytes.

Change-Id: Ie3df6f6ae2b25e1a604e831be6e1ad2c89d03f1d
Signed-off-by: Niranjana Vishwanathapura <nvishwan@codeaurora.org>
mmc: Char SDIO Device Driver

The Char SDIO Device Driver is an interface which exposes an SDIO
card/function from kernel space as a char device in user space.

Change-Id: If298cdd6d4426b700e69affa5a3602cd221ad89c
Signed-off-by: Alexander Kolesnikov <akolesni@codeaurora.org>