Blame view

include/uapi/sound/hdspm.h 5.29 KB
ef5fa1a49   Takashi Iwai   [ALSA] hdspm - Co...
1
  #ifndef __SOUND_HDSPM_H
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
2
3
4
5
  #define __SOUND_HDSPM_H
  /*
   *   Copyright (C) 2003 Winfried Ritsch (IEM)
   *   based on hdsp.h from Thomas Charbonnel (thomas@undata.org)
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
6
7
   *
   *
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
8
9
10
11
12
13
14
15
16
17
18
19
20
21
   *   This program is free software; you can redistribute it and/or modify
   *   it under the terms of the GNU General Public License as published by
   *   the Free Software Foundation; either version 2 of the License, or
   *   (at your option) any later version.
   *
   *   This program is distributed in the hope that it will be useful,
   *   but WITHOUT ANY WARRANTY; without even the implied warranty of
   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   *   GNU General Public License for more details.
   *
   *   You should have received a copy of the GNU General Public License
   *   along with this program; if not, write to the Free Software
   *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   */
76a3aeac2   Mikko Rapeli   hdspm.h: include ...
22
  #include <linux/types.h>
76a3aeac2   Mikko Rapeli   hdspm.h: include ...
23

763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
24
25
  /* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
  #define HDSPM_MAX_CHANNELS      64
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
26
27
28
29
30
31
32
  enum hdspm_io_type {
  	MADI,
  	MADIface,
  	AIO,
  	AES32,
  	RayDAT
  };
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
33

0dca17930   Adrian Knoth   ALSA: hdspm - Add...
34
35
36
37
38
  enum hdspm_speed {
  	ss,
  	ds,
  	qs
  };
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
39

0dca17930   Adrian Knoth   ALSA: hdspm - Add...
40
  /* -------------------- IOCTL Peak/RMS Meters -------------------- */
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
41

0dca17930   Adrian Knoth   ALSA: hdspm - Add...
42
  struct hdspm_peak_rms {
ffc287c89   Mikko Rapeli   ALSA: hdspm: use ...
43
44
45
  	__u32 input_peaks[64];
  	__u32 playback_peaks[64];
  	__u32 output_peaks[64];
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
46

ffc287c89   Mikko Rapeli   ALSA: hdspm: use ...
47
48
49
  	__u64 input_rms[64];
  	__u64 playback_rms[64];
  	__u64 output_rms[64];
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
50

ffc287c89   Mikko Rapeli   ALSA: hdspm: use ...
51
  	__u8 speed; /* enum {ss, ds, qs} */
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
52
  	int status2;
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
53
  };
ef5fa1a49   Takashi Iwai   [ALSA] hdspm - Co...
54
  #define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
55
  	_IOR('H', 0x42, struct hdspm_peak_rms)
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
56
57
  
  /* ------------ CONFIG block IOCTL ---------------------- */
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
58
  struct hdspm_config {
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
59
60
61
62
63
64
65
66
67
68
69
70
  	unsigned char pref_sync_ref;
  	unsigned char wordclock_sync_check;
  	unsigned char madi_sync_check;
  	unsigned int system_sample_rate;
  	unsigned int autosync_sample_rate;
  	unsigned char system_clock_mode;
  	unsigned char clock_source;
  	unsigned char autosync_ref;
  	unsigned char line_out;
  	unsigned int passthru;
  	unsigned int analog_out;
  };
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
71
72
  #define SNDRV_HDSPM_IOCTL_GET_CONFIG \
  	_IOR('H', 0x41, struct hdspm_config)
ddcecf6b6   Takashi Iwai   ALSA: Fix invalid...
73
  /*
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
74
75
76
77
78
79
   * If there's a TCO (TimeCode Option) board installed,
   * there are further options and status data available.
   * The hdspm_ltc structure contains the current SMPTE
   * timecode and some status information and can be
   * obtained via SNDRV_HDSPM_IOCTL_GET_LTC or in the
   * hdspm_status struct.
ddcecf6b6   Takashi Iwai   ALSA: Fix invalid...
80
   */
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
  
  enum hdspm_ltc_format {
  	format_invalid,
  	fps_24,
  	fps_25,
  	fps_2997,
  	fps_30
  };
  
  enum hdspm_ltc_frame {
  	frame_invalid,
  	drop_frame,
  	full_frame
  };
  
  enum hdspm_ltc_input_format {
  	ntsc,
  	pal,
  	no_video
  };
  
  struct hdspm_ltc {
  	unsigned int ltc;
  
  	enum hdspm_ltc_format format;
  	enum hdspm_ltc_frame frame;
  	enum hdspm_ltc_input_format input_format;
  };
b43dd416b   Adrian Knoth   ALSA: hdspm - Fix...
109
  #define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_ltc)
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
110

ddcecf6b6   Takashi Iwai   ALSA: Fix invalid...
111
  /*
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
112
113
114
   * The status data reflects the device's current state
   * as determined by the card's configuration and
   * connection status.
ddcecf6b6   Takashi Iwai   ALSA: Fix invalid...
115
   */
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
  
  enum hdspm_sync {
  	hdspm_sync_no_lock = 0,
  	hdspm_sync_lock = 1,
  	hdspm_sync_sync = 2
  };
  
  enum hdspm_madi_input {
  	hdspm_input_optical = 0,
  	hdspm_input_coax = 1
  };
  
  enum hdspm_madi_channel_format {
  	hdspm_format_ch_64 = 0,
  	hdspm_format_ch_56 = 1
  };
  
  enum hdspm_madi_frame_format {
  	hdspm_frame_48 = 0,
  	hdspm_frame_96 = 1
  };
  
  enum hdspm_syncsource {
  	syncsource_wc = 0,
  	syncsource_madi = 1,
  	syncsource_tco = 2,
  	syncsource_sync = 3,
  	syncsource_none = 4
  };
  
  struct hdspm_status {
ffc287c89   Mikko Rapeli   ALSA: hdspm: use ...
147
  	__u8 card_type; /* enum hdspm_io_type */
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
148
  	enum hdspm_syncsource autosync_source;
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
149

ffc287c89   Mikko Rapeli   ALSA: hdspm: use ...
150
151
  	__u64 card_clock;
  	__u32 master_period;
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
152
153
154
  
  	union {
  		struct {
ffc287c89   Mikko Rapeli   ALSA: hdspm: use ...
155
156
157
158
159
160
161
  			__u8 sync_wc; /* enum hdspm_sync */
  			__u8 sync_madi; /* enum hdspm_sync */
  			__u8 sync_tco; /* enum hdspm_sync */
  			__u8 sync_in; /* enum hdspm_sync */
  			__u8 madi_input; /* enum hdspm_madi_input */
  			__u8 channel_format; /* enum hdspm_madi_channel_format */
  			__u8 frame_format; /* enum hdspm_madi_frame_format */
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
162
163
164
  		} madi;
  	} card_specific;
  };
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
165

0dca17930   Adrian Knoth   ALSA: hdspm - Add...
166
167
  #define SNDRV_HDSPM_IOCTL_GET_STATUS \
  	_IOR('H', 0x47, struct hdspm_status)
ddcecf6b6   Takashi Iwai   ALSA: Fix invalid...
168
  /*
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
169
   * Get information about the card and its add-ons.
ddcecf6b6   Takashi Iwai   ALSA: Fix invalid...
170
   */
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
171
172
  
  #define HDSPM_ADDON_TCO 1
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
173

98274f070   Takashi Iwai   [ALSA] Remove xxx...
174
  struct hdspm_version {
ffc287c89   Mikko Rapeli   ALSA: hdspm: use ...
175
  	__u8 card_type; /* enum hdspm_io_type */
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
176
177
  	char cardname[20];
  	unsigned int serial;
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
178
  	unsigned short firmware_rev;
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
179
  	int addons;
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
180
  };
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
181
  #define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x48, struct hdspm_version)
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
182
183
  
  /* ------------- get Matrix Mixer IOCTL --------------- */
ef5fa1a49   Takashi Iwai   [ALSA] hdspm - Co...
184
185
186
  /* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte =
   * 32768 Bytes
   */
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
187

25985edce   Lucas De Marchi   Fix common misspe...
188
  /* organisation is 64 channelfader in a continuous memory block */
ef5fa1a49   Takashi Iwai   [ALSA] hdspm - Co...
189
190
191
  /* equivalent to hardware definition, maybe for future feature of mmap of
   * them
   */
0dca17930   Adrian Knoth   ALSA: hdspm - Add...
192
  /* each of 64 outputs has 64 infader and 64 outfader:
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
193
194
195
     Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */
  
  #define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
98274f070   Takashi Iwai   [ALSA] Remove xxx...
196
  struct hdspm_channelfader {
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
197
198
199
  	unsigned int in[HDSPM_MIXER_CHANNELS];
  	unsigned int pb[HDSPM_MIXER_CHANNELS];
  };
98274f070   Takashi Iwai   [ALSA] Remove xxx...
200
201
  struct hdspm_mixer {
  	struct hdspm_channelfader ch[HDSPM_MIXER_CHANNELS];
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
202
  };
98274f070   Takashi Iwai   [ALSA] Remove xxx...
203
204
  struct hdspm_mixer_ioctl {
  	struct hdspm_mixer *mixer;
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
205
206
207
  };
  
  /* use indirect access due to the limit of ioctl bit size */
98274f070   Takashi Iwai   [ALSA] Remove xxx...
208
209
210
211
212
213
214
215
  #define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl)
  
  /* typedefs for compatibility to user-space */
  typedef struct hdspm_peak_rms hdspm_peak_rms_t;
  typedef struct hdspm_config_info hdspm_config_info_t;
  typedef struct hdspm_version hdspm_version_t;
  typedef struct hdspm_channelfader snd_hdspm_channelfader_t;
  typedef struct hdspm_mixer hdspm_mixer_t;
763f356cd   Takashi Iwai   [ALSA] Add HDSP M...
216

0dca17930   Adrian Knoth   ALSA: hdspm - Add...
217
218
  
  #endif