2007-07-27 18:52:46 +04:00
# ifndef __SOUND_HDSPM_H
2005-06-03 13:25:34 +04:00
# define __SOUND_HDSPM_H
/*
* Copyright ( C ) 2003 Winfried Ritsch ( IEM )
* based on hdsp . h from Thomas Charbonnel ( thomas @ undata . org )
*
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 675 Mass Ave , Cambridge , MA 0213 9 , USA .
*/
/* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
# define HDSPM_MAX_CHANNELS 64
/* -------------------- IOCTL Peak/RMS Meters -------------------- */
/* peam rms level structure like we get from hardware
maybe in future we can memory map it so I just copy it
to user on ioctl call now an dont change anything
rms are made out of low and high values
where ( long ) ? ? ? ? _rms = ( ? ? ? ? _rms_l > > 8 ) + ( ( ? ? ? ? _rms_h & 0xFFFFFF00 ) < < 24 )
( i asume so from the code )
*/
2005-11-17 16:52:34 +03:00
struct hdspm_peak_rms {
2005-06-03 13:25:34 +04:00
unsigned int level_offset [ 1024 ] ;
unsigned int input_peak [ 64 ] ;
unsigned int playback_peak [ 64 ] ;
unsigned int output_peak [ 64 ] ;
unsigned int xxx_peak [ 64 ] ; /* not used */
unsigned int reserved [ 256 ] ; /* not used */
unsigned int input_rms_l [ 64 ] ;
unsigned int playback_rms_l [ 64 ] ;
unsigned int output_rms_l [ 64 ] ;
unsigned int xxx_rms_l [ 64 ] ; /* not used */
unsigned int input_rms_h [ 64 ] ;
unsigned int playback_rms_h [ 64 ] ;
unsigned int output_rms_h [ 64 ] ;
unsigned int xxx_rms_h [ 64 ] ; /* not used */
} ;
2005-11-17 16:52:34 +03:00
struct hdspm_peak_rms_ioctl {
struct hdspm_peak_rms * peak ;
2005-06-03 13:25:34 +04:00
} ;
/* use indirect access due to the limit of ioctl bit size */
2007-07-27 18:52:46 +04:00
# define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \
_IOR ( ' H ' , 0x40 , struct hdspm_peak_rms_ioctl )
2005-06-03 13:25:34 +04:00
/* ------------ CONFIG block IOCTL ---------------------- */
2005-11-17 16:52:34 +03:00
struct hdspm_config_info {
2005-06-03 13:25:34 +04: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 ;
} ;
2007-07-27 18:52:46 +04:00
# define SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO \
_IOR ( ' H ' , 0x41 , struct hdspm_config_info )
2005-06-03 13:25:34 +04:00
/* get Soundcard Version */
2005-11-17 16:52:34 +03:00
struct hdspm_version {
2005-06-03 13:25:34 +04:00
unsigned short firmware_rev ;
} ;
2005-11-17 16:52:34 +03:00
# define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdspm_version)
2005-06-03 13:25:34 +04:00
/* ------------- get Matrix Mixer IOCTL --------------- */
2007-07-27 18:52:46 +04:00
/* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte =
* 32768 Bytes
*/
2005-06-03 13:25:34 +04:00
/* organisation is 64 channelfader in a continous memory block */
2007-07-27 18:52:46 +04:00
/* equivalent to hardware definition, maybe for future feature of mmap of
* them
*/
2005-06-03 13:25:34 +04:00
/* each of 64 outputs has 64 infader and 64 outfader:
Ins to Outs mixer [ out ] . in [ in ] , Outstreams to Outs mixer [ out ] . pb [ pb ] */
# define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
2005-11-17 16:52:34 +03:00
struct hdspm_channelfader {
2005-06-03 13:25:34 +04:00
unsigned int in [ HDSPM_MIXER_CHANNELS ] ;
unsigned int pb [ HDSPM_MIXER_CHANNELS ] ;
} ;
2005-11-17 16:52:34 +03:00
struct hdspm_mixer {
struct hdspm_channelfader ch [ HDSPM_MIXER_CHANNELS ] ;
2005-06-03 13:25:34 +04:00
} ;
2005-11-17 16:52:34 +03:00
struct hdspm_mixer_ioctl {
struct hdspm_mixer * mixer ;
2005-06-03 13:25:34 +04:00
} ;
/* use indirect access due to the limit of ioctl bit size */
2005-11-17 16:52:34 +03:00
# define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl)
/* typedefs for compatibility to user-space */
typedef struct hdspm_peak_rms hdspm_peak_rms_t ;
typedef struct hdspm_config_info hdspm_config_info_t ;
typedef struct hdspm_version hdspm_version_t ;
typedef struct hdspm_channelfader snd_hdspm_channelfader_t ;
typedef struct hdspm_mixer hdspm_mixer_t ;
2005-06-03 13:25:34 +04:00
# endif /* __SOUND_HDSPM_H */