diff options
author | Martin Dausel <martin.dausel@iosono-sound.com> | 2013-07-05 05:28:23 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-07-05 08:53:43 -0400 |
commit | 69358fca4203eda93e008f234fabf603d9dba15e (patch) | |
tree | 5254b98e7379006943d057268937f0586193fbb0 /sound/pci/rme9652/hdspm.c | |
parent | 04659f9e9e6f2493d0e2dc52c72c4f20c22d9c61 (diff) |
ALSA: hdspm - Added some comments and control register documentation
Signed-off-by: Martin Dausel <martin.dausel@iosono-sound.com>
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/rme9652/hdspm.c')
-rw-r--r-- | sound/pci/rme9652/hdspm.c | 106 |
1 files changed, 99 insertions, 7 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 7a09b2de907b..a3a71ac513f1 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c | |||
@@ -38,6 +38,97 @@ | |||
38 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 38 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
39 | * | 39 | * |
40 | */ | 40 | */ |
41 | |||
42 | /* ************* Register Documentation ******************************************************* | ||
43 | * | ||
44 | * Work in progress! Documentation is based on the code in this file. | ||
45 | * | ||
46 | * --------- HDSPM_controlRegister --------- | ||
47 | * :7654.3210:7654.3210:7654.3210:7654.3210: bit number per byte | ||
48 | * :||||.||||:||||.||||:||||.||||:||||.||||: | ||
49 | * :3322.2222:2222.1111:1111.1100:0000.0000: bit number | ||
50 | * :1098.7654:3210.9876:5432.1098:7654.3210: 0..31 | ||
51 | * :||||.||||:||||.||||:||||.||||:||||.||||: | ||
52 | * :8421.8421:8421.8421:8421.8421:8421.8421: hex digit | ||
53 | * : . : . : . : x . : HDSPM_AudioInterruptEnable \_ setting both bits | ||
54 | * : . : . : . : . x: HDSPM_Start / enables audio IO | ||
55 | * : . : . : . : x. : HDSPM_ClockModeMaster - 1: Master, 0: Slave | ||
56 | * : . : . : . : .210 : HDSPM_LatencyMask - 3 Bit value for latency | ||
57 | * : . : . : . : . : 0:64, 1:128, 2:256, 3:512, | ||
58 | * : . : . : . : . : 4:1024, 5:2048, 6:4096, 7:8192 | ||
59 | * :x . : . : . x:xx . : HDSPM_FrequencyMask | ||
60 | * : . : . : . :10 . : HDSPM_Frequency1|HDSPM_Frequency0: 1=32K,2=44.1K,3=48K,0=?? | ||
61 | * : . : . : . x: . : <MADI> HDSPM_DoubleSpeed | ||
62 | * :x . : . : . : . : <MADI> HDSPM_QuadSpeed | ||
63 | * : . 3 : . 10: 2 . : . : HDSPM_SyncRefMask : | ||
64 | * : . : . x: . : . : HDSPM_SyncRef0 | ||
65 | * : . : . x : . : . : HDSPM_SyncRef1 | ||
66 | * : . : . : x . : . : <AES32> HDSPM_SyncRef2 | ||
67 | * : . x : . : . : . : <AES32> HDSPM_SyncRef3 | ||
68 | * : . : . 10: . : . : <MADI> sync ref: 0:WC, 1:Madi, 2:TCO, 3:SyncIn | ||
69 | * : . 3 : . 10: 2 . : . : <AES32> 0:WC, 1:AES1 ... 8:AES8, 9: TCO, 10:SyncIn? | ||
70 | * : . x : . : . : . : <MADIe> HDSPe_FLOAT_FORMAT | ||
71 | * : . : . : x . : . : <MADI> HDSPM_InputSelect0 : 0=optical,1=coax | ||
72 | * : . : . :x . : . : <MADI> HDSPM_InputSelect1 | ||
73 | * : . : .x : . : . : <MADI> HDSPM_clr_tms | ||
74 | * : . : . : . x : . : <MADI> HDSPM_TX_64ch | ||
75 | * : . : . : . x : . : <AES32> HDSPM_Emphasis | ||
76 | * : . : . : .x : . : <MADI> HDSPM_AutoInp | ||
77 | * : . : . x : . : . : <MADI> HDSPM_SMUX | ||
78 | * : . : .x : . : . : <MADI> HDSPM_clr_tms | ||
79 | * : . : x. : . : . : <MADI> HDSPM_taxi_reset | ||
80 | * : . x: . : . : . : <MADI> HDSPM_LineOut | ||
81 | * : . x: . : . : . : <AES32> ?????????????????? | ||
82 | * : . : x. : . : . : <AES32> HDSPM_WCK48 | ||
83 | * : . : . : .x : . : <AES32> HDSPM_Dolby | ||
84 | * : . : x . : . : . : HDSPM_Midi0InterruptEnable | ||
85 | * : . :x . : . : . : HDSPM_Midi1InterruptEnable | ||
86 | * : . : x . : . : . : HDSPM_Midi2InterruptEnable | ||
87 | * : . x : . : . : . : <MADI> HDSPM_Midi3InterruptEnable | ||
88 | * : . x : . : . : . : <AES32> HDSPM_DS_DoubleWire | ||
89 | * : .x : . : . : . : <AES32> HDSPM_QS_DoubleWire | ||
90 | * : x. : . : . : . : <AES32> HDSPM_QS_QuadWire | ||
91 | * : . : . : . x : . : <AES32> HDSPM_Professional | ||
92 | * : x . : . : . : . : HDSPM_wclk_sel | ||
93 | * : . : . : . : . : | ||
94 | * :7654.3210:7654.3210:7654.3210:7654.3210: bit number per byte | ||
95 | * :||||.||||:||||.||||:||||.||||:||||.||||: | ||
96 | * :3322.2222:2222.1111:1111.1100:0000.0000: bit number | ||
97 | * :1098.7654:3210.9876:5432.1098:7654.3210: 0..31 | ||
98 | * :||||.||||:||||.||||:||||.||||:||||.||||: | ||
99 | * :8421.8421:8421.8421:8421.8421:8421.8421:hex digit | ||
100 | * | ||
101 | * | ||
102 | * | ||
103 | * AIO / RayDAT only | ||
104 | * | ||
105 | * ------------ HDSPM_WR_SETTINGS ---------- | ||
106 | * :3322.2222:2222.1111:1111.1100:0000.0000: bit number per byte | ||
107 | * :1098.7654:3210.9876:5432.1098:7654.3210: | ||
108 | * :||||.||||:||||.||||:||||.||||:||||.||||: bit number | ||
109 | * :7654.3210:7654.3210:7654.3210:7654.3210: 0..31 | ||
110 | * :||||.||||:||||.||||:||||.||||:||||.||||: | ||
111 | * :8421.8421:8421.8421:8421.8421:8421.8421: hex digit | ||
112 | * : . : . : . : . x: HDSPM_c0Master 1: Master, 0: Slave | ||
113 | * : . : . : . : . x : HDSPM_c0_SyncRef0 | ||
114 | * : . : . : . : . x : HDSPM_c0_SyncRef1 | ||
115 | * : . : . : . : .x : HDSPM_c0_SyncRef2 | ||
116 | * : . : . : . : x. : HDSPM_c0_SyncRef3 | ||
117 | * : . : . : . : 3.210 : HDSPM_c0_SyncRefMask: | ||
118 | * : . : . : . : . : RayDat: 0:WC, 1:AES, 2:SPDIF, 3..6: ADAT1..4, | ||
119 | * : . : . : . : . : 9:TCO, 10:SyncIn | ||
120 | * : . : . : . : . : AIO: 0:WC, 1:AES, 2: SPDIF, 3: ATAT, | ||
121 | * : . : . : . : . : 9:TCO, 10:SyncIn | ||
122 | * : . : . : . : . : | ||
123 | * : . : . : . : . : | ||
124 | * :3322.2222:2222.1111:1111.1100:0000.0000: bit number per byte | ||
125 | * :1098.7654:3210.9876:5432.1098:7654.3210: | ||
126 | * :||||.||||:||||.||||:||||.||||:||||.||||: bit number | ||
127 | * :7654.3210:7654.3210:7654.3210:7654.3210: 0..31 | ||
128 | * :||||.||||:||||.||||:||||.||||:||||.||||: | ||
129 | * :8421.8421:8421.8421:8421.8421:8421.8421: hex digit | ||
130 | * | ||
131 | */ | ||
41 | #include <linux/init.h> | 132 | #include <linux/init.h> |
42 | #include <linux/delay.h> | 133 | #include <linux/delay.h> |
43 | #include <linux/interrupt.h> | 134 | #include <linux/interrupt.h> |
@@ -95,7 +186,7 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}"); | |||
95 | #define HDSPM_controlRegister 64 | 186 | #define HDSPM_controlRegister 64 |
96 | #define HDSPM_interruptConfirmation 96 | 187 | #define HDSPM_interruptConfirmation 96 |
97 | #define HDSPM_control2Reg 256 /* not in specs ???????? */ | 188 | #define HDSPM_control2Reg 256 /* not in specs ???????? */ |
98 | #define HDSPM_freqReg 256 /* for AES32 */ | 189 | #define HDSPM_freqReg 256 /* for setting arbitrary clock values (DDS feature) */ |
99 | #define HDSPM_midiDataOut0 352 /* just believe in old code */ | 190 | #define HDSPM_midiDataOut0 352 /* just believe in old code */ |
100 | #define HDSPM_midiDataOut1 356 | 191 | #define HDSPM_midiDataOut1 356 |
101 | #define HDSPM_eeprom_wr 384 /* for AES32 */ | 192 | #define HDSPM_eeprom_wr 384 /* for AES32 */ |
@@ -890,11 +981,11 @@ struct hdspm_midi { | |||
890 | }; | 981 | }; |
891 | 982 | ||
892 | struct hdspm_tco { | 983 | struct hdspm_tco { |
893 | int input; | 984 | int input; /* 0: LTC, 1:Video, 2: WC*/ |
894 | int framerate; | 985 | int framerate; /* 0=24, 1=25, 2=29.97, 3=29.97d, 4=30, 5=30d */ |
895 | int wordclock; | 986 | int wordclock; /* 0=1:1, 1=44.1->48, 2=48->44.1 */ |
896 | int samplerate; | 987 | int samplerate; /* 0=44.1, 1=48, 2= freq from app */ |
897 | int pull; | 988 | int pull; /* 0=0, 1=+0.1%, 2=-0.1%, 3=+4%, 4=-4%*/ |
898 | int term; /* 0 = off, 1 = on */ | 989 | int term; /* 0 = off, 1 = on */ |
899 | }; | 990 | }; |
900 | 991 | ||
@@ -913,7 +1004,7 @@ struct hdspm { | |||
913 | 1004 | ||
914 | u32 control_register; /* cached value */ | 1005 | u32 control_register; /* cached value */ |
915 | u32 control2_register; /* cached value */ | 1006 | u32 control2_register; /* cached value */ |
916 | u32 settings_register; | 1007 | u32 settings_register; /* cached value for AIO / RayDat (sync reference, master/slave) */ |
917 | 1008 | ||
918 | struct hdspm_midi midi[4]; | 1009 | struct hdspm_midi midi[4]; |
919 | struct tasklet_struct midi_tasklet; | 1010 | struct tasklet_struct midi_tasklet; |
@@ -4137,6 +4228,7 @@ static void hdspm_tco_write(struct hdspm *hdspm) | |||
4137 | static int snd_hdspm_info_tco_sample_rate(struct snd_kcontrol *kcontrol, | 4228 | static int snd_hdspm_info_tco_sample_rate(struct snd_kcontrol *kcontrol, |
4138 | struct snd_ctl_elem_info *uinfo) | 4229 | struct snd_ctl_elem_info *uinfo) |
4139 | { | 4230 | { |
4231 | /* TODO freq from app could be supported here, see tco->samplerate */ | ||
4140 | static const char *const texts[] = { "44.1 kHz", "48 kHz" }; | 4232 | static const char *const texts[] = { "44.1 kHz", "48 kHz" }; |
4141 | ENUMERATED_CTL_INFO(uinfo, texts); | 4233 | ENUMERATED_CTL_INFO(uinfo, texts); |
4142 | return 0; | 4234 | return 0; |