diff options
Diffstat (limited to 'sound/pci/rme9652/hdspm.c')
-rw-r--r-- | sound/pci/rme9652/hdspm.c | 171 |
1 files changed, 171 insertions, 0 deletions
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 | |||
684 | static 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 | |||
695 | static 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 | |||
706 | static 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 | |||
717 | static 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 | |||
730 | static 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 | |||
745 | static 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 | |||
761 | static 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 | |||
775 | static 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 | |||
789 | static 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 | |||
803 | static 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 | |||
818 | static 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 | |||
832 | static 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 | |||
676 | struct hdspm_midi { | 847 | struct hdspm_midi { |
677 | struct hdspm *hdspm; | 848 | struct hdspm *hdspm; |
678 | int id; | 849 | int id; |