msm: audio: qdsp6v3: Wait indefinitely for subsystems to be loaded.

Wait indefinitely for lpass or modem to be loaded instead of waiting
for a timeout of 5secs. The reason being downloading of images might
take long time.

CRs-fixed: 302002
Signed-off-by: Bharath Ramachandramurthy <bramacha@codeaurora.org>
msm: audio: qdsp6v3: Close smd ports upon failure to open.

The smd port acqusition is failing as the port is not
populated from modem . But apr driver was not releasing
the apr handle on failure.
This was resulting in failure for subsequent calls.
With this change, the smd ports will be released upon
encountering failure.

CRs-fixed: 309413
Signed-off-by: Bharath Ramachandramurthy <bramacha@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/qdsp6v3/q6voice.c
msm: audio: qdsp6v3: Modify the wait timer for apr registration

As part of subsystem restart, there was a  deadlock where
the kernel acquires a mutex as part of misc device open for
the pcm out driver and the kickstart thread also tries to
acquire the same mutex before restarting the modem
as the apr register was a blocking call.

Instead of waiting indefinitely for lpass or modem to be restarted
the apr register will wait for one second timeout and if the
subsystems are not up, return failure to userspace.
This will release the mutex acquired as part of misc device open
and kickstart thread can reload the modem.

Change-Id: I21a078314ce5fff24bb0cd43fe419dd5a2580ac5
CRs-fixed: 312818
Signed-off-by: Bharath Ramachandramurthy <bramacha@codeaurora.org>
Signed-off-by: Swaminathan Sathappan <Swami@codeaurora.org>
msm: audio: qdsp6v3: Add delay in speaker device profile to reduce pop

Add delay in the power up sequence of speaker stereo device profile
To reduce the pops.

CRs-Fixed: 327943
CRs-Fixed: 329707
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
(cherry picked from commit 83cda7be04d041c6c003e8cf5fa8d7add91548d4)

Change-Id: Ice03506ce1f8d9c87da812c93a94da0ee6d617b2
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
msm: audio: qdsp6v3: Fix memory leak and error handling

The error handling of apr_reset_workqueue and apr_reset_worker when
NULL should be two seperate checks and hence should have corresponding
appropriate log msgs.

Also there is no need to allocate memory for apr_reset_worker if
apr_reset_workqueue is NULL.

Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
Change-Id: I220a23729d0fc6dadce144e476a8b2af727fc6b6
(cherry picked from commit 1abc51555a2b51614682cec1e0c8959d5ed47d8d)
Revert "Input: Use accessor for MT values"

This reverts commit a99ec87b4ddfc81121189606411183d50c364de7.
Revert "Input: Send events one packet at a time"

This reverts commit f9e31088f2189d69a5951b36fa1b1ff2fb198de0.
mmc: msm_sdcc: Power down slots after reboot

Some reboot methods (eg. adb reboot) may not power
down SDCC slots. This can result in cards being
in unexpected states after reboot. Explicitly reset
slot voltage regulator on reboot.

CRs-Fixed: 341840
Change-Id: I8cdb52bc58e34900378af468794760653f3babad
Signed-off-by: Oluwafemi Adeyemi <aadeyemi@codeaurora.org>
mmc: core: Export mmc_set_ios so that host drivers can use it

mmc_set_ios() is used by host drivers during suspend/resume
routines in indirect way i.e., by calling host->ops->set_ios().
But now with MMC_CLKGATE enabled, mmc_set_ios() also updates
host->clk_gated flag. So export this API so that host controller
drivers can use it.

CRs-Fixed: 346559
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
(cherry picked from commit f0410bc6dcacabf599f999f4779091f5cd2c55dc)

Change-Id: Ib7ad7588c1ba4ae5da3ceaaade18caf7c4bdecd1
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
mmc: msm_sdcc: vote for msm bus bandwidth

If there is no voting for the system fabric clock, it may run at the
minimum clock speed. If system fabric is running at lower speed (than
what is needed by SDCC workload), SDCC read & write throughput numbers may be
degraded.

This patch adds the msm bus voting for bandwidth required by SDCC driver
based on card clock speed and bus width.

CRs-Fixed: 355327
Change-Id: I7fbcbe22beb09408f8460f815a6f7d34105e21cb
Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org>
Revert "mmc: sdio: optimized SDIO IRQ handling for single irq"

This reverts commit 06e8935febe687e2a561707d4c7ca4245d261dbe.
With the optimization, the sdio_irq_thread() sends a spurious
interrupt notification to the registered function handler during
ksdioirq thread start up. The function handler may or may not
handle this interrupt gracefully. The correct way to inform
about interrupt is to check CCCR_INTx register for pending
interrupts before calling function driver's irq handler
which is broken with this optimization, hence the revert.

CRs-Fixed: 345547
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
(cherry picked from commit 6e611f2b8655684f578cb975fa0ebfd031b45d69)

Change-Id: I7ea674b7ac343491c4965b5007d4d48696cbfa43
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>