1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2 #ifndef __SOUND_HDSPM_H
3 #define __SOUND_HDSPM_H
5 * Copyright (C) 2003 Winfried Ritsch (IEM)
6 * based on hdsp.h from Thomas Charbonnel (thomas@undata.org)
10 #include <linux/types.h>
13 /* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
14 #define HDSPM_MAX_CHANNELS 64
30 /* -------------------- IOCTL Peak/RMS Meters -------------------- */
32 struct hdspm_peak_rms {
33 __u32 input_peaks[64];
34 __u32 playback_peaks[64];
35 __u32 output_peaks[64];
38 __u64 playback_rms[64];
41 __u8 speed; /* enum {ss, ds, qs} */
45 #define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \
46 _IOR('H', 0x42, struct hdspm_peak_rms)
48 /* ------------ CONFIG block IOCTL ---------------------- */
51 unsigned char pref_sync_ref;
52 unsigned char wordclock_sync_check;
53 unsigned char madi_sync_check;
54 unsigned int system_sample_rate;
55 unsigned int autosync_sample_rate;
56 unsigned char system_clock_mode;
57 unsigned char clock_source;
58 unsigned char autosync_ref;
59 unsigned char line_out;
60 unsigned int passthru;
61 unsigned int analog_out;
64 #define SNDRV_HDSPM_IOCTL_GET_CONFIG \
65 _IOR('H', 0x41, struct hdspm_config)
68 * If there's a TCO (TimeCode Option) board installed,
69 * there are further options and status data available.
70 * The hdspm_ltc structure contains the current SMPTE
71 * timecode and some status information and can be
72 * obtained via SNDRV_HDSPM_IOCTL_GET_LTC or in the
73 * hdspm_status struct.
76 enum hdspm_ltc_format {
84 enum hdspm_ltc_frame {
90 enum hdspm_ltc_input_format {
99 enum hdspm_ltc_format format;
100 enum hdspm_ltc_frame frame;
101 enum hdspm_ltc_input_format input_format;
104 #define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_ltc)
107 * The status data reflects the device's current state
108 * as determined by the card's configuration and
113 hdspm_sync_no_lock = 0,
118 enum hdspm_madi_input {
119 hdspm_input_optical = 0,
123 enum hdspm_madi_channel_format {
124 hdspm_format_ch_64 = 0,
125 hdspm_format_ch_56 = 1
128 enum hdspm_madi_frame_format {
133 enum hdspm_syncsource {
141 struct hdspm_status {
142 __u8 card_type; /* enum hdspm_io_type */
143 enum hdspm_syncsource autosync_source;
150 __u8 sync_wc; /* enum hdspm_sync */
151 __u8 sync_madi; /* enum hdspm_sync */
152 __u8 sync_tco; /* enum hdspm_sync */
153 __u8 sync_in; /* enum hdspm_sync */
154 __u8 madi_input; /* enum hdspm_madi_input */
155 __u8 channel_format; /* enum hdspm_madi_channel_format */
156 __u8 frame_format; /* enum hdspm_madi_frame_format */
161 #define SNDRV_HDSPM_IOCTL_GET_STATUS \
162 _IOR('H', 0x47, struct hdspm_status)
165 * Get information about the card and its add-ons.
168 #define HDSPM_ADDON_TCO 1
170 struct hdspm_version {
171 __u8 card_type; /* enum hdspm_io_type */
174 unsigned short firmware_rev;
178 #define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x48, struct hdspm_version)
180 /* ------------- get Matrix Mixer IOCTL --------------- */
182 /* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte =
186 /* organisation is 64 channelfader in a continuous memory block */
187 /* equivalent to hardware definition, maybe for future feature of mmap of
190 /* each of 64 outputs has 64 infader and 64 outfader:
191 Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */
193 #define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
195 struct hdspm_channelfader {
196 unsigned int in[HDSPM_MIXER_CHANNELS];
197 unsigned int pb[HDSPM_MIXER_CHANNELS];
201 struct hdspm_channelfader ch[HDSPM_MIXER_CHANNELS];
204 struct hdspm_mixer_ioctl {
205 struct hdspm_mixer *mixer;
208 /* use indirect access due to the limit of ioctl bit size */
209 #define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl)