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)
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include <linux/types.h>
26 /* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
27 #define HDSPM_MAX_CHANNELS 64
43 /* -------------------- IOCTL Peak/RMS Meters -------------------- */
45 struct hdspm_peak_rms
{
46 __u32 input_peaks
[64];
47 __u32 playback_peaks
[64];
48 __u32 output_peaks
[64];
51 __u64 playback_rms
[64];
54 __u8 speed
; /* enum {ss, ds, qs} */
58 #define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \
59 _IOR('H', 0x42, struct hdspm_peak_rms)
61 /* ------------ CONFIG block IOCTL ---------------------- */
64 unsigned char pref_sync_ref
;
65 unsigned char wordclock_sync_check
;
66 unsigned char madi_sync_check
;
67 unsigned int system_sample_rate
;
68 unsigned int autosync_sample_rate
;
69 unsigned char system_clock_mode
;
70 unsigned char clock_source
;
71 unsigned char autosync_ref
;
72 unsigned char line_out
;
73 unsigned int passthru
;
74 unsigned int analog_out
;
77 #define SNDRV_HDSPM_IOCTL_GET_CONFIG \
78 _IOR('H', 0x41, struct hdspm_config)
81 * If there's a TCO (TimeCode Option) board installed,
82 * there are further options and status data available.
83 * The hdspm_ltc structure contains the current SMPTE
84 * timecode and some status information and can be
85 * obtained via SNDRV_HDSPM_IOCTL_GET_LTC or in the
86 * hdspm_status struct.
89 enum hdspm_ltc_format
{
97 enum hdspm_ltc_frame
{
103 enum hdspm_ltc_input_format
{
112 enum hdspm_ltc_format format
;
113 enum hdspm_ltc_frame frame
;
114 enum hdspm_ltc_input_format input_format
;
117 #define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_ltc)
120 * The status data reflects the device's current state
121 * as determined by the card's configuration and
126 hdspm_sync_no_lock
= 0,
131 enum hdspm_madi_input
{
132 hdspm_input_optical
= 0,
136 enum hdspm_madi_channel_format
{
137 hdspm_format_ch_64
= 0,
138 hdspm_format_ch_56
= 1
141 enum hdspm_madi_frame_format
{
146 enum hdspm_syncsource
{
154 struct hdspm_status
{
155 __u8 card_type
; /* enum hdspm_io_type */
156 enum hdspm_syncsource autosync_source
;
163 __u8 sync_wc
; /* enum hdspm_sync */
164 __u8 sync_madi
; /* enum hdspm_sync */
165 __u8 sync_tco
; /* enum hdspm_sync */
166 __u8 sync_in
; /* enum hdspm_sync */
167 __u8 madi_input
; /* enum hdspm_madi_input */
168 __u8 channel_format
; /* enum hdspm_madi_channel_format */
169 __u8 frame_format
; /* enum hdspm_madi_frame_format */
174 #define SNDRV_HDSPM_IOCTL_GET_STATUS \
175 _IOR('H', 0x47, struct hdspm_status)
178 * Get information about the card and its add-ons.
181 #define HDSPM_ADDON_TCO 1
183 struct hdspm_version
{
184 __u8 card_type
; /* enum hdspm_io_type */
187 unsigned short firmware_rev
;
191 #define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x48, struct hdspm_version)
193 /* ------------- get Matrix Mixer IOCTL --------------- */
195 /* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte =
199 /* organisation is 64 channelfader in a continuous memory block */
200 /* equivalent to hardware definition, maybe for future feature of mmap of
203 /* each of 64 outputs has 64 infader and 64 outfader:
204 Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */
206 #define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
208 struct hdspm_channelfader
{
209 unsigned int in
[HDSPM_MIXER_CHANNELS
];
210 unsigned int pb
[HDSPM_MIXER_CHANNELS
];
214 struct hdspm_channelfader ch
[HDSPM_MIXER_CHANNELS
];
217 struct hdspm_mixer_ioctl
{
218 struct hdspm_mixer
*mixer
;
221 /* use indirect access due to the limit of ioctl bit size */
222 #define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl)
224 /* typedefs for compatibility to user-space */
225 typedef struct hdspm_peak_rms hdspm_peak_rms_t
;
226 typedef struct hdspm_config_info hdspm_config_info_t
;
227 typedef struct hdspm_version hdspm_version_t
;
228 typedef struct hdspm_channelfader snd_hdspm_channelfader_t
;
229 typedef struct hdspm_mixer hdspm_mixer_t
;