Title: [6484] trunk/sound/soc/codecs/ssm2602.c: bug[#2424]set constraints only if the values in master runtime are not 0;when shutdown,assign the last substream to master substream
Revision
6484
Author
cliff
Date
2009-05-27 03:42:06 -0500 (Wed, 27 May 2009)

Log Message

bug[#2424]set constraints only if the values in master runtime are not 0;when shutdown,assign the last substream to master substream

Modified Paths

Diff

Modified: trunk/sound/soc/codecs/ssm2602.c (6483 => 6484)


--- trunk/sound/soc/codecs/ssm2602.c	2009-05-27 08:20:44 UTC (rev 6483)
+++ trunk/sound/soc/codecs/ssm2602.c	2009-05-27 08:42:06 UTC (rev 6484)
@@ -337,16 +337,17 @@
 	 */
 	if (ssm2602->master_substream) {
 		master_runtime = ssm2602->master_substream->runtime;
-		snd_pcm_hw_constraint_minmax(substream->runtime,
-					     SNDRV_PCM_HW_PARAM_RATE,
-					     master_runtime->rate,
-					     master_runtime->rate);
+		if (master_runtime->rate != 0)
+			snd_pcm_hw_constraint_minmax(substream->runtime,
+						     SNDRV_PCM_HW_PARAM_RATE,
+						     master_runtime->rate,
+						     master_runtime->rate);
+		if (master_runtime->sample_bits != 0)
+			snd_pcm_hw_constraint_minmax(substream->runtime,
+						     SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
+						     master_runtime->sample_bits,
+						     master_runtime->sample_bits);
 
-		snd_pcm_hw_constraint_minmax(substream->runtime,
-					     SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
-					     master_runtime->sample_bits,
-					     master_runtime->sample_bits);
-
 		ssm2602->slave_substream = substream;
 	} else
 		ssm2602->master_substream = substream;
@@ -370,6 +371,12 @@
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_device *socdev = rtd->socdev;
 	struct snd_soc_codec *codec = socdev->codec;
+	struct ssm2602_priv *ssm2602 = codec->private_data;
+
+	if (ssm2602->master_substream == substream)
+		ssm2602->master_substream = ssm2602->slave_substream;
+
+	ssm2602->slave_substream = NULL;
 	/* deactivate */
 	if (!codec->active)
 		ssm2602_write(codec, SSM2602_ACTIVE, 0);
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to