提交 75b46c13 编写于 作者: J Jon Smirl 提交者: Mark Brown

ASoC: Fix disable of SPDIF on STAC9766 codec

Change code so that switching to playing music through the analog output
disables SPDIF out instead of disabling it when stream ends.
Signed-off-by: NJon Smirl <jonsmirl@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 1cf86f6f
......@@ -191,6 +191,7 @@ static int ac97_analog_prepare(struct snd_pcm_substream *substream,
vra = stac9766_ac97_read(codec, AC97_EXTENDED_STATUS);
vra |= 0x1; /* enable variable rate audio */
vra &= ~0x4; /* disable SPDIF output */
stac9766_ac97_write(codec, AC97_EXTENDED_STATUS, vra);
......@@ -221,22 +222,6 @@ static int ac97_digital_prepare(struct snd_pcm_substream *substream,
return stac9766_ac97_write(codec, reg, runtime->rate);
}
static int ac97_digital_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai)
{
struct snd_soc_codec *codec = dai->codec;
unsigned short vra;
switch (cmd) {
case SNDRV_PCM_TRIGGER_STOP:
vra = stac9766_ac97_read(codec, AC97_EXTENDED_STATUS);
vra &= !0x04;
stac9766_ac97_write(codec, AC97_EXTENDED_STATUS, vra);
break;
}
return 0;
}
static int stac9766_set_bias_level(struct snd_soc_codec *codec,
enum snd_soc_bias_level level)
{
......@@ -315,7 +300,6 @@ static struct snd_soc_dai_ops stac9766_dai_ops_analog = {
static struct snd_soc_dai_ops stac9766_dai_ops_digital = {
.prepare = ac97_digital_prepare,
.trigger = ac97_digital_trigger,
};
struct snd_soc_dai stac9766_dai[] = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册