jpayne@69: /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ jpayne@69: #ifndef __SOUND_HDSPM_H jpayne@69: #define __SOUND_HDSPM_H jpayne@69: /* jpayne@69: * Copyright (C) 2003 Winfried Ritsch (IEM) jpayne@69: * based on hdsp.h from Thomas Charbonnel (thomas@undata.org) jpayne@69: * jpayne@69: * jpayne@69: * This program is free software; you can redistribute it and/or modify jpayne@69: * it under the terms of the GNU General Public License as published by jpayne@69: * the Free Software Foundation; either version 2 of the License, or jpayne@69: * (at your option) any later version. jpayne@69: * jpayne@69: * This program is distributed in the hope that it will be useful, jpayne@69: * but WITHOUT ANY WARRANTY; without even the implied warranty of jpayne@69: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jpayne@69: * GNU General Public License for more details. jpayne@69: * jpayne@69: * You should have received a copy of the GNU General Public License jpayne@69: * along with this program; if not, write to the Free Software jpayne@69: * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. jpayne@69: */ jpayne@69: jpayne@69: #ifdef __linux__ jpayne@69: #include jpayne@69: #endif jpayne@69: jpayne@69: /* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */ jpayne@69: #define HDSPM_MAX_CHANNELS 64 jpayne@69: jpayne@69: enum hdspm_io_type { jpayne@69: MADI, jpayne@69: MADIface, jpayne@69: AIO, jpayne@69: AES32, jpayne@69: RayDAT jpayne@69: }; jpayne@69: jpayne@69: enum hdspm_speed { jpayne@69: ss, jpayne@69: ds, jpayne@69: qs jpayne@69: }; jpayne@69: jpayne@69: /* -------------------- IOCTL Peak/RMS Meters -------------------- */ jpayne@69: jpayne@69: struct hdspm_peak_rms { jpayne@69: __u32 input_peaks[64]; jpayne@69: __u32 playback_peaks[64]; jpayne@69: __u32 output_peaks[64]; jpayne@69: jpayne@69: __u64 input_rms[64]; jpayne@69: __u64 playback_rms[64]; jpayne@69: __u64 output_rms[64]; jpayne@69: jpayne@69: __u8 speed; /* enum {ss, ds, qs} */ jpayne@69: int status2; jpayne@69: }; jpayne@69: jpayne@69: #define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \ jpayne@69: _IOR('H', 0x42, struct hdspm_peak_rms) jpayne@69: jpayne@69: /* ------------ CONFIG block IOCTL ---------------------- */ jpayne@69: jpayne@69: struct hdspm_config { jpayne@69: unsigned char pref_sync_ref; jpayne@69: unsigned char wordclock_sync_check; jpayne@69: unsigned char madi_sync_check; jpayne@69: unsigned int system_sample_rate; jpayne@69: unsigned int autosync_sample_rate; jpayne@69: unsigned char system_clock_mode; jpayne@69: unsigned char clock_source; jpayne@69: unsigned char autosync_ref; jpayne@69: unsigned char line_out; jpayne@69: unsigned int passthru; jpayne@69: unsigned int analog_out; jpayne@69: }; jpayne@69: jpayne@69: #define SNDRV_HDSPM_IOCTL_GET_CONFIG \ jpayne@69: _IOR('H', 0x41, struct hdspm_config) jpayne@69: jpayne@69: /* jpayne@69: * If there's a TCO (TimeCode Option) board installed, jpayne@69: * there are further options and status data available. jpayne@69: * The hdspm_ltc structure contains the current SMPTE jpayne@69: * timecode and some status information and can be jpayne@69: * obtained via SNDRV_HDSPM_IOCTL_GET_LTC or in the jpayne@69: * hdspm_status struct. jpayne@69: */ jpayne@69: jpayne@69: enum hdspm_ltc_format { jpayne@69: format_invalid, jpayne@69: fps_24, jpayne@69: fps_25, jpayne@69: fps_2997, jpayne@69: fps_30 jpayne@69: }; jpayne@69: jpayne@69: enum hdspm_ltc_frame { jpayne@69: frame_invalid, jpayne@69: drop_frame, jpayne@69: full_frame jpayne@69: }; jpayne@69: jpayne@69: enum hdspm_ltc_input_format { jpayne@69: ntsc, jpayne@69: pal, jpayne@69: no_video jpayne@69: }; jpayne@69: jpayne@69: struct hdspm_ltc { jpayne@69: unsigned int ltc; jpayne@69: jpayne@69: enum hdspm_ltc_format format; jpayne@69: enum hdspm_ltc_frame frame; jpayne@69: enum hdspm_ltc_input_format input_format; jpayne@69: }; jpayne@69: jpayne@69: #define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_ltc) jpayne@69: jpayne@69: /* jpayne@69: * The status data reflects the device's current state jpayne@69: * as determined by the card's configuration and jpayne@69: * connection status. jpayne@69: */ jpayne@69: jpayne@69: enum hdspm_sync { jpayne@69: hdspm_sync_no_lock = 0, jpayne@69: hdspm_sync_lock = 1, jpayne@69: hdspm_sync_sync = 2 jpayne@69: }; jpayne@69: jpayne@69: enum hdspm_madi_input { jpayne@69: hdspm_input_optical = 0, jpayne@69: hdspm_input_coax = 1 jpayne@69: }; jpayne@69: jpayne@69: enum hdspm_madi_channel_format { jpayne@69: hdspm_format_ch_64 = 0, jpayne@69: hdspm_format_ch_56 = 1 jpayne@69: }; jpayne@69: jpayne@69: enum hdspm_madi_frame_format { jpayne@69: hdspm_frame_48 = 0, jpayne@69: hdspm_frame_96 = 1 jpayne@69: }; jpayne@69: jpayne@69: enum hdspm_syncsource { jpayne@69: syncsource_wc = 0, jpayne@69: syncsource_madi = 1, jpayne@69: syncsource_tco = 2, jpayne@69: syncsource_sync = 3, jpayne@69: syncsource_none = 4 jpayne@69: }; jpayne@69: jpayne@69: struct hdspm_status { jpayne@69: __u8 card_type; /* enum hdspm_io_type */ jpayne@69: enum hdspm_syncsource autosync_source; jpayne@69: jpayne@69: __u64 card_clock; jpayne@69: __u32 master_period; jpayne@69: jpayne@69: union { jpayne@69: struct { jpayne@69: __u8 sync_wc; /* enum hdspm_sync */ jpayne@69: __u8 sync_madi; /* enum hdspm_sync */ jpayne@69: __u8 sync_tco; /* enum hdspm_sync */ jpayne@69: __u8 sync_in; /* enum hdspm_sync */ jpayne@69: __u8 madi_input; /* enum hdspm_madi_input */ jpayne@69: __u8 channel_format; /* enum hdspm_madi_channel_format */ jpayne@69: __u8 frame_format; /* enum hdspm_madi_frame_format */ jpayne@69: } madi; jpayne@69: } card_specific; jpayne@69: }; jpayne@69: jpayne@69: #define SNDRV_HDSPM_IOCTL_GET_STATUS \ jpayne@69: _IOR('H', 0x47, struct hdspm_status) jpayne@69: jpayne@69: /* jpayne@69: * Get information about the card and its add-ons. jpayne@69: */ jpayne@69: jpayne@69: #define HDSPM_ADDON_TCO 1 jpayne@69: jpayne@69: struct hdspm_version { jpayne@69: __u8 card_type; /* enum hdspm_io_type */ jpayne@69: char cardname[20]; jpayne@69: unsigned int serial; jpayne@69: unsigned short firmware_rev; jpayne@69: int addons; jpayne@69: }; jpayne@69: jpayne@69: #define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x48, struct hdspm_version) jpayne@69: jpayne@69: /* ------------- get Matrix Mixer IOCTL --------------- */ jpayne@69: jpayne@69: /* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte = jpayne@69: * 32768 Bytes jpayne@69: */ jpayne@69: jpayne@69: /* organisation is 64 channelfader in a continuous memory block */ jpayne@69: /* equivalent to hardware definition, maybe for future feature of mmap of jpayne@69: * them jpayne@69: */ jpayne@69: /* each of 64 outputs has 64 infader and 64 outfader: jpayne@69: Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */ jpayne@69: jpayne@69: #define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS jpayne@69: jpayne@69: struct hdspm_channelfader { jpayne@69: unsigned int in[HDSPM_MIXER_CHANNELS]; jpayne@69: unsigned int pb[HDSPM_MIXER_CHANNELS]; jpayne@69: }; jpayne@69: jpayne@69: struct hdspm_mixer { jpayne@69: struct hdspm_channelfader ch[HDSPM_MIXER_CHANNELS]; jpayne@69: }; jpayne@69: jpayne@69: struct hdspm_mixer_ioctl { jpayne@69: struct hdspm_mixer *mixer; jpayne@69: }; jpayne@69: jpayne@69: /* use indirect access due to the limit of ioctl bit size */ jpayne@69: #define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl) jpayne@69: jpayne@69: #endif