diff options
Diffstat (limited to 'include/sound/hdspm.h')
-rw-r--r-- | include/sound/hdspm.h | 179 |
1 files changed, 137 insertions, 42 deletions
diff --git a/include/sound/hdspm.h b/include/sound/hdspm.h index 81990b2bcc98..1774ff5ff632 100644 --- a/include/sound/hdspm.h +++ b/include/sound/hdspm.h | |||
@@ -3,8 +3,8 @@ | |||
3 | /* | 3 | /* |
4 | * Copyright (C) 2003 Winfried Ritsch (IEM) | 4 | * Copyright (C) 2003 Winfried Ritsch (IEM) |
5 | * based on hdsp.h from Thomas Charbonnel (thomas@undata.org) | 5 | * based on hdsp.h from Thomas Charbonnel (thomas@undata.org) |
6 | * | 6 | * |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation; either version 2 of the License, or | 10 | * the Free Software Foundation; either version 2 of the License, or |
@@ -23,50 +23,41 @@ | |||
23 | /* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */ | 23 | /* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */ |
24 | #define HDSPM_MAX_CHANNELS 64 | 24 | #define HDSPM_MAX_CHANNELS 64 |
25 | 25 | ||
26 | /* -------------------- IOCTL Peak/RMS Meters -------------------- */ | 26 | enum hdspm_io_type { |
27 | 27 | MADI, | |
28 | /* peam rms level structure like we get from hardware | 28 | MADIface, |
29 | 29 | AIO, | |
30 | maybe in future we can memory map it so I just copy it | 30 | AES32, |
31 | to user on ioctl call now an dont change anything | 31 | RayDAT |
32 | rms are made out of low and high values | 32 | }; |
33 | where (long) ????_rms = (????_rms_l >> 8) + ((????_rms_h & 0xFFFFFF00)<<24) | ||
34 | (i asume so from the code) | ||
35 | */ | ||
36 | |||
37 | struct hdspm_peak_rms { | ||
38 | |||
39 | unsigned int level_offset[1024]; | ||
40 | 33 | ||
41 | unsigned int input_peak[64]; | 34 | enum hdspm_speed { |
42 | unsigned int playback_peak[64]; | 35 | ss, |
43 | unsigned int output_peak[64]; | 36 | ds, |
44 | unsigned int xxx_peak[64]; /* not used */ | 37 | qs |
38 | }; | ||
45 | 39 | ||
46 | unsigned int reserved[256]; /* not used */ | 40 | /* -------------------- IOCTL Peak/RMS Meters -------------------- */ |
47 | 41 | ||
48 | unsigned int input_rms_l[64]; | 42 | struct hdspm_peak_rms { |
49 | unsigned int playback_rms_l[64]; | 43 | uint32_t input_peaks[64]; |
50 | unsigned int output_rms_l[64]; | 44 | uint32_t playback_peaks[64]; |
51 | unsigned int xxx_rms_l[64]; /* not used */ | 45 | uint32_t output_peaks[64]; |
52 | 46 | ||
53 | unsigned int input_rms_h[64]; | 47 | uint64_t input_rms[64]; |
54 | unsigned int playback_rms_h[64]; | 48 | uint64_t playback_rms[64]; |
55 | unsigned int output_rms_h[64]; | 49 | uint64_t output_rms[64]; |
56 | unsigned int xxx_rms_h[64]; /* not used */ | ||
57 | }; | ||
58 | 50 | ||
59 | struct hdspm_peak_rms_ioctl { | 51 | uint8_t speed; /* enum {ss, ds, qs} */ |
60 | struct hdspm_peak_rms *peak; | 52 | int status2; |
61 | }; | 53 | }; |
62 | 54 | ||
63 | /* use indirect access due to the limit of ioctl bit size */ | ||
64 | #define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \ | 55 | #define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \ |
65 | _IOR('H', 0x40, struct hdspm_peak_rms_ioctl) | 56 | _IOR('H', 0x42, struct hdspm_peak_rms) |
66 | 57 | ||
67 | /* ------------ CONFIG block IOCTL ---------------------- */ | 58 | /* ------------ CONFIG block IOCTL ---------------------- */ |
68 | 59 | ||
69 | struct hdspm_config_info { | 60 | struct hdspm_config { |
70 | unsigned char pref_sync_ref; | 61 | unsigned char pref_sync_ref; |
71 | unsigned char wordclock_sync_check; | 62 | unsigned char wordclock_sync_check; |
72 | unsigned char madi_sync_check; | 63 | unsigned char madi_sync_check; |
@@ -80,18 +71,121 @@ struct hdspm_config_info { | |||
80 | unsigned int analog_out; | 71 | unsigned int analog_out; |
81 | }; | 72 | }; |
82 | 73 | ||
83 | #define SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO \ | 74 | #define SNDRV_HDSPM_IOCTL_GET_CONFIG \ |
84 | _IOR('H', 0x41, struct hdspm_config_info) | 75 | _IOR('H', 0x41, struct hdspm_config) |
76 | |||
77 | /** | ||
78 | * If there's a TCO (TimeCode Option) board installed, | ||
79 | * there are further options and status data available. | ||
80 | * The hdspm_ltc structure contains the current SMPTE | ||
81 | * timecode and some status information and can be | ||
82 | * obtained via SNDRV_HDSPM_IOCTL_GET_LTC or in the | ||
83 | * hdspm_status struct. | ||
84 | **/ | ||
85 | |||
86 | enum hdspm_ltc_format { | ||
87 | format_invalid, | ||
88 | fps_24, | ||
89 | fps_25, | ||
90 | fps_2997, | ||
91 | fps_30 | ||
92 | }; | ||
93 | |||
94 | enum hdspm_ltc_frame { | ||
95 | frame_invalid, | ||
96 | drop_frame, | ||
97 | full_frame | ||
98 | }; | ||
99 | |||
100 | enum hdspm_ltc_input_format { | ||
101 | ntsc, | ||
102 | pal, | ||
103 | no_video | ||
104 | }; | ||
105 | |||
106 | struct hdspm_ltc { | ||
107 | unsigned int ltc; | ||
85 | 108 | ||
109 | enum hdspm_ltc_format format; | ||
110 | enum hdspm_ltc_frame frame; | ||
111 | enum hdspm_ltc_input_format input_format; | ||
112 | }; | ||
113 | |||
114 | #define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_mixer_ioctl) | ||
115 | |||
116 | /** | ||
117 | * The status data reflects the device's current state | ||
118 | * as determined by the card's configuration and | ||
119 | * connection status. | ||
120 | **/ | ||
121 | |||
122 | enum hdspm_sync { | ||
123 | hdspm_sync_no_lock = 0, | ||
124 | hdspm_sync_lock = 1, | ||
125 | hdspm_sync_sync = 2 | ||
126 | }; | ||
86 | 127 | ||
87 | /* get Soundcard Version */ | 128 | enum hdspm_madi_input { |
129 | hdspm_input_optical = 0, | ||
130 | hdspm_input_coax = 1 | ||
131 | }; | ||
132 | |||
133 | enum hdspm_madi_channel_format { | ||
134 | hdspm_format_ch_64 = 0, | ||
135 | hdspm_format_ch_56 = 1 | ||
136 | }; | ||
137 | |||
138 | enum hdspm_madi_frame_format { | ||
139 | hdspm_frame_48 = 0, | ||
140 | hdspm_frame_96 = 1 | ||
141 | }; | ||
142 | |||
143 | enum hdspm_syncsource { | ||
144 | syncsource_wc = 0, | ||
145 | syncsource_madi = 1, | ||
146 | syncsource_tco = 2, | ||
147 | syncsource_sync = 3, | ||
148 | syncsource_none = 4 | ||
149 | }; | ||
150 | |||
151 | struct hdspm_status { | ||
152 | uint8_t card_type; /* enum hdspm_io_type */ | ||
153 | enum hdspm_syncsource autosync_source; | ||
154 | |||
155 | uint64_t card_clock; | ||
156 | uint32_t master_period; | ||
157 | |||
158 | union { | ||
159 | struct { | ||
160 | uint8_t sync_wc; /* enum hdspm_sync */ | ||
161 | uint8_t sync_madi; /* enum hdspm_sync */ | ||
162 | uint8_t sync_tco; /* enum hdspm_sync */ | ||
163 | uint8_t sync_in; /* enum hdspm_sync */ | ||
164 | uint8_t madi_input; /* enum hdspm_madi_input */ | ||
165 | uint8_t channel_format; /* enum hdspm_madi_channel_format */ | ||
166 | uint8_t frame_format; /* enum hdspm_madi_frame_format */ | ||
167 | } madi; | ||
168 | } card_specific; | ||
169 | }; | ||
170 | |||
171 | #define SNDRV_HDSPM_IOCTL_GET_STATUS \ | ||
172 | _IOR('H', 0x47, struct hdspm_status) | ||
173 | |||
174 | /** | ||
175 | * Get information about the card and its add-ons. | ||
176 | **/ | ||
177 | |||
178 | #define HDSPM_ADDON_TCO 1 | ||
88 | 179 | ||
89 | struct hdspm_version { | 180 | struct hdspm_version { |
181 | uint8_t card_type; /* enum hdspm_io_type */ | ||
182 | char cardname[20]; | ||
183 | unsigned int serial; | ||
90 | unsigned short firmware_rev; | 184 | unsigned short firmware_rev; |
185 | int addons; | ||
91 | }; | 186 | }; |
92 | 187 | ||
93 | #define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdspm_version) | 188 | #define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x48, struct hdspm_version) |
94 | |||
95 | 189 | ||
96 | /* ------------- get Matrix Mixer IOCTL --------------- */ | 190 | /* ------------- get Matrix Mixer IOCTL --------------- */ |
97 | 191 | ||
@@ -103,7 +197,7 @@ struct hdspm_version { | |||
103 | /* equivalent to hardware definition, maybe for future feature of mmap of | 197 | /* equivalent to hardware definition, maybe for future feature of mmap of |
104 | * them | 198 | * them |
105 | */ | 199 | */ |
106 | /* each of 64 outputs has 64 infader and 64 outfader: | 200 | /* each of 64 outputs has 64 infader and 64 outfader: |
107 | Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */ | 201 | Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */ |
108 | 202 | ||
109 | #define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS | 203 | #define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS |
@@ -131,4 +225,5 @@ typedef struct hdspm_version hdspm_version_t; | |||
131 | typedef struct hdspm_channelfader snd_hdspm_channelfader_t; | 225 | typedef struct hdspm_channelfader snd_hdspm_channelfader_t; |
132 | typedef struct hdspm_mixer hdspm_mixer_t; | 226 | typedef struct hdspm_mixer hdspm_mixer_t; |
133 | 227 | ||
134 | #endif /* __SOUND_HDSPM_H */ | 228 | |
229 | #endif | ||