aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Knoth <adi@drcomp.erfurt.thur.de>2011-01-27 05:23:15 -0500
committerTakashi Iwai <tiwai@suse.de>2011-01-27 06:09:23 -0500
commit55a57606b26665870f2993dc53a43daad157dbcd (patch)
tree92d86fdd7f1ad9f9adec97347fef1b10925d7b68
parentfbcdf3343bc8a1272092cf6d164516b76505708b (diff)
ALSA: [hdspm] Move static mapping arrays to .c
As requested by Takashi and Jaroslav, these arrays should not be in the header file. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--include/sound/hdspm.h170
-rw-r--r--sound/pci/rme9652/hdspm.c171
2 files changed, 171 insertions, 170 deletions
diff --git a/include/sound/hdspm.h b/include/sound/hdspm.h
index c3f18194b08e..1774ff5ff632 100644
--- a/include/sound/hdspm.h
+++ b/include/sound/hdspm.h
@@ -225,175 +225,5 @@ typedef struct hdspm_version hdspm_version_t;
225typedef struct hdspm_channelfader snd_hdspm_channelfader_t; 225typedef struct hdspm_channelfader snd_hdspm_channelfader_t;
226typedef struct hdspm_mixer hdspm_mixer_t; 226typedef struct hdspm_mixer hdspm_mixer_t;
227 227
228/* These tables map the ALSA channels 1..N to the channels that we
229 need to use in order to find the relevant channel buffer. RME
230 refers to this kind of mapping as between "the ADAT channel and
231 the DMA channel." We index it using the logical audio channel,
232 and the value is the DMA channel (i.e. channel buffer number)
233 where the data for that channel can be read/written from/to.
234*/
235
236char channel_map_unity_ss[HDSPM_MAX_CHANNELS] = {
237 0, 1, 2, 3, 4, 5, 6, 7,
238 8, 9, 10, 11, 12, 13, 14, 15,
239 16, 17, 18, 19, 20, 21, 22, 23,
240 24, 25, 26, 27, 28, 29, 30, 31,
241 32, 33, 34, 35, 36, 37, 38, 39,
242 40, 41, 42, 43, 44, 45, 46, 47,
243 48, 49, 50, 51, 52, 53, 54, 55,
244 56, 57, 58, 59, 60, 61, 62, 63
245};
246
247char channel_map_unity_ds[HDSPM_MAX_CHANNELS] = {
248 0, 2, 4, 6, 8, 10, 12, 14,
249 16, 18, 20, 22, 24, 26, 28, 30,
250 32, 34, 36, 38, 40, 42, 44, 46,
251 48, 50, 52, 54, 56, 58, 60, 62,
252 -1, -1, -1, -1, -1, -1, -1, -1,
253 -1, -1, -1, -1, -1, -1, -1, -1,
254 -1, -1, -1, -1, -1, -1, -1, -1,
255 -1, -1, -1, -1, -1, -1, -1, -1,
256};
257
258char channel_map_unity_qs[HDSPM_MAX_CHANNELS] = {
259 0, 4, 8, 12, 16, 20, 24, 28,
260 32, 36, 40, 44, 48, 52, 56, 60,
261 -1, -1, -1, -1, -1, -1, -1, -1,
262 -1, -1, -1, -1, -1, -1, -1, -1,
263 -1, -1, -1, -1, -1, -1, -1, -1,
264 -1, -1, -1, -1, -1, -1, -1, -1,
265 -1, -1, -1, -1, -1, -1, -1, -1,
266 -1, -1, -1, -1, -1, -1, -1, -1,
267};
268
269char channel_map_raydat_ss[HDSPM_MAX_CHANNELS] = {
270 4, 5, 6, 7, 8, 9, 10, 11, /* ADAT 1 */
271 12, 13, 14, 15, 16, 17, 18, 19, /* ADAT 2 */
272 20, 21, 22, 23, 24, 25, 26, 27, /* ADAT 3 */
273 28, 29, 30, 31, 32, 33, 34, 35, /* ADAT 4 */
274 0, 1, /* AES */
275 2, 3, /* SPDIF */
276 -1, -1, -1, -1,
277 -1, -1, -1, -1, -1, -1, -1, -1,
278 -1, -1, -1, -1, -1, -1, -1, -1,
279 -1, -1, -1, -1, -1, -1, -1, -1,
280};
281
282char channel_map_raydat_ds[HDSPM_MAX_CHANNELS] = {
283 4, 5, 6, 7, /* ADAT 1 */
284 8, 9, 10, 11, /* ADAT 2 */
285 12, 13, 14, 15, /* ADAT 3 */
286 16, 17, 18, 19, /* ADAT 4 */
287 0, 1, /* AES */
288 2, 3, /* SPDIF */
289 -1, -1, -1, -1,
290 -1, -1, -1, -1, -1, -1, -1, -1,
291 -1, -1, -1, -1, -1, -1, -1, -1,
292 -1, -1, -1, -1, -1, -1, -1, -1,
293 -1, -1, -1, -1, -1, -1, -1, -1,
294 -1, -1, -1, -1, -1, -1, -1, -1,
295};
296
297char channel_map_raydat_qs[HDSPM_MAX_CHANNELS] = {
298 4, 5, /* ADAT 1 */
299 6, 7, /* ADAT 2 */
300 8, 9, /* ADAT 3 */
301 10, 11, /* ADAT 4 */
302 0, 1, /* AES */
303 2, 3, /* SPDIF */
304 -1, -1, -1, -1,
305 -1, -1, -1, -1, -1, -1, -1, -1,
306 -1, -1, -1, -1, -1, -1, -1, -1,
307 -1, -1, -1, -1, -1, -1, -1, -1,
308 -1, -1, -1, -1, -1, -1, -1, -1,
309 -1, -1, -1, -1, -1, -1, -1, -1,
310 -1, -1, -1, -1, -1, -1, -1, -1,
311};
312
313char channel_map_aio_in_ss[HDSPM_MAX_CHANNELS] = {
314 0, 1, /* line in */
315 8, 9, /* aes in, */
316 10, 11, /* spdif in */
317 12, 13, 14, 15, 16, 17, 18, 19, /* ADAT in */
318 -1, -1,
319 -1, -1, -1, -1, -1, -1, -1, -1,
320 -1, -1, -1, -1, -1, -1, -1, -1,
321 -1, -1, -1, -1, -1, -1, -1, -1,
322 -1, -1, -1, -1, -1, -1, -1, -1,
323 -1, -1, -1, -1, -1, -1, -1, -1,
324 -1, -1, -1, -1, -1, -1, -1, -1,
325};
326
327char channel_map_aio_out_ss[HDSPM_MAX_CHANNELS] = {
328 0, 1, /* line out */
329 8, 9, /* aes out */
330 10, 11, /* spdif out */
331 12, 13, 14, 15, 16, 17, 18, 19, /* ADAT out */
332 6, 7, /* phone out */
333 -1, -1, -1, -1, -1, -1, -1, -1,
334 -1, -1, -1, -1, -1, -1, -1, -1,
335 -1, -1, -1, -1, -1, -1, -1, -1,
336 -1, -1, -1, -1, -1, -1, -1, -1,
337 -1, -1, -1, -1, -1, -1, -1, -1,
338 -1, -1, -1, -1, -1, -1, -1, -1,
339};
340
341char channel_map_aio_in_ds[HDSPM_MAX_CHANNELS] = {
342 0, 1, /* line in */
343 8, 9, /* aes in */
344 10, 11, /* spdif in */
345 12, 14, 16, 18, /* adat in */
346 -1, -1, -1, -1, -1, -1,
347 -1, -1, -1, -1, -1, -1, -1, -1,
348 -1, -1, -1, -1, -1, -1, -1, -1,
349 -1, -1, -1, -1, -1, -1, -1, -1,
350 -1, -1, -1, -1, -1, -1, -1, -1,
351 -1, -1, -1, -1, -1, -1, -1, -1,
352 -1, -1, -1, -1, -1, -1, -1, -1
353};
354
355char channel_map_aio_out_ds[HDSPM_MAX_CHANNELS] = {
356 0, 1, /* line out */
357 8, 9, /* aes out */
358 10, 11, /* spdif out */
359 12, 14, 16, 18, /* adat out */
360 6, 7, /* phone out */
361 -1, -1, -1, -1,
362 -1, -1, -1, -1, -1, -1, -1, -1,
363 -1, -1, -1, -1, -1, -1, -1, -1,
364 -1, -1, -1, -1, -1, -1, -1, -1,
365 -1, -1, -1, -1, -1, -1, -1, -1,
366 -1, -1, -1, -1, -1, -1, -1, -1,
367 -1, -1, -1, -1, -1, -1, -1, -1
368};
369
370char channel_map_aio_in_qs[HDSPM_MAX_CHANNELS] = {
371 0, 1, /* line in */
372 8, 9, /* aes in */
373 10, 11, /* spdif in */
374 12, 16, /* adat in */
375 -1, -1, -1, -1, -1, -1, -1, -1,
376 -1, -1, -1, -1, -1, -1, -1, -1,
377 -1, -1, -1, -1, -1, -1, -1, -1,
378 -1, -1, -1, -1, -1, -1, -1, -1,
379 -1, -1, -1, -1, -1, -1, -1, -1,
380 -1, -1, -1, -1, -1, -1, -1, -1,
381 -1, -1, -1, -1, -1, -1, -1, -1
382};
383
384char channel_map_aio_out_qs[HDSPM_MAX_CHANNELS] = {
385 0, 1, /* line out */
386 8, 9, /* aes out */
387 10, 11, /* spdif out */
388 12, 16, /* adat out */
389 6, 7, /* phone out */
390 -1, -1, -1, -1, -1, -1,
391 -1, -1, -1, -1, -1, -1, -1, -1,
392 -1, -1, -1, -1, -1, -1, -1, -1,
393 -1, -1, -1, -1, -1, -1, -1, -1,
394 -1, -1, -1, -1, -1, -1, -1, -1,
395 -1, -1, -1, -1, -1, -1, -1, -1,
396 -1, -1, -1, -1, -1, -1, -1, -1
397};
398 228
399#endif 229#endif
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 2db871d9a007..28a1eb3f4d02 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -673,6 +673,177 @@ static char *texts_ports_aio_out_qs[] = {
673 "Phone.L", "Phone.R" 673 "Phone.L", "Phone.R"
674}; 674};
675 675
676/* These tables map the ALSA channels 1..N to the channels that we
677 need to use in order to find the relevant channel buffer. RME
678 refers to this kind of mapping as between "the ADAT channel and
679 the DMA channel." We index it using the logical audio channel,
680 and the value is the DMA channel (i.e. channel buffer number)
681 where the data for that channel can be read/written from/to.
682*/
683
684static char channel_map_unity_ss[HDSPM_MAX_CHANNELS] = {
685 0, 1, 2, 3, 4, 5, 6, 7,
686 8, 9, 10, 11, 12, 13, 14, 15,
687 16, 17, 18, 19, 20, 21, 22, 23,
688 24, 25, 26, 27, 28, 29, 30, 31,
689 32, 33, 34, 35, 36, 37, 38, 39,
690 40, 41, 42, 43, 44, 45, 46, 47,
691 48, 49, 50, 51, 52, 53, 54, 55,
692 56, 57, 58, 59, 60, 61, 62, 63
693};
694
695static char channel_map_unity_ds[HDSPM_MAX_CHANNELS] = {
696 0, 2, 4, 6, 8, 10, 12, 14,
697 16, 18, 20, 22, 24, 26, 28, 30,
698 32, 34, 36, 38, 40, 42, 44, 46,
699 48, 50, 52, 54, 56, 58, 60, 62,
700 -1, -1, -1, -1, -1, -1, -1, -1,
701 -1, -1, -1, -1, -1, -1, -1, -1,
702 -1, -1, -1, -1, -1, -1, -1, -1,
703 -1, -1, -1, -1, -1, -1, -1, -1,
704};
705
706static char channel_map_unity_qs[HDSPM_MAX_CHANNELS] = {
707 0, 4, 8, 12, 16, 20, 24, 28,
708 32, 36, 40, 44, 48, 52, 56, 60,
709 -1, -1, -1, -1, -1, -1, -1, -1,
710 -1, -1, -1, -1, -1, -1, -1, -1,
711 -1, -1, -1, -1, -1, -1, -1, -1,
712 -1, -1, -1, -1, -1, -1, -1, -1,
713 -1, -1, -1, -1, -1, -1, -1, -1,
714 -1, -1, -1, -1, -1, -1, -1, -1,
715};
716
717static char channel_map_raydat_ss[HDSPM_MAX_CHANNELS] = {
718 4, 5, 6, 7, 8, 9, 10, 11, /* ADAT 1 */
719 12, 13, 14, 15, 16, 17, 18, 19, /* ADAT 2 */
720 20, 21, 22, 23, 24, 25, 26, 27, /* ADAT 3 */
721 28, 29, 30, 31, 32, 33, 34, 35, /* ADAT 4 */
722 0, 1, /* AES */
723 2, 3, /* SPDIF */
724 -1, -1, -1, -1,
725 -1, -1, -1, -1, -1, -1, -1, -1,
726 -1, -1, -1, -1, -1, -1, -1, -1,
727 -1, -1, -1, -1, -1, -1, -1, -1,
728};
729
730static char channel_map_raydat_ds[HDSPM_MAX_CHANNELS] = {
731 4, 5, 6, 7, /* ADAT 1 */
732 8, 9, 10, 11, /* ADAT 2 */
733 12, 13, 14, 15, /* ADAT 3 */
734 16, 17, 18, 19, /* ADAT 4 */
735 0, 1, /* AES */
736 2, 3, /* SPDIF */
737 -1, -1, -1, -1,
738 -1, -1, -1, -1, -1, -1, -1, -1,
739 -1, -1, -1, -1, -1, -1, -1, -1,
740 -1, -1, -1, -1, -1, -1, -1, -1,
741 -1, -1, -1, -1, -1, -1, -1, -1,
742 -1, -1, -1, -1, -1, -1, -1, -1,
743};
744
745static char channel_map_raydat_qs[HDSPM_MAX_CHANNELS] = {
746 4, 5, /* ADAT 1 */
747 6, 7, /* ADAT 2 */
748 8, 9, /* ADAT 3 */
749 10, 11, /* ADAT 4 */
750 0, 1, /* AES */
751 2, 3, /* SPDIF */
752 -1, -1, -1, -1,
753 -1, -1, -1, -1, -1, -1, -1, -1,
754 -1, -1, -1, -1, -1, -1, -1, -1,
755 -1, -1, -1, -1, -1, -1, -1, -1,
756 -1, -1, -1, -1, -1, -1, -1, -1,
757 -1, -1, -1, -1, -1, -1, -1, -1,
758 -1, -1, -1, -1, -1, -1, -1, -1,
759};
760
761static char channel_map_aio_in_ss[HDSPM_MAX_CHANNELS] = {
762 0, 1, /* line in */
763 8, 9, /* aes in, */
764 10, 11, /* spdif in */
765 12, 13, 14, 15, 16, 17, 18, 19, /* ADAT in */
766 -1, -1,
767 -1, -1, -1, -1, -1, -1, -1, -1,
768 -1, -1, -1, -1, -1, -1, -1, -1,
769 -1, -1, -1, -1, -1, -1, -1, -1,
770 -1, -1, -1, -1, -1, -1, -1, -1,
771 -1, -1, -1, -1, -1, -1, -1, -1,
772 -1, -1, -1, -1, -1, -1, -1, -1,
773};
774
775static char channel_map_aio_out_ss[HDSPM_MAX_CHANNELS] = {
776 0, 1, /* line out */
777 8, 9, /* aes out */
778 10, 11, /* spdif out */
779 12, 13, 14, 15, 16, 17, 18, 19, /* ADAT out */
780 6, 7, /* phone out */
781 -1, -1, -1, -1, -1, -1, -1, -1,
782 -1, -1, -1, -1, -1, -1, -1, -1,
783 -1, -1, -1, -1, -1, -1, -1, -1,
784 -1, -1, -1, -1, -1, -1, -1, -1,
785 -1, -1, -1, -1, -1, -1, -1, -1,
786 -1, -1, -1, -1, -1, -1, -1, -1,
787};
788
789static char channel_map_aio_in_ds[HDSPM_MAX_CHANNELS] = {
790 0, 1, /* line in */
791 8, 9, /* aes in */
792 10, 11, /* spdif in */
793 12, 14, 16, 18, /* adat in */
794 -1, -1, -1, -1, -1, -1,
795 -1, -1, -1, -1, -1, -1, -1, -1,
796 -1, -1, -1, -1, -1, -1, -1, -1,
797 -1, -1, -1, -1, -1, -1, -1, -1,
798 -1, -1, -1, -1, -1, -1, -1, -1,
799 -1, -1, -1, -1, -1, -1, -1, -1,
800 -1, -1, -1, -1, -1, -1, -1, -1
801};
802
803static char channel_map_aio_out_ds[HDSPM_MAX_CHANNELS] = {
804 0, 1, /* line out */
805 8, 9, /* aes out */
806 10, 11, /* spdif out */
807 12, 14, 16, 18, /* adat out */
808 6, 7, /* phone out */
809 -1, -1, -1, -1,
810 -1, -1, -1, -1, -1, -1, -1, -1,
811 -1, -1, -1, -1, -1, -1, -1, -1,
812 -1, -1, -1, -1, -1, -1, -1, -1,
813 -1, -1, -1, -1, -1, -1, -1, -1,
814 -1, -1, -1, -1, -1, -1, -1, -1,
815 -1, -1, -1, -1, -1, -1, -1, -1
816};
817
818static char channel_map_aio_in_qs[HDSPM_MAX_CHANNELS] = {
819 0, 1, /* line in */
820 8, 9, /* aes in */
821 10, 11, /* spdif in */
822 12, 16, /* adat in */
823 -1, -1, -1, -1, -1, -1, -1, -1,
824 -1, -1, -1, -1, -1, -1, -1, -1,
825 -1, -1, -1, -1, -1, -1, -1, -1,
826 -1, -1, -1, -1, -1, -1, -1, -1,
827 -1, -1, -1, -1, -1, -1, -1, -1,
828 -1, -1, -1, -1, -1, -1, -1, -1,
829 -1, -1, -1, -1, -1, -1, -1, -1
830};
831
832static char channel_map_aio_out_qs[HDSPM_MAX_CHANNELS] = {
833 0, 1, /* line out */
834 8, 9, /* aes out */
835 10, 11, /* spdif out */
836 12, 16, /* adat out */
837 6, 7, /* phone out */
838 -1, -1, -1, -1, -1, -1,
839 -1, -1, -1, -1, -1, -1, -1, -1,
840 -1, -1, -1, -1, -1, -1, -1, -1,
841 -1, -1, -1, -1, -1, -1, -1, -1,
842 -1, -1, -1, -1, -1, -1, -1, -1,
843 -1, -1, -1, -1, -1, -1, -1, -1,
844 -1, -1, -1, -1, -1, -1, -1, -1
845};
846
676struct hdspm_midi { 847struct hdspm_midi {
677 struct hdspm *hdspm; 848 struct hdspm *hdspm;
678 int id; 849 int id;