ASoC: OMAP: lock mutex in aess_hw_params

aess_hw_params() calls subroutines that manipulate registers and
buffers in the ABE.  Therefore it needs exclusive access to the ABE to
prevent corruption.

Change-Id: I5a8f62a818168bb402dcf48f619e993a9ee26df7
Signed-off-by: Francois Mazard <f-mazard@ti.com>
Signed-off-by: Gabriel M. Beddingfield <gabrbedd@ti.com>
ASoC: McPDM: Update ABE OPP constraint for McPDM

With ABE release 09.50 both UL and DL task for McPDM are at OPP 25
So we just need to set the constrain to OPP 25 instead of 50.

Change-Id: Ic250678085d0b763993d3be8f540bc0cf836924e
Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
Signed-off-by: Chris Kelly <c-kelly@ti.com>
ASoC: McPDM: Remove extra CTRL register clear

Reset value of MCPDM_CTRL is 0, so there is no need to do an
extra clear write during McPDM DAIs probe(). One important
advantage of removing this extra register access is that it
removes the dependency on the McPDM clock which is supplied
externally.

Change-Id: I8bcad0494cc389523172b0f9ae5834e0f0f96326
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
ASoC: ABE HAL: Set proper physical ID for MM_EXT port

Correct logical to physical port mapping for MM_EXT ports.

Change-Id: Ia617ec5cc9fcba85bcdedbb29aa3fe8ce9307985
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Axel Castaneda Gonzalez <x0055901@ti.com>
omap: omap-mcbsp: fix compilation warnings

 In function 'omap_mcbsp_dai_set_dai_sysclk':
 warning: suggest explicit braces to avoid ambiguous 'else'

Change-Id: Ic273b811371ae12ae76097cc709327443690d39b
Signed-off-by: Leed Aguilar <leed.aguilar@ti.com>
ASoC: OMAP ABE: Restore defaults for DMA params

The static struct omap_abe_dai_dma_params is used to both set defaults
and serve as the omap_pcm_dma_data instance for the driver.  In some
cases, the values in this struct are overridden to suit the end-use.
When these overrides happen, there was nothing to set them back to the
original default.

This fixes an issue where single-channel headset (AMic) recording
causes subsequent DMic recordings to be rendered at double-speed.
This happened because the the dma data_type was being set to
OMAP_DMA_DATA_TYPE_S16 in the static struct omap_abe_dai_dma_params.
After being set, the value was never restored to
OMAP_DMA_DATA_TYPE_S32 (needed by DMic recording).

Change-Id: Iea2b19d451edc10ab864ca6c1a2b6b3449b05bea
Signed-off-by: Gabriel M. Beddingfield <gabrbedd@ti.com>
ASoC: OMAP4 ABE: Add CONFIG_SND_OMAP4_ABE_USE_ALT_FW

This enables a build to load the alternate ABE Firmware.

Change-Id: I5772616c576234845d0e839067d5b85f232f12be
Signed-off-by: Gabriel M. Beddingfield <gabrbedd@ti.com>
ASoC: OMAP4 ABE: Allow an alternate ABE firmware to be used.

On commit 52c46046 the ABE firmware was updated with a version that
included several improvements, but also disabled the digital
microphone (DMIC) feature.  In order to support DMIC on devices like
the Blaze, an alternate firmware (and matching code) must be
configured.

This commit allows an alternate firmware using
CONFIG_SND_OMAP4_ABE_USE_ALT_FW.

Change-Id: I2fd4aa8d03be802722dca973a71435b9965e80ea
Signed-off-by: Gabriel M. Beddingfield <gabrbedd@ti.com>
OMAP:ABE: Fix schedule tablet formatting

Fixed the formatting of the code when the MultiFrame is set to 0

change
= 0/*...*/;
to
= 0; /*...*/

No operational changes are made to this file

Change-Id: I6b49e0f66f2fad16e540968c6ca926e450c60bf5
Signed-off-by: Dan Murphy <dmurphy@ti.com>
ASoC: ABE: update to ABE firmware 09.51.

New features:
- SRC 44.1 to 48 for MM_DL port (CBPr or Ping/Pong)
- Split monitoring of ABE filters saturation
- Table for filter saturation 8 or 16 kHz

Change-Id: I469a477612d4c927516e2bc96ea07d672bfcf3e0
Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
Signed-off-by: Chris Kelly <c-kelly@ti.com>
Signed-off-by: Barry Woodward <b-woodward@ti.com>
Signed-off-by: Gabriel M. Beddingfield <gabrbedd@ti.com>
ASoC: ABE HAL: Change ABE port priority table for BT voice call

Up to now the VX ports had a higher priority than BT port.
When voice call starts or stops, the ABE reference clock
changes between Modem clock and ABE system clock.
This change can produce noise on the multimedia tone played in the same time.
To avoid that the BT needs to have the priority.
Indeed, the ABE ref clock will stay at ABE system clock
inside/outside voice call.
As Vx ports have ASRC there's no problem of clock drift.

Change-Id: Ie04fe6705e6c85fe3c83bf684717ae48a10a43e7
Signed-off-by: Francois Mazard <f-mazard@ti.com>
[Blaze] ASoC: OMAP4 - DMIC DAI driver

Add both legacy DMA and ABE support for Digital Microphones on the
OMAP4 platform.

Change-Id: Ib6681c51d78255ba94177821c570e4dd5021a243
Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Chris Kelly <c-kelly@ti.com>
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>

Conflicts:
	sound/soc/omap/Kconfig
ASoC: DMIC: Implement Errata i653

Implement Errata i653: if the DMIC path is reset by SW_DMIC_RST, uplink
FIFO is correctly reset but the dma pending signal is kept asserted.
This can result in an invalid access by the host DMA to uplink FIFO.

The workaround involves:
- Enable channels:
   DMIC_CTRL.SW_DMIC_RST = 1
   Enable necessary channels
   DMIC_CTRL.SW_DMIC_RST = 0

- Disable channels:
   DMIC_CTRL.SW_DMIC_RST = 1
   Disable all channels
   DMIC_CTRL.SW_DMIC_RST = 0

Change-Id: I03766e32493322094fb48d9ae07a19d15695996a
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
HACK: ASoC: OMAP ABE: Save DL1 BE related gains

MM_EXT_DL gains were being lost when ABE was hitting OFF, because
they were not properly saved when DL1 last active BE was muted.

Save DL1 BE gains along with ABE context in order to avoid
losing their values when OFF is hit. Gain values are saved when
gains are muted. These gains were not properly muted if BT_VX_DL
or MM_EXT_DL port was enabled and DL2 path was active, since
PDM_DL1 port gets enabled(for DL1 or DL2) when ABE McPDM is started.

Change-Id: Ib0d658c65c134f7ee4baeb13f7e09f6299b1923a
Signed-off-by: Axel Castaneda Gonzalez <x0055901@ti.com>
ASoC: OMAP ABE: Update ports in order to support 44.1 KHz

With new ABE release the driver can support now 44.1 on MM DL
and TONES DL port. For MM DL port a true interpolation is done.
For TONES DL the ratio 12/11 is used.

Change-Id: Ic433e1576e7c86b1477c1854816caf5cefdceeed
Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
Signed-off-by: Chris Kelly <c-kelly@ti.com>
ASoC: OMAP ABE: Allow FE ports to be muted independently

To avoid muting a FE due an active BE update. Digital muting
control for FEs should be independent of the number of active BEs
and dependent only on active FEs updates.

Change-Id: I227231939f24e93ecee41043a11bcef2045915da
Signed-off-by: Axel Castaneda Gonzalez <x0055901@ti.com>
ASoC: TWL6040: Configure Phoenix Audio at 88.2 only for 88.2 kHz

As with new release of ABE firmware the ABE is supporting 44.1kHz
we need to set Phoenix Audio clock to 96 kHz. Today this setting
is not well computed by the driver as it is associated to the
sample frequency

Change-Id: I46f432574f90140809c0ac0b2f393d386cbdb01b
Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
Signed-off-by: Chris Kelly <c-kelly@ti.com>