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.
25 #include <linux/types.h>
28 /* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
29 #define HDSPM_MAX_CHANNELS 64
45 /* -------------------- IOCTL Peak/RMS Meters -------------------- */
47 struct hdspm_peak_rms
{
48 __u32 input_peaks
[64];
49 __u32 playback_peaks
[64];
50 __u32 output_peaks
[64];
53 __u64 playback_rms
[64];
56 __u8 speed
; /* enum {ss, ds, qs} */
60 #define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \
61 _IOR('H', 0x42, struct hdspm_peak_rms)
63 /* ------------ CONFIG block IOCTL ---------------------- */
66 unsigned char pref_sync_ref
;
67 unsigned char wordclock_sync_check
;
68 unsigned char madi_sync_check
;
69 unsigned int system_sample_rate
;
70 unsigned int autosync_sample_rate
;
71 unsigned char system_clock_mode
;
72 unsigned char clock_source
;
73 unsigned char autosync_ref
;
74 unsigned char line_out
;
75 unsigned int passthru
;
76 unsigned int analog_out
;
79 #define SNDRV_HDSPM_IOCTL_GET_CONFIG \
80 _IOR('H', 0x41, struct hdspm_config)
83 * If there's a TCO (TimeCode Option) board installed,
84 * there are further options and status data available.
85 * The hdspm_ltc structure contains the current SMPTE
86 * timecode and some status information and can be
87 * obtained via SNDRV_HDSPM_IOCTL_GET_LTC or in the
88 * hdspm_status struct.
91 enum hdspm_ltc_format
{
99 enum hdspm_ltc_frame
{
105 enum hdspm_ltc_input_format
{
114 enum hdspm_ltc_format format
;
115 enum hdspm_ltc_frame frame
;
116 enum hdspm_ltc_input_format input_format
;
119 #define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_ltc)
122 * The status data reflects the device's current state
123 * as determined by the card's configuration and
128 hdspm_sync_no_lock
= 0,
133 enum hdspm_madi_input
{
134 hdspm_input_optical
= 0,
138 enum hdspm_madi_channel_format
{
139 hdspm_format_ch_64
= 0,
140 hdspm_format_ch_56
= 1
143 enum hdspm_madi_frame_format
{
148 enum hdspm_syncsource
{
156 struct hdspm_status
{
157 __u8 card_type
; /* enum hdspm_io_type */
158 enum hdspm_syncsource autosync_source
;
165 __u8 sync_wc
; /* enum hdspm_sync */
166 __u8 sync_madi
; /* enum hdspm_sync */
167 __u8 sync_tco
; /* enum hdspm_sync */
168 __u8 sync_in
; /* enum hdspm_sync */
169 __u8 madi_input
; /* enum hdspm_madi_input */
170 __u8 channel_format
; /* enum hdspm_madi_channel_format */
171 __u8 frame_format
; /* enum hdspm_madi_frame_format */
176 #define SNDRV_HDSPM_IOCTL_GET_STATUS \
177 _IOR('H', 0x47, struct hdspm_status)
180 * Get information about the card and its add-ons.
183 #define HDSPM_ADDON_TCO 1
185 struct hdspm_version
{
186 __u8 card_type
; /* enum hdspm_io_type */
189 unsigned short firmware_rev
;
193 #define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x48, struct hdspm_version)
195 /* ------------- get Matrix Mixer IOCTL --------------- */
197 /* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte =
201 /* organisation is 64 channelfader in a continuous memory block */
202 /* equivalent to hardware definition, maybe for future feature of mmap of
205 /* each of 64 outputs has 64 infader and 64 outfader:
206 Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */
208 #define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
210 struct hdspm_channelfader
{
211 unsigned int in
[HDSPM_MIXER_CHANNELS
];
212 unsigned int pb
[HDSPM_MIXER_CHANNELS
];
216 struct hdspm_channelfader ch
[HDSPM_MIXER_CHANNELS
];
219 struct hdspm_mixer_ioctl
{
220 struct hdspm_mixer
*mixer
;
223 /* use indirect access due to the limit of ioctl bit size */
224 #define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl)