Commit 96b7fe01 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'asoc/fix/adsp', 'asoc/fix/arizona',...

Merge remote-tracking branches 'asoc/fix/adsp', 'asoc/fix/arizona', 'asoc/fix/atmel', 'asoc/fix/fsl', 'asoc/fix/kirkwood', 'asoc/fix/tegra', 'asoc/fix/wm8904' and 'asoc/fix/wm8962' into asoc-linus
...@@ -648,7 +648,7 @@ static int atmel_ssc_prepare(struct snd_pcm_substream *substream, ...@@ -648,7 +648,7 @@ static int atmel_ssc_prepare(struct snd_pcm_substream *substream,
dma_params = ssc_p->dma_params[dir]; dma_params = ssc_p->dma_params[dir];
ssc_writel(ssc_p->ssc->regs, CR, dma_params->mask->ssc_enable); ssc_writel(ssc_p->ssc->regs, CR, dma_params->mask->ssc_disable);
ssc_writel(ssc_p->ssc->regs, IDR, dma_params->mask->ssc_error); ssc_writel(ssc_p->ssc->regs, IDR, dma_params->mask->ssc_error);
pr_debug("%s enabled SSC_SR=0x%08x\n", pr_debug("%s enabled SSC_SR=0x%08x\n",
...@@ -657,6 +657,33 @@ static int atmel_ssc_prepare(struct snd_pcm_substream *substream, ...@@ -657,6 +657,33 @@ static int atmel_ssc_prepare(struct snd_pcm_substream *substream,
return 0; return 0;
} }
static int atmel_ssc_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai)
{
struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
struct atmel_pcm_dma_params *dma_params;
int dir;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
dir = 0;
else
dir = 1;
dma_params = ssc_p->dma_params[dir];
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
ssc_writel(ssc_p->ssc->regs, CR, dma_params->mask->ssc_enable);
break;
default:
ssc_writel(ssc_p->ssc->regs, CR, dma_params->mask->ssc_disable);
break;
}
return 0;
}
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int atmel_ssc_suspend(struct snd_soc_dai *cpu_dai) static int atmel_ssc_suspend(struct snd_soc_dai *cpu_dai)
...@@ -731,6 +758,7 @@ static const struct snd_soc_dai_ops atmel_ssc_dai_ops = { ...@@ -731,6 +758,7 @@ static const struct snd_soc_dai_ops atmel_ssc_dai_ops = {
.startup = atmel_ssc_startup, .startup = atmel_ssc_startup,
.shutdown = atmel_ssc_shutdown, .shutdown = atmel_ssc_shutdown,
.prepare = atmel_ssc_prepare, .prepare = atmel_ssc_prepare,
.trigger = atmel_ssc_trigger,
.hw_params = atmel_ssc_hw_params, .hw_params = atmel_ssc_hw_params,
.set_fmt = atmel_ssc_set_dai_fmt, .set_fmt = atmel_ssc_set_dai_fmt,
.set_clkdiv = atmel_ssc_set_dai_clkdiv, .set_clkdiv = atmel_ssc_set_dai_clkdiv,
......
...@@ -109,7 +109,7 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev) ...@@ -109,7 +109,7 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev)
dai->stream_name = "WM8731 PCM"; dai->stream_name = "WM8731 PCM";
dai->codec_dai_name = "wm8731-hifi"; dai->codec_dai_name = "wm8731-hifi";
dai->init = sam9x5_wm8731_init; dai->init = sam9x5_wm8731_init;
dai->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF dai->dai_fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_NB_NF
| SND_SOC_DAIFMT_CBM_CFM; | SND_SOC_DAIFMT_CBM_CFM;
ret = snd_soc_of_parse_card_name(card, "atmel,model"); ret = snd_soc_of_parse_card_name(card, "atmel,model");
......
...@@ -1012,7 +1012,7 @@ static const struct snd_soc_dapm_route wm5110_dapm_routes[] = { ...@@ -1012,7 +1012,7 @@ static const struct snd_soc_dapm_route wm5110_dapm_routes[] = {
{ "AEC Loopback", "HPOUT3L", "OUT3L" }, { "AEC Loopback", "HPOUT3L", "OUT3L" },
{ "AEC Loopback", "HPOUT3R", "OUT3R" }, { "AEC Loopback", "HPOUT3R", "OUT3R" },
{ "HPOUT3L", NULL, "OUT3L" }, { "HPOUT3L", NULL, "OUT3L" },
{ "HPOUT3R", NULL, "OUT3L" }, { "HPOUT3R", NULL, "OUT3R" },
{ "AEC Loopback", "SPKOUTL", "OUT4L" }, { "AEC Loopback", "SPKOUTL", "OUT4L" },
{ "SPKOUTLN", NULL, "OUT4L" }, { "SPKOUTLN", NULL, "OUT4L" },
......
...@@ -1444,7 +1444,7 @@ static int wm8904_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) ...@@ -1444,7 +1444,7 @@ static int wm8904_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_DSP_B: case SND_SOC_DAIFMT_DSP_B:
aif1 |= WM8904_AIF_LRCLK_INV; aif1 |= 0x3 | WM8904_AIF_LRCLK_INV;
case SND_SOC_DAIFMT_DSP_A: case SND_SOC_DAIFMT_DSP_A:
aif1 |= 0x3; aif1 |= 0x3;
break; break;
......
...@@ -2439,7 +2439,20 @@ static void wm8962_configure_bclk(struct snd_soc_codec *codec) ...@@ -2439,7 +2439,20 @@ static void wm8962_configure_bclk(struct snd_soc_codec *codec)
snd_soc_update_bits(codec, WM8962_CLOCKING_4, snd_soc_update_bits(codec, WM8962_CLOCKING_4,
WM8962_SYSCLK_RATE_MASK, clocking4); WM8962_SYSCLK_RATE_MASK, clocking4);
/* DSPCLK_DIV can be only generated correctly after enabling SYSCLK.
* So we here provisionally enable it and then disable it afterward
* if current bias_level hasn't reached SND_SOC_BIAS_ON.
*/
if (codec->dapm.bias_level != SND_SOC_BIAS_ON)
snd_soc_update_bits(codec, WM8962_CLOCKING2,
WM8962_SYSCLK_ENA_MASK, WM8962_SYSCLK_ENA);
dspclk = snd_soc_read(codec, WM8962_CLOCKING1); dspclk = snd_soc_read(codec, WM8962_CLOCKING1);
if (codec->dapm.bias_level != SND_SOC_BIAS_ON)
snd_soc_update_bits(codec, WM8962_CLOCKING2,
WM8962_SYSCLK_ENA_MASK, 0);
if (dspclk < 0) { if (dspclk < 0) {
dev_err(codec->dev, "Failed to read DSPCLK: %d\n", dspclk); dev_err(codec->dev, "Failed to read DSPCLK: %d\n", dspclk);
return; return;
......
...@@ -1474,13 +1474,17 @@ static int wm_adsp2_ena(struct wm_adsp *dsp) ...@@ -1474,13 +1474,17 @@ static int wm_adsp2_ena(struct wm_adsp *dsp)
return ret; return ret;
/* Wait for the RAM to start, should be near instantaneous */ /* Wait for the RAM to start, should be near instantaneous */
count = 0; for (count = 0; count < 10; ++count) {
do {
ret = regmap_read(dsp->regmap, dsp->base + ADSP2_STATUS1, ret = regmap_read(dsp->regmap, dsp->base + ADSP2_STATUS1,
&val); &val);
if (ret != 0) if (ret != 0)
return ret; return ret;
} while (!(val & ADSP2_RAM_RDY) && ++count < 10);
if (val & ADSP2_RAM_RDY)
break;
msleep(1);
}
if (!(val & ADSP2_RAM_RDY)) { if (!(val & ADSP2_RAM_RDY)) {
adsp_err(dsp, "Failed to start DSP RAM\n"); adsp_err(dsp, "Failed to start DSP RAM\n");
......
...@@ -130,8 +130,6 @@ static int imx_wm8962_set_bias_level(struct snd_soc_card *card, ...@@ -130,8 +130,6 @@ static int imx_wm8962_set_bias_level(struct snd_soc_card *card,
break; break;
} }
dapm->bias_level = level;
return 0; return 0;
} }
......
...@@ -473,17 +473,17 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai_extclk[2] = { ...@@ -473,17 +473,17 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai_extclk[2] = {
.playback = { .playback = {
.channels_min = 1, .channels_min = 1,
.channels_max = 2, .channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_192000 | .rates = SNDRV_PCM_RATE_CONTINUOUS,
SNDRV_PCM_RATE_CONTINUOUS | .rate_min = 5512,
SNDRV_PCM_RATE_KNOT, .rate_max = 192000,
.formats = KIRKWOOD_I2S_FORMATS, .formats = KIRKWOOD_I2S_FORMATS,
}, },
.capture = { .capture = {
.channels_min = 1, .channels_min = 1,
.channels_max = 2, .channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_192000 | .rates = SNDRV_PCM_RATE_CONTINUOUS,
SNDRV_PCM_RATE_CONTINUOUS | .rate_min = 5512,
SNDRV_PCM_RATE_KNOT, .rate_max = 192000,
.formats = KIRKWOOD_I2S_FORMATS, .formats = KIRKWOOD_I2S_FORMATS,
}, },
.ops = &kirkwood_i2s_dai_ops, .ops = &kirkwood_i2s_dai_ops,
...@@ -494,17 +494,17 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai_extclk[2] = { ...@@ -494,17 +494,17 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai_extclk[2] = {
.playback = { .playback = {
.channels_min = 1, .channels_min = 1,
.channels_max = 2, .channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_192000 | .rates = SNDRV_PCM_RATE_CONTINUOUS,
SNDRV_PCM_RATE_CONTINUOUS | .rate_min = 5512,
SNDRV_PCM_RATE_KNOT, .rate_max = 192000,
.formats = KIRKWOOD_SPDIF_FORMATS, .formats = KIRKWOOD_SPDIF_FORMATS,
}, },
.capture = { .capture = {
.channels_min = 1, .channels_min = 1,
.channels_max = 2, .channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_192000 | .rates = SNDRV_PCM_RATE_CONTINUOUS,
SNDRV_PCM_RATE_CONTINUOUS | .rate_min = 5512,
SNDRV_PCM_RATE_KNOT, .rate_max = 192000,
.formats = KIRKWOOD_SPDIF_FORMATS, .formats = KIRKWOOD_SPDIF_FORMATS,
}, },
.ops = &kirkwood_i2s_dai_ops, .ops = &kirkwood_i2s_dai_ops,
......
...@@ -74,7 +74,7 @@ static int tegra20_i2s_set_fmt(struct snd_soc_dai *dai, ...@@ -74,7 +74,7 @@ static int tegra20_i2s_set_fmt(struct snd_soc_dai *dai,
unsigned int fmt) unsigned int fmt)
{ {
struct tegra20_i2s *i2s = snd_soc_dai_get_drvdata(dai); struct tegra20_i2s *i2s = snd_soc_dai_get_drvdata(dai);
unsigned int mask, val; unsigned int mask = 0, val = 0;
switch (fmt & SND_SOC_DAIFMT_INV_MASK) { switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
case SND_SOC_DAIFMT_NB_NF: case SND_SOC_DAIFMT_NB_NF:
...@@ -83,10 +83,10 @@ static int tegra20_i2s_set_fmt(struct snd_soc_dai *dai, ...@@ -83,10 +83,10 @@ static int tegra20_i2s_set_fmt(struct snd_soc_dai *dai,
return -EINVAL; return -EINVAL;
} }
mask = TEGRA20_I2S_CTRL_MASTER_ENABLE; mask |= TEGRA20_I2S_CTRL_MASTER_ENABLE;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBS_CFS:
val = TEGRA20_I2S_CTRL_MASTER_ENABLE; val |= TEGRA20_I2S_CTRL_MASTER_ENABLE;
break; break;
case SND_SOC_DAIFMT_CBM_CFM: case SND_SOC_DAIFMT_CBM_CFM:
break; break;
......
...@@ -67,15 +67,15 @@ static int tegra20_spdif_hw_params(struct snd_pcm_substream *substream, ...@@ -67,15 +67,15 @@ static int tegra20_spdif_hw_params(struct snd_pcm_substream *substream,
{ {
struct device *dev = dai->dev; struct device *dev = dai->dev;
struct tegra20_spdif *spdif = snd_soc_dai_get_drvdata(dai); struct tegra20_spdif *spdif = snd_soc_dai_get_drvdata(dai);
unsigned int mask, val; unsigned int mask = 0, val = 0;
int ret, spdifclock; int ret, spdifclock;
mask = TEGRA20_SPDIF_CTRL_PACK | mask |= TEGRA20_SPDIF_CTRL_PACK |
TEGRA20_SPDIF_CTRL_BIT_MODE_MASK; TEGRA20_SPDIF_CTRL_BIT_MODE_MASK;
switch (params_format(params)) { switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE: case SNDRV_PCM_FORMAT_S16_LE:
val = TEGRA20_SPDIF_CTRL_PACK | val |= TEGRA20_SPDIF_CTRL_PACK |
TEGRA20_SPDIF_CTRL_BIT_MODE_16BIT; TEGRA20_SPDIF_CTRL_BIT_MODE_16BIT;
break; break;
default: default:
return -EINVAL; return -EINVAL;
......
...@@ -118,7 +118,7 @@ static int tegra30_i2s_set_fmt(struct snd_soc_dai *dai, ...@@ -118,7 +118,7 @@ static int tegra30_i2s_set_fmt(struct snd_soc_dai *dai,
unsigned int fmt) unsigned int fmt)
{ {
struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai); struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai);
unsigned int mask, val; unsigned int mask = 0, val = 0;
switch (fmt & SND_SOC_DAIFMT_INV_MASK) { switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
case SND_SOC_DAIFMT_NB_NF: case SND_SOC_DAIFMT_NB_NF:
...@@ -127,10 +127,10 @@ static int tegra30_i2s_set_fmt(struct snd_soc_dai *dai, ...@@ -127,10 +127,10 @@ static int tegra30_i2s_set_fmt(struct snd_soc_dai *dai,
return -EINVAL; return -EINVAL;
} }
mask = TEGRA30_I2S_CTRL_MASTER_ENABLE; mask |= TEGRA30_I2S_CTRL_MASTER_ENABLE;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBS_CFS:
val = TEGRA30_I2S_CTRL_MASTER_ENABLE; val |= TEGRA30_I2S_CTRL_MASTER_ENABLE;
break; break;
case SND_SOC_DAIFMT_CBM_CFM: case SND_SOC_DAIFMT_CBM_CFM:
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment