1#ifndef __SOUND_HDSPM_H
2#define __SOUND_HDSPM_H
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#include <linux/types.h>
24
25
26#define HDSPM_MAX_CHANNELS 64
27
28enum hdspm_io_type {
29 MADI,
30 MADIface,
31 AIO,
32 AES32,
33 RayDAT
34};
35
36enum hdspm_speed {
37 ss,
38 ds,
39 qs
40};
41
42
43
44struct hdspm_peak_rms {
45 __u32 input_peaks[64];
46 __u32 playback_peaks[64];
47 __u32 output_peaks[64];
48
49 __u64 input_rms[64];
50 __u64 playback_rms[64];
51 __u64 output_rms[64];
52
53 __u8 speed;
54 int status2;
55};
56
57#define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \
58 _IOR('H', 0x42, struct hdspm_peak_rms)
59
60
61
62struct hdspm_config {
63 unsigned char pref_sync_ref;
64 unsigned char wordclock_sync_check;
65 unsigned char madi_sync_check;
66 unsigned int system_sample_rate;
67 unsigned int autosync_sample_rate;
68 unsigned char system_clock_mode;
69 unsigned char clock_source;
70 unsigned char autosync_ref;
71 unsigned char line_out;
72 unsigned int passthru;
73 unsigned int analog_out;
74};
75
76#define SNDRV_HDSPM_IOCTL_GET_CONFIG \
77 _IOR('H', 0x41, struct hdspm_config)
78
79
80
81
82
83
84
85
86
87
88enum hdspm_ltc_format {
89 format_invalid,
90 fps_24,
91 fps_25,
92 fps_2997,
93 fps_30
94};
95
96enum hdspm_ltc_frame {
97 frame_invalid,
98 drop_frame,
99 full_frame
100};
101
102enum hdspm_ltc_input_format {
103 ntsc,
104 pal,
105 no_video
106};
107
108struct hdspm_ltc {
109 unsigned int ltc;
110
111 enum hdspm_ltc_format format;
112 enum hdspm_ltc_frame frame;
113 enum hdspm_ltc_input_format input_format;
114};
115
116#define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_ltc)
117
118
119
120
121
122
123
124enum hdspm_sync {
125 hdspm_sync_no_lock = 0,
126 hdspm_sync_lock = 1,
127 hdspm_sync_sync = 2
128};
129
130enum hdspm_madi_input {
131 hdspm_input_optical = 0,
132 hdspm_input_coax = 1
133};
134
135enum hdspm_madi_channel_format {
136 hdspm_format_ch_64 = 0,
137 hdspm_format_ch_56 = 1
138};
139
140enum hdspm_madi_frame_format {
141 hdspm_frame_48 = 0,
142 hdspm_frame_96 = 1
143};
144
145enum hdspm_syncsource {
146 syncsource_wc = 0,
147 syncsource_madi = 1,
148 syncsource_tco = 2,
149 syncsource_sync = 3,
150 syncsource_none = 4
151};
152
153struct hdspm_status {
154 __u8 card_type;
155 enum hdspm_syncsource autosync_source;
156
157 __u64 card_clock;
158 __u32 master_period;
159
160 union {
161 struct {
162 __u8 sync_wc;
163 __u8 sync_madi;
164 __u8 sync_tco;
165 __u8 sync_in;
166 __u8 madi_input;
167 __u8 channel_format;
168 __u8 frame_format;
169 } madi;
170 } card_specific;
171};
172
173#define SNDRV_HDSPM_IOCTL_GET_STATUS \
174 _IOR('H', 0x47, struct hdspm_status)
175
176
177
178
179
180#define HDSPM_ADDON_TCO 1
181
182struct hdspm_version {
183 __u8 card_type;
184 char cardname[20];
185 unsigned int serial;
186 unsigned short firmware_rev;
187 int addons;
188};
189
190#define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x48, struct hdspm_version)
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205#define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
206
207struct hdspm_channelfader {
208 unsigned int in[HDSPM_MIXER_CHANNELS];
209 unsigned int pb[HDSPM_MIXER_CHANNELS];
210};
211
212struct hdspm_mixer {
213 struct hdspm_channelfader ch[HDSPM_MIXER_CHANNELS];
214};
215
216struct hdspm_mixer_ioctl {
217 struct hdspm_mixer *mixer;
218};
219
220
221#define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl)
222
223
224typedef struct hdspm_peak_rms hdspm_peak_rms_t;
225typedef struct hdspm_config_info hdspm_config_info_t;
226typedef struct hdspm_version hdspm_version_t;
227typedef struct hdspm_channelfader snd_hdspm_channelfader_t;
228typedef struct hdspm_mixer hdspm_mixer_t;
229
230
231#endif
232