summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorJack Lee <jacklee@freescale.com>2012-09-05 10:21:49 +0800
committerJack Lee <jacklee@freescale.com>2012-09-05 10:21:49 +0800
commita0619e1d6c1c51a367b8d0bf74bb9058df919545 (patch)
treed40e30c91892ea35c82d22a8364b9b9548e42b7a /sound
parent65745dd4b7f80711d03dce5529fc501162428c53 (diff)
parent85a6685fb327f1eebaeea5dfc04a6750573472ef (diff)
Merge commit 'rel_imx_3.0.35_12.09.02_RC1' into imx_3.0.35_android_r13.5-beta
Conflicts: arch/arm/mach-mx6/board-mx6q_sabresd.c arch/arm/mach-mx6/board-mx6sl_arm2.c arch/arm/mach-mx6/bus_freq.c arch/arm/mach-mx6/cpu_op-mx6.c arch/arm/plat-mxc/cpufreq.c Signed-off-by: Jack Lee <jacklee@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/cs42888.c22
-rw-r--r--sound/soc/codecs/wm8962.c3
-rw-r--r--sound/soc/imx/imx-cs42888.c27
-rw-r--r--sound/soc/imx/imx-esai.c10
-rw-r--r--sound/soc/imx/imx-hdmi-dma.c9
-rw-r--r--sound/soc/imx/imx-pcm-dma-mx2.c1
-rw-r--r--sound/soc/imx/imx-si4763.c2
-rw-r--r--sound/soc/imx/imx-wm8962.c2
8 files changed, 60 insertions, 16 deletions
diff --git a/sound/soc/codecs/cs42888.c b/sound/soc/codecs/cs42888.c
index 73571dafa9a4..ce240834b2e1 100644
--- a/sound/soc/codecs/cs42888.c
+++ b/sound/soc/codecs/cs42888.c
@@ -758,11 +758,33 @@ static void cs42888_shutdown(struct snd_pcm_substream *substream,
}
+static int cs42888_prepare(struct snd_pcm_substream *substream,
+ struct snd_soc_dai *dai)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_card *card = rtd->card;
+ struct snd_soc_dai *tmp_codec_dai;
+ struct snd_soc_pcm_runtime *tmp_rtd;
+ u32 i;
+
+ for (i = 0; i < card->num_rtd; i++) {
+ tmp_codec_dai = card->rtd[i].codec_dai;
+ tmp_rtd = (struct snd_soc_pcm_runtime *)(card->rtd + i);
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
+ tmp_codec_dai->pop_wait) {
+ tmp_codec_dai->pop_wait = 0;
+ cancel_delayed_work(&tmp_rtd->delayed_work);
+ }
+ }
+ return 0;
+}
+
static struct snd_soc_dai_ops cs42888_dai_ops = {
.set_fmt = cs42888_set_dai_fmt,
.set_sysclk = cs42888_set_dai_sysclk,
.hw_params = cs42888_hw_params,
.shutdown = cs42888_shutdown,
+ .prepare = cs42888_prepare,
};
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 8558be580ee3..b14531157067 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -5,6 +5,7 @@
*
* Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
*
+ * Copyright (C) 2012 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -4019,7 +4020,7 @@ static int wm8962_probe(struct snd_soc_codec *codec)
dev_err(codec->dev, "Failed to enable supplies: %d\n", ret);
goto err_get;
}
-
+ msleep(100);
ret = snd_soc_read(codec, WM8962_SOFTWARE_RESET);
if (ret < 0) {
dev_err(codec->dev, "Failed to read ID register\n");
diff --git a/sound/soc/imx/imx-cs42888.c b/sound/soc/imx/imx-cs42888.c
index e06b1a7fc314..acec900618b1 100644
--- a/sound/soc/imx/imx-cs42888.c
+++ b/sound/soc/imx/imx-cs42888.c
@@ -85,8 +85,6 @@ static int config_asrc(struct snd_pcm_substream *substream,
ret = asrc_req_pair(channel, &iprtd->asrc_index);
if (ret < 0) {
pr_err("Fail to request asrc pair\n");
- asrc_release_pair(iprtd->asrc_index);
- asrc_finish_conv(iprtd->asrc_index);
return -EINVAL;
}
@@ -96,14 +94,12 @@ static int config_asrc(struct snd_pcm_substream *substream,
config.channel_num = channel;
config.input_sample_rate = rate;
config.output_sample_rate = iprtd->p2p->p2p_rate;
- config.inclk = INCLK_ASRCK1_CLK;
+ config.inclk = INCLK_NONE;
config.outclk = OUTCLK_ESAI_TX;
ret = asrc_config_pair(&config);
if (ret < 0) {
pr_err("Fail to config asrc\n");
- asrc_release_pair(iprtd->asrc_index);
- asrc_finish_conv(iprtd->asrc_index);
return ret;
}
@@ -135,6 +131,13 @@ static void imx_3stack_shutdown(struct snd_pcm_substream *substream)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
+
+ if (!cpu_dai->active)
+ hw_state.hw = 0;
+}
+
+static int imx_3stack_surround_hw_free(struct snd_pcm_substream *substream)
+{
struct imx_pcm_runtime_data *iprtd = substream->runtime->private_data;
if (iprtd->asrc_enable) {
@@ -145,10 +148,8 @@ static void imx_3stack_shutdown(struct snd_pcm_substream *substream)
iprtd->asrc_index = -1;
}
- if (!cpu_dai->active)
- hw_state.hw = 0;
+ return 0;
}
-
static int imx_3stack_surround_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
@@ -161,16 +162,17 @@ static int imx_3stack_surround_hw_params(struct snd_pcm_substream *substream,
unsigned int lrclk_ratio = 0;
int err = 0;
- if (hw_state.hw)
- return 0;
- hw_state.hw = 1;
-
if (iprtd->asrc_enable) {
err = config_asrc(substream, params);
if (err < 0)
return err;
rate = iprtd->p2p->p2p_rate;
}
+
+ if (hw_state.hw)
+ return 0;
+ hw_state.hw = 1;
+
if (cpu_is_mx53() || machine_is_mx6q_sabreauto()) {
switch (rate) {
case 32000:
@@ -280,6 +282,7 @@ static struct snd_soc_ops imx_3stack_surround_ops = {
.startup = imx_3stack_startup,
.shutdown = imx_3stack_shutdown,
.hw_params = imx_3stack_surround_hw_params,
+ .hw_free = imx_3stack_surround_hw_free,
};
static const struct snd_soc_dapm_widget imx_3stack_dapm_widgets[] = {
diff --git a/sound/soc/imx/imx-esai.c b/sound/soc/imx/imx-esai.c
index b3cba9ea53c4..359cb2a4aea0 100644
--- a/sound/soc/imx/imx-esai.c
+++ b/sound/soc/imx/imx-esai.c
@@ -278,6 +278,12 @@ static int imx_esai_startup(struct snd_pcm_substream *substream,
{
struct imx_esai *esai = snd_soc_dai_get_drvdata(cpu_dai);
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
+ (local_esai->imx_esai_txrx_state & IMX_DAI_ESAI_TX)) {
+ pr_err("error: too much esai playback!\n");
+ return -EINVAL;
+ }
+
if (!(local_esai->imx_esai_txrx_state & IMX_DAI_ESAI_TXRX)) {
clk_enable(esai->clk);
@@ -468,6 +474,7 @@ static int imx_esai_trigger(struct snd_pcm_substream *substream, int cmd,
{
struct imx_esai *esai = snd_soc_dai_get_drvdata(cpu_dai);
u32 reg, tfcr = 0, rfcr = 0;
+ int i;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
tfcr = readl(esai->base + ESAI_TFCR);
@@ -483,6 +490,9 @@ static int imx_esai_trigger(struct snd_pcm_substream *substream, int cmd,
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
tfcr |= ESAI_TFCR_TFEN;
writel(tfcr, esai->base + ESAI_TFCR);
+ /* write initial words to ETDR register */
+ for (i = 0; i < substream->runtime->channels; i++)
+ writel(0x0, esai->base + ESAI_ETDR);
reg |= ESAI_TCR_TE(substream->runtime->channels);
writel(reg, esai->base + ESAI_TCR);
} else {
diff --git a/sound/soc/imx/imx-hdmi-dma.c b/sound/soc/imx/imx-hdmi-dma.c
index 18e3a016cca8..70c8cb13d3de 100644
--- a/sound/soc/imx/imx-hdmi-dma.c
+++ b/sound/soc/imx/imx-hdmi-dma.c
@@ -1195,6 +1195,12 @@ static int hdmi_dma_open(struct snd_pcm_substream *substream)
(int)clk_get_rate(hdmi_dma_priv->isfr_clk),
(int)clk_get_rate(hdmi_dma_priv->iahb_clk));
+ ret = mxc_hdmi_register_audio(substream);
+ if (ret < 0) {
+ pr_err("ERROR: HDMI is not ready!\n");
+ return ret;
+ }
+
hdmi_fifo_reset();
ret = snd_pcm_hw_constraint_integer(substream->runtime,
@@ -1215,6 +1221,7 @@ static int hdmi_dma_close(struct snd_pcm_substream *substream)
struct imx_hdmi_dma_runtime_data *rtd = runtime->private_data;
hdmi_dma_irq_disable(rtd);
+ mxc_hdmi_unregister_audio(substream);
clk_disable(rtd->iahb_clk);
clk_disable(rtd->isfr_clk);
@@ -1337,7 +1344,7 @@ static int __devinit imx_soc_platform_probe(struct platform_device *pdev)
if (hdmi_SDMA_check()) {
/*To alloc a buffer non cacheable for hdmi script use*/
hdmi_dma_priv->hdmi_sdma_t =
- dma_alloc_coherent(NULL,
+ dma_alloc_noncacheable(NULL,
sizeof(struct hdmi_sdma_script_data),
&hdmi_dma_priv->phy_hdmi_sdma_t,
GFP_KERNEL);
diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c
index b36b28108049..ad8d5a3329c7 100644
--- a/sound/soc/imx/imx-pcm-dma-mx2.c
+++ b/sound/soc/imx/imx-pcm-dma-mx2.c
@@ -359,6 +359,7 @@ static int snd_imx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
dmaengine_submit(iprtd->asrc_p2p_desc);
dmaengine_submit(iprtd->asrc_desc);
asrc_start_conv(iprtd->asrc_index);
+ mdelay(1);
} else {
dmaengine_submit(iprtd->desc);
}
diff --git a/sound/soc/imx/imx-si4763.c b/sound/soc/imx/imx-si4763.c
index 3bf7f0340ea9..1dd50e769235 100644
--- a/sound/soc/imx/imx-si4763.c
+++ b/sound/soc/imx/imx-si4763.c
@@ -94,7 +94,7 @@ static int imx_3stack_si4763_hw_params(struct snd_pcm_substream *substream,
/* set the SSI system clock as input (unused) */
snd_soc_dai_set_sysclk(cpu_dai, IMX_SSP_SYS_CLK, 0, SND_SOC_CLOCK_IN);
- snd_soc_dai_set_clkdiv(cpu_dai, IMX_SSI_TX_DIV_PM, 9);
+ snd_soc_dai_set_clkdiv(cpu_dai, IMX_SSI_TX_DIV_PM, 4);
snd_soc_dai_set_clkdiv(cpu_dai, IMX_SSI_TX_DIV_2, 1);
snd_soc_dai_set_clkdiv(cpu_dai, IMX_SSI_TX_DIV_PSR, 0);
return 0;
diff --git a/sound/soc/imx/imx-wm8962.c b/sound/soc/imx/imx-wm8962.c
index de0dcd60a594..8da589f2fa69 100644
--- a/sound/soc/imx/imx-wm8962.c
+++ b/sound/soc/imx/imx-wm8962.c
@@ -474,7 +474,7 @@ static int __init imx_asoc_init(void)
if (machine_is_mx6q_sabresd())
imx_dai[0].codec_name = "wm8962.0-001a";
- else if (machine_is_mx6sl_arm2())
+ else if (machine_is_mx6sl_arm2() | machine_is_mx6sl_evk())
imx_dai[0].codec_name = "wm8962.1-001a";
imx_snd_device = platform_device_alloc("soc-audio", 5);