Title: [5268] branches/2008R1/sound/blackfin/ad1836.c: bug[4393]periods should be integer
Revision
5268
Author
cliff
Date
2008-09-09 04:33:49 -0500 (Tue, 09 Sep 2008)

Log Message

bug[4393]periods should be integer

Modified Paths

Diff

Modified: branches/2008R1/sound/blackfin/ad1836.c (5267 => 5268)


--- branches/2008R1/sound/blackfin/ad1836.c	2008-09-09 09:29:44 UTC (rev 5267)
+++ branches/2008R1/sound/blackfin/ad1836.c	2008-09-09 09:33:49 UTC (rev 5268)
@@ -864,7 +864,7 @@
 	.channels_max =     CHANNELS_MAX,
 #endif
 	.buffer_bytes_max = PCM_BUFFER_MAX,
-	.period_bytes_min = 2 * FRAGMENT_SIZE_MIN,
+	.period_bytes_min = 32,
 	.period_bytes_max = PCM_BUFFER_MAX/2,
 	.periods_min =      8,
 	.periods_max =      FRAGMENTS_MAX,
@@ -888,7 +888,7 @@
 	.channels_max =     CHANNELS_MAX,
 #endif
 	.buffer_bytes_max = PCM_BUFFER_MAX,
-	.period_bytes_min = 2 * FRAGMENT_SIZE_MIN,
+	.period_bytes_min = 32,
 	.period_bytes_max = PCM_BUFFER_MAX/2,
 	.periods_min =      8,
 	.periods_max =      FRAGMENTS_MAX,
@@ -896,6 +896,7 @@
 
 static int snd_ad1836_playback_open(struct snd_pcm_substream *substream)
 {
+	int ret;
 	ad1836_t *chip = snd_pcm_substream_chip(substream);
 
 	snd_printk_marker();
@@ -913,16 +914,24 @@
 	chip->tx_substream = substream;
 #endif
 	substream->runtime->hw = snd_ad1836_playback_hw;
-
+	ret = snd_pcm_hw_constraint_integer(substream->runtime, \
+			SNDRV_PCM_HW_PARAM_PERIODS);
+	if (ret < 0)
+		return -EINVAL;
 	return 0;
 }
 
 static int snd_ad1836_capture_open(struct snd_pcm_substream *substream)
 {
+	int ret;
 	ad1836_t *chip = snd_pcm_substream_chip(substream);
 
 	snd_printk_marker();
 	substream->runtime->hw = snd_ad1836_capture_hw;
+	ret = snd_pcm_hw_constraint_integer(substream->runtime, \
+			SNDRV_PCM_HW_PARAM_PERIODS);
+	if (ret < 0)
+		return -EINVAL;
 	chip->rx_substream = substream;
 
 	return 0;
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to