public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix disable of SPDIF on STAC9766 codec
@ 2009-12-16  1:53 Jon Smirl
  2009-12-16 15:57 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Smirl @ 2009-12-16  1:53 UTC (permalink / raw)
  To: joe, alsa-devel, broonie, clemens, linux-kernel

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: Jon Smirl <jonsmirl@gmail.com>
---
 sound/soc/codecs/stac9766.c |   18 +-----------------
 1 files changed, 1 insertions(+), 17 deletions(-)

diff --git a/sound/soc/codecs/stac9766.c b/sound/soc/codecs/stac9766.c
index bbc72c2..81b8c9d 100644
--- a/sound/soc/codecs/stac9766.c
+++ b/sound/soc/codecs/stac9766.c
@@ -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[] = {


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix disable of SPDIF on STAC9766 codec
  2009-12-16  1:53 [PATCH] Fix disable of SPDIF on STAC9766 codec Jon Smirl
@ 2009-12-16 15:57 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2009-12-16 15:57 UTC (permalink / raw)
  To: Jon Smirl; +Cc: joe, alsa-devel, clemens, linux-kernel

On Tue, Dec 15, 2009 at 08:53:44PM -0500, Jon Smirl wrote:
> 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: Jon Smirl <jonsmirl@gmail.com>

Applied, thanks, with word-wrapping and whatnot in the commit message.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-12-16 15:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-16  1:53 [PATCH] Fix disable of SPDIF on STAC9766 codec Jon Smirl
2009-12-16 15:57 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox