#ifndef __SOUND_HDSPM_H1#define __SOUND_HDSPM_H2/*3* Copyright (C) 2003 Winfried Ritsch (IEM)4* based on hdsp.h from Thomas Charbonnel ([email protected])5*6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License as published by9* the Free Software Foundation; either version 2 of the License, or10* (at your option) any later version.11*12* This program is distributed in the hope that it will be useful,13* but WITHOUT ANY WARRANTY; without even the implied warranty of14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15* GNU General Public License for more details.16*17* You should have received a copy of the GNU General Public License18* along with this program; if not, write to the Free Software19* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.20*/2122/* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */23#define HDSPM_MAX_CHANNELS 642425enum hdspm_io_type {26MADI,27MADIface,28AIO,29AES32,30RayDAT31};3233enum hdspm_speed {34ss,35ds,36qs37};3839/* -------------------- IOCTL Peak/RMS Meters -------------------- */4041struct hdspm_peak_rms {42uint32_t input_peaks[64];43uint32_t playback_peaks[64];44uint32_t output_peaks[64];4546uint64_t input_rms[64];47uint64_t playback_rms[64];48uint64_t output_rms[64];4950uint8_t speed; /* enum {ss, ds, qs} */51int status2;52};5354#define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \55_IOR('H', 0x42, struct hdspm_peak_rms)5657/* ------------ CONFIG block IOCTL ---------------------- */5859struct hdspm_config {60unsigned char pref_sync_ref;61unsigned char wordclock_sync_check;62unsigned char madi_sync_check;63unsigned int system_sample_rate;64unsigned int autosync_sample_rate;65unsigned char system_clock_mode;66unsigned char clock_source;67unsigned char autosync_ref;68unsigned char line_out;69unsigned int passthru;70unsigned int analog_out;71};7273#define SNDRV_HDSPM_IOCTL_GET_CONFIG \74_IOR('H', 0x41, struct hdspm_config)7576/**77* If there's a TCO (TimeCode Option) board installed,78* there are further options and status data available.79* The hdspm_ltc structure contains the current SMPTE80* timecode and some status information and can be81* obtained via SNDRV_HDSPM_IOCTL_GET_LTC or in the82* hdspm_status struct.83**/8485enum hdspm_ltc_format {86format_invalid,87fps_24,88fps_25,89fps_2997,90fps_3091};9293enum hdspm_ltc_frame {94frame_invalid,95drop_frame,96full_frame97};9899enum hdspm_ltc_input_format {100ntsc,101pal,102no_video103};104105struct hdspm_ltc {106unsigned int ltc;107108enum hdspm_ltc_format format;109enum hdspm_ltc_frame frame;110enum hdspm_ltc_input_format input_format;111};112113#define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_mixer_ioctl)114115/**116* The status data reflects the device's current state117* as determined by the card's configuration and118* connection status.119**/120121enum hdspm_sync {122hdspm_sync_no_lock = 0,123hdspm_sync_lock = 1,124hdspm_sync_sync = 2125};126127enum hdspm_madi_input {128hdspm_input_optical = 0,129hdspm_input_coax = 1130};131132enum hdspm_madi_channel_format {133hdspm_format_ch_64 = 0,134hdspm_format_ch_56 = 1135};136137enum hdspm_madi_frame_format {138hdspm_frame_48 = 0,139hdspm_frame_96 = 1140};141142enum hdspm_syncsource {143syncsource_wc = 0,144syncsource_madi = 1,145syncsource_tco = 2,146syncsource_sync = 3,147syncsource_none = 4148};149150struct hdspm_status {151uint8_t card_type; /* enum hdspm_io_type */152enum hdspm_syncsource autosync_source;153154uint64_t card_clock;155uint32_t master_period;156157union {158struct {159uint8_t sync_wc; /* enum hdspm_sync */160uint8_t sync_madi; /* enum hdspm_sync */161uint8_t sync_tco; /* enum hdspm_sync */162uint8_t sync_in; /* enum hdspm_sync */163uint8_t madi_input; /* enum hdspm_madi_input */164uint8_t channel_format; /* enum hdspm_madi_channel_format */165uint8_t frame_format; /* enum hdspm_madi_frame_format */166} madi;167} card_specific;168};169170#define SNDRV_HDSPM_IOCTL_GET_STATUS \171_IOR('H', 0x47, struct hdspm_status)172173/**174* Get information about the card and its add-ons.175**/176177#define HDSPM_ADDON_TCO 1178179struct hdspm_version {180uint8_t card_type; /* enum hdspm_io_type */181char cardname[20];182unsigned int serial;183unsigned short firmware_rev;184int addons;185};186187#define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x48, struct hdspm_version)188189/* ------------- get Matrix Mixer IOCTL --------------- */190191/* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte =192* 32768 Bytes193*/194195/* organisation is 64 channelfader in a continuous memory block */196/* equivalent to hardware definition, maybe for future feature of mmap of197* them198*/199/* each of 64 outputs has 64 infader and 64 outfader:200Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */201202#define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS203204struct hdspm_channelfader {205unsigned int in[HDSPM_MIXER_CHANNELS];206unsigned int pb[HDSPM_MIXER_CHANNELS];207};208209struct hdspm_mixer {210struct hdspm_channelfader ch[HDSPM_MIXER_CHANNELS];211};212213struct hdspm_mixer_ioctl {214struct hdspm_mixer *mixer;215};216217/* use indirect access due to the limit of ioctl bit size */218#define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl)219220/* typedefs for compatibility to user-space */221typedef struct hdspm_peak_rms hdspm_peak_rms_t;222typedef struct hdspm_config_info hdspm_config_info_t;223typedef struct hdspm_version hdspm_version_t;224typedef struct hdspm_channelfader snd_hdspm_channelfader_t;225typedef struct hdspm_mixer hdspm_mixer_t;226227228#endif229230231