Title: [5287] branches/2008R1/sound/blackfin: bug[4419]correct the order of captured data stream
Revision
5287
Author
cliff
Date
2008-09-12 03:24:14 -0500 (Fri, 12 Sep 2008)

Log Message

bug[4419]correct the order of captured data stream

Modified Paths

Diff

Modified: branches/2008R1/sound/blackfin/ad1836.c (5286 => 5287)


--- branches/2008R1/sound/blackfin/ad1836.c	2008-09-12 08:21:51 UTC (rev 5286)
+++ branches/2008R1/sound/blackfin/ad1836.c	2008-09-12 08:24:14 UTC (rev 5287)
@@ -1397,14 +1397,27 @@
 
 	src += pos * 8;
 
+	/* Copy in order of data stream */
 	while (count--) {
-		unsigned int c;
-		for (c = 0; c < 8; c++) {
-			if (mask & (1 << c)) {
-				*idst++ = *src;
-			}
-			src++;
-		}
+		if (mask & CAP_FL)
+			*idst++ = *src;
+
+		if (mask & CAP_FR)
+			*idst++ = *(src+4);
+
+		if (mask & CAP_FC)
+			*idst++ = *(src+2);
+
+		if (mask & CAP_LFE)
+			*idst++ = *(src+6);
+
+		if (mask & CAP_BL)
+			*idst++ = *(src+1);
+
+		if (mask & CAP_BR)
+			*idst++ = *(src+5);
+
+		src += 8;
 	}
 	return 0;
 }

Modified: branches/2008R1/sound/blackfin/ad1836.h (5286 => 5287)


--- branches/2008R1/sound/blackfin/ad1836.h	2008-09-12 08:21:51 UTC (rev 5286)
+++ branches/2008R1/sound/blackfin/ad1836.h	2008-09-12 08:24:14 UTC (rev 5287)
@@ -163,15 +163,15 @@
 #define SP_5DOT1	(SP_FL | SP_FR | SP_FC | SP_LFE | SP_BL | SP_BR)
 
 /* In channels */
-#define ADC0_LEFT	0x0001
-#define ADC0_RIGHT	0x0010
-#define ADC1_LEFT	0x0002
-#define ADC1_RIGHT	0x0020
-#define SPDIF_IN_LEFT	0x0004
-#define SPDIF_IN_RIGHT	0x0040
+#define CAP_FL		0x0001
+#define CAP_FR		0x0010
+#define CAP_BL		0x0002
+#define CAP_BR		0x0020
+#define CAP_FC		0x0004
+#define CAP_LFE		0x0040
 
-#define CAP_LINE	(ADC0_LEFT | ADC0_RIGHT)
-#define CAP_MIC		(ADC1_LEFT | ADC1_RIGHT)
-#define CAP_SPDIF	(SPDIF_IN_LEFT | SPDIF_IN_RIGHT)
+#define CAP_LINE	(CAP_FL | CAP_FR)
+#define CAP_MIC		(CAP_BL | CAP_BR)
+#define CAP_SPDIF	(CAP_FC | CAP_LFE)
 
 #endif
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to