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>
OMAP4: PM: setup initial OPP configuration

pm.c setups the initial voltage and frequencies for init devices
on bootup to be careful of invalid device configurations by
custom bootloaders. However, DVFS data structures are not aware
of these - As a result, when doing the first time scale of
a differnt device we could have a following scenario:

At boot - MPU,IVA,Core at OPP100

after pm framework has completed initialization, lets say IVA/AESS
transitions to OPP50, DVFS framework does not have information about
the OPP current frequency/voltage of IVA/MPU and sees that only
IVA is requested, moves the IVA and core to OPP50. This configuration
is invalid as MPU is currently at OPP100 and device should not have
scaled core to OPP50 without looking at OPP100 configuration of
MPU.

To resolve this, we populate the dvfs data structure with the
requisite init devices' frequency configuration by doing a
omap_device_scale.

Change-Id: Ib3048fb7fadec5adabbbcbce56c1ead026953de6
Reported-by: Hemanth V <hemanthv@ti.com>
Tested-by: Akash Choudhari <akashc@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
HACK: OMAP2+: Makefile: sequence SR earlier than idle init

SR should be initialized in sequence before idle initialization
is done and after pm basic inits are complete. PM initialization unfortunately
is not too smart and has to depend on initcall sequencing to ensure
proper dependencies are met. instead of fixing the entire PM init
sequence(which is possible with function pointers being registered and invoked,
but needs an entire revamp of OMAP PM's infrastructure), move SR initialization
up in the chain to ensure this works.

Change-Id: I643f73168753f618ccac6fd34b135aeb93923637
Signed-off-by: Nishanth Menon <nm@ti.com>
OMAP: TILER: Add bounds checking on format inputs

Added bounds checking to validate incoming tiler format.

Change-Id: Icd791cc294ecb1838afb3f91451626debd59c29e
Signed-off-by: Andy Gross <andy.gross@ti.com>
SMC: Update to AG01.06 production release

Last SMC update was to AG01.06 engineering release (see s_version.h)
this is the official patch to production AG01.06.

This update notably brings support for:
  * OMAP4 HW RNG - see new menuconfig option
  * GP devices are okay to be built with this SMC based on testing
      (even though it is not functional for GP devices, the SMC driver
      will no longer keep the device from entering suspend)

Change-Id: I974693ca73a038e2b547917e1a9556299a9bab11
Signed-off-by: Trusted Logic <smc_support@trusted-logic.com>
Signed-off-by: Jeremie Corbier <jeremie.corbier@trusted-logic.com>
Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>

Conflicts:
	security/smc/Makefile
SMC: Fix PA load error 0xffff3020

Fix "Error while loading the PA [0xffff3020]"

Improve synchronous public crypto.

WARNING: using this patch with an older PA binary (before MSHIELD
v1.7.5) will result in a PA load error. This patch is coupled with
changes in the secure PA (cache flush/invalidiation)

Change-Id: I3c3b7c41917b1146d6cb6f29ee33848eb9c3c0dc
Signed-off-by: Trusted Logic <smc_support@trusted-logic.com>
Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>
SMC: Fix regression where AES1 clock would never be disabled

Change-Id: I3b620a573b2eee85c76036bcdab9f851ce9c7513
Signed-off-by: Trusted Logic <smc_support@trusted-logic.com>
Signed-off-by: Jeremie Corbier <jeremie.corbier@trusted-logic.com>
OMAP: HDMI: Correction in HDMI PLL program sequence

Current code sets PLL_GO to 1 and the waits for the PLL_GO to
become 1. This is not required and instead we should wait for
PLL_GO to become zero. As per TRM once PLL operation is over
PLL_GO bit will be reset to zero. After waiting for PLL_GO to
become zero PLL_STATUS register is read to check the PLL LOCK
status.

Change-Id: If077695ee95d07df354d97f2b88cf64db94bc27e
Signed-off-by: Muralidhar Dixit <murali.dixit@ti.com>
OMAP4: DSI: DSI reset removal during enabling

DSI module is made wake up capable in its HWMOD flags but in
The function omapdss_dsi_display_enable(), DSI module is
reset thus values set in DSI_SYSCONFIG is lost because of which
DSI is no longer wakeup capable. This prevents any interrupt from
DSI to be permeated to A9 when A9 sleeping.this reset is not
required while enabling the display thus now it is removed.so it
retains the HWMOD settings.

Now with this fix, the mdelay() within dsi_vc_send_bta_sync(), is removed
and a proper interrupt based implementation is done.

Change-Id: If6c3d25a5ba8003a0bd7732af0fcd81a839293aa
Signed-off-by: Sujeet Kumar Baranwal <s-baranwal@ti.com>