mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
Merge remote-tracking branches 'asoc/fix/atmel', 'asoc/fix/fsl', 'asoc/fix/tegra' and 'asoc/fix/wm8962' into asoc-linus
This commit is contained in:
commit
e20ab019e2
@ -648,7 +648,7 @@ static int atmel_ssc_prepare(struct snd_pcm_substream *substream,
|
||||
|
||||
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);
|
||||
|
||||
pr_debug("%s enabled SSC_SR=0x%08x\n",
|
||||
@ -657,6 +657,33 @@ static int atmel_ssc_prepare(struct snd_pcm_substream *substream,
|
||||
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
|
||||
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 = {
|
||||
.startup = atmel_ssc_startup,
|
||||
.shutdown = atmel_ssc_shutdown,
|
||||
.prepare = atmel_ssc_prepare,
|
||||
.trigger = atmel_ssc_trigger,
|
||||
.hw_params = atmel_ssc_hw_params,
|
||||
.set_fmt = atmel_ssc_set_dai_fmt,
|
||||
.set_clkdiv = atmel_ssc_set_dai_clkdiv,
|
||||
|
@ -109,7 +109,7 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev)
|
||||
dai->stream_name = "WM8731 PCM";
|
||||
dai->codec_dai_name = "wm8731-hifi";
|
||||
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;
|
||||
|
||||
ret = snd_soc_of_parse_card_name(card, "atmel,model");
|
||||
|
@ -2439,7 +2439,20 @@ static void wm8962_configure_bclk(struct snd_soc_codec *codec)
|
||||
snd_soc_update_bits(codec, WM8962_CLOCKING_4,
|
||||
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);
|
||||
|
||||
if (codec->dapm.bias_level != SND_SOC_BIAS_ON)
|
||||
snd_soc_update_bits(codec, WM8962_CLOCKING2,
|
||||
WM8962_SYSCLK_ENA_MASK, 0);
|
||||
|
||||
if (dspclk < 0) {
|
||||
dev_err(codec->dev, "Failed to read DSPCLK: %d\n", dspclk);
|
||||
return;
|
||||
|
@ -130,8 +130,6 @@ static int imx_wm8962_set_bias_level(struct snd_soc_card *card,
|
||||
break;
|
||||
}
|
||||
|
||||
dapm->bias_level = level;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ static int tegra20_i2s_set_fmt(struct snd_soc_dai *dai,
|
||||
unsigned int fmt)
|
||||
{
|
||||
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) {
|
||||
case SND_SOC_DAIFMT_NB_NF:
|
||||
@ -83,10 +83,10 @@ static int tegra20_i2s_set_fmt(struct snd_soc_dai *dai,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
mask = TEGRA20_I2S_CTRL_MASTER_ENABLE;
|
||||
mask |= TEGRA20_I2S_CTRL_MASTER_ENABLE;
|
||||
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
|
||||
case SND_SOC_DAIFMT_CBS_CFS:
|
||||
val = TEGRA20_I2S_CTRL_MASTER_ENABLE;
|
||||
val |= TEGRA20_I2S_CTRL_MASTER_ENABLE;
|
||||
break;
|
||||
case SND_SOC_DAIFMT_CBM_CFM:
|
||||
break;
|
||||
|
@ -67,15 +67,15 @@ static int tegra20_spdif_hw_params(struct snd_pcm_substream *substream,
|
||||
{
|
||||
struct device *dev = dai->dev;
|
||||
struct tegra20_spdif *spdif = snd_soc_dai_get_drvdata(dai);
|
||||
unsigned int mask, val;
|
||||
unsigned int mask = 0, val = 0;
|
||||
int ret, spdifclock;
|
||||
|
||||
mask = TEGRA20_SPDIF_CTRL_PACK |
|
||||
TEGRA20_SPDIF_CTRL_BIT_MODE_MASK;
|
||||
mask |= TEGRA20_SPDIF_CTRL_PACK |
|
||||
TEGRA20_SPDIF_CTRL_BIT_MODE_MASK;
|
||||
switch (params_format(params)) {
|
||||
case SNDRV_PCM_FORMAT_S16_LE:
|
||||
val = TEGRA20_SPDIF_CTRL_PACK |
|
||||
TEGRA20_SPDIF_CTRL_BIT_MODE_16BIT;
|
||||
val |= TEGRA20_SPDIF_CTRL_PACK |
|
||||
TEGRA20_SPDIF_CTRL_BIT_MODE_16BIT;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
@ -118,7 +118,7 @@ static int tegra30_i2s_set_fmt(struct snd_soc_dai *dai,
|
||||
unsigned int fmt)
|
||||
{
|
||||
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) {
|
||||
case SND_SOC_DAIFMT_NB_NF:
|
||||
@ -127,10 +127,10 @@ static int tegra30_i2s_set_fmt(struct snd_soc_dai *dai,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
mask = TEGRA30_I2S_CTRL_MASTER_ENABLE;
|
||||
mask |= TEGRA30_I2S_CTRL_MASTER_ENABLE;
|
||||
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
|
||||
case SND_SOC_DAIFMT_CBS_CFS:
|
||||
val = TEGRA30_I2S_CTRL_MASTER_ENABLE;
|
||||
val |= TEGRA30_I2S_CTRL_MASTER_ENABLE;
|
||||
break;
|
||||
case SND_SOC_DAIFMT_CBM_CFM:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user