2017-11-01 15:09:13 +01:00
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2007-07-27 16:52:46 +02:00
# ifndef __SOUND_HDSPM_H
2005-06-03 11:25:34 +02:00
# define __SOUND_HDSPM_H
/*
* Copyright ( C ) 2003 Winfried Ritsch ( IEM )
* based on hdsp . h from Thomas Charbonnel ( thomas @ undata . org )
*/
2019-12-30 22:27:42 +01:00
# ifdef __linux__
# include <linux/types.h>
# endif
2005-06-03 11:25:34 +02:00
/* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
# define HDSPM_MAX_CHANNELS 64
2011-01-26 19:32:14 +01:00
enum hdspm_io_type {
MADI ,
MADIface ,
AIO ,
AES32 ,
RayDAT
} ;
2005-06-03 11:25:34 +02:00
2011-01-26 19:32:14 +01:00
enum hdspm_speed {
ss ,
ds ,
qs
} ;
2005-06-03 11:25:34 +02:00
2011-01-26 19:32:14 +01:00
/* -------------------- IOCTL Peak/RMS Meters -------------------- */
2005-06-03 11:25:34 +02:00
2011-01-26 19:32:14 +01:00
struct hdspm_peak_rms {
2015-10-15 07:56:06 +02:00
__u32 input_peaks [ 64 ] ;
__u32 playback_peaks [ 64 ] ;
__u32 output_peaks [ 64 ] ;
2005-06-03 11:25:34 +02:00
2015-10-15 07:56:06 +02:00
__u64 input_rms [ 64 ] ;
__u64 playback_rms [ 64 ] ;
__u64 output_rms [ 64 ] ;
2005-06-03 11:25:34 +02:00
2015-10-15 07:56:06 +02:00
__u8 speed ; /* enum {ss, ds, qs} */
2011-01-26 19:32:14 +01:00
int status2 ;
2005-06-03 11:25:34 +02:00
} ;
2007-07-27 16:52:46 +02:00
# define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \
2011-01-26 19:32:14 +01:00
_IOR ( ' H ' , 0x42 , struct hdspm_peak_rms )
2005-06-03 11:25:34 +02:00
/* ------------ CONFIG block IOCTL ---------------------- */
2011-01-26 19:32:14 +01:00
struct hdspm_config {
2005-06-03 11:25:34 +02:00
unsigned char pref_sync_ref ;
unsigned char wordclock_sync_check ;
unsigned char madi_sync_check ;
unsigned int system_sample_rate ;
unsigned int autosync_sample_rate ;
unsigned char system_clock_mode ;
unsigned char clock_source ;
unsigned char autosync_ref ;
unsigned char line_out ;
unsigned int passthru ;
unsigned int analog_out ;
} ;
2011-01-26 19:32:14 +01:00
# define SNDRV_HDSPM_IOCTL_GET_CONFIG \
_IOR ( ' H ' , 0x41 , struct hdspm_config )
2014-11-10 17:24:26 +01:00
/*
2011-01-26 19:32:14 +01:00
* If there ' s a TCO ( TimeCode Option ) board installed ,
* there are further options and status data available .
* The hdspm_ltc structure contains the current SMPTE
* timecode and some status information and can be
* obtained via SNDRV_HDSPM_IOCTL_GET_LTC or in the
* hdspm_status struct .
2014-11-10 17:24:26 +01:00
*/
2011-01-26 19:32:14 +01:00
enum hdspm_ltc_format {
format_invalid ,
fps_24 ,
fps_25 ,
fps_2997 ,
fps_30
} ;
enum hdspm_ltc_frame {
frame_invalid ,
drop_frame ,
full_frame
} ;
enum hdspm_ltc_input_format {
ntsc ,
pal ,
no_video
} ;
struct hdspm_ltc {
unsigned int ltc ;
enum hdspm_ltc_format format ;
enum hdspm_ltc_frame frame ;
enum hdspm_ltc_input_format input_format ;
} ;
2013-08-19 17:20:32 +02:00
# define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_ltc)
2011-01-26 19:32:14 +01:00
2014-11-10 17:24:26 +01:00
/*
2011-01-26 19:32:14 +01:00
* The status data reflects the device ' s current state
* as determined by the card ' s configuration and
* connection status .
2014-11-10 17:24:26 +01:00
*/
2011-01-26 19:32:14 +01:00
enum hdspm_sync {
hdspm_sync_no_lock = 0 ,
hdspm_sync_lock = 1 ,
hdspm_sync_sync = 2
} ;
enum hdspm_madi_input {
hdspm_input_optical = 0 ,
hdspm_input_coax = 1
} ;
enum hdspm_madi_channel_format {
hdspm_format_ch_64 = 0 ,
hdspm_format_ch_56 = 1
} ;
enum hdspm_madi_frame_format {
hdspm_frame_48 = 0 ,
hdspm_frame_96 = 1
} ;
enum hdspm_syncsource {
syncsource_wc = 0 ,
syncsource_madi = 1 ,
syncsource_tco = 2 ,
syncsource_sync = 3 ,
syncsource_none = 4
} ;
struct hdspm_status {
2015-10-15 07:56:06 +02:00
__u8 card_type ; /* enum hdspm_io_type */
2011-01-26 19:32:14 +01:00
enum hdspm_syncsource autosync_source ;
2005-06-03 11:25:34 +02:00
2015-10-15 07:56:06 +02:00
__u64 card_clock ;
__u32 master_period ;
2011-01-26 19:32:14 +01:00
union {
struct {
2015-10-15 07:56:06 +02:00
__u8 sync_wc ; /* enum hdspm_sync */
__u8 sync_madi ; /* enum hdspm_sync */
__u8 sync_tco ; /* enum hdspm_sync */
__u8 sync_in ; /* enum hdspm_sync */
__u8 madi_input ; /* enum hdspm_madi_input */
__u8 channel_format ; /* enum hdspm_madi_channel_format */
__u8 frame_format ; /* enum hdspm_madi_frame_format */
2011-01-26 19:32:14 +01:00
} madi ;
} card_specific ;
} ;
2005-06-03 11:25:34 +02:00
2011-01-26 19:32:14 +01:00
# define SNDRV_HDSPM_IOCTL_GET_STATUS \
_IOR ( ' H ' , 0x47 , struct hdspm_status )
2014-11-10 17:24:26 +01:00
/*
2011-01-26 19:32:14 +01:00
* Get information about the card and its add - ons .
2014-11-10 17:24:26 +01:00
*/
2011-01-26 19:32:14 +01:00
# define HDSPM_ADDON_TCO 1
2005-06-03 11:25:34 +02:00
2005-11-17 14:52:34 +01:00
struct hdspm_version {
2015-10-15 07:56:06 +02:00
__u8 card_type ; /* enum hdspm_io_type */
2011-01-26 19:32:14 +01:00
char cardname [ 20 ] ;
unsigned int serial ;
2005-06-03 11:25:34 +02:00
unsigned short firmware_rev ;
2011-01-26 19:32:14 +01:00
int addons ;
2005-06-03 11:25:34 +02:00
} ;
2011-01-26 19:32:14 +01:00
# define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x48, struct hdspm_version)
2005-06-03 11:25:34 +02:00
/* ------------- get Matrix Mixer IOCTL --------------- */
2007-07-27 16:52:46 +02:00
/* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte =
* 32768 Bytes
*/
2005-06-03 11:25:34 +02:00
2011-03-30 22:57:33 -03:00
/* organisation is 64 channelfader in a continuous memory block */
2007-07-27 16:52:46 +02:00
/* equivalent to hardware definition, maybe for future feature of mmap of
* them
*/
2011-01-26 19:32:14 +01:00
/* each of 64 outputs has 64 infader and 64 outfader:
2005-06-03 11:25:34 +02:00
Ins to Outs mixer [ out ] . in [ in ] , Outstreams to Outs mixer [ out ] . pb [ pb ] */
# define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
2005-11-17 14:52:34 +01:00
struct hdspm_channelfader {
2005-06-03 11:25:34 +02:00
unsigned int in [ HDSPM_MIXER_CHANNELS ] ;
unsigned int pb [ HDSPM_MIXER_CHANNELS ] ;
} ;
2005-11-17 14:52:34 +01:00
struct hdspm_mixer {
struct hdspm_channelfader ch [ HDSPM_MIXER_CHANNELS ] ;
2005-06-03 11:25:34 +02:00
} ;
2005-11-17 14:52:34 +01:00
struct hdspm_mixer_ioctl {
struct hdspm_mixer * mixer ;
2005-06-03 11:25:34 +02:00
} ;
/* use indirect access due to the limit of ioctl bit size */
2005-11-17 14:52:34 +01:00
# define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl)
2011-01-26 19:32:14 +01:00
# endif