blob: c3c854d99c28820ffc67e0756ec82ccba73d5d7b [file] [log] [blame]
Takashi Iwai763f3562005-06-03 11:25:34 +02001#ifndef __SOUND_HDSPM_H /* -*- linux-c -*- */
2#define __SOUND_HDSPM_H
3/*
4 * Copyright (C) 2003 Winfried Ritsch (IEM)
5 * based on hdsp.h from Thomas Charbonnel (thomas@undata.org)
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23/* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
24#define HDSPM_MAX_CHANNELS 64
25
26/* -------------------- IOCTL Peak/RMS Meters -------------------- */
27
Takashi Iwai763f3562005-06-03 11:25:34 +020028/* peam rms level structure like we get from hardware
29
30 maybe in future we can memory map it so I just copy it
31 to user on ioctl call now an dont change anything
32 rms are made out of low and high values
33 where (long) ????_rms = (????_rms_l >> 8) + ((????_rms_h & 0xFFFFFF00)<<24)
34 (i asume so from the code)
35*/
36
Takashi Iwai98274f02005-11-17 14:52:34 +010037struct hdspm_peak_rms {
Takashi Iwai763f3562005-06-03 11:25:34 +020038
39 unsigned int level_offset[1024];
40
41 unsigned int input_peak[64];
42 unsigned int playback_peak[64];
43 unsigned int output_peak[64];
44 unsigned int xxx_peak[64]; /* not used */
45
46 unsigned int reserved[256]; /* not used */
47
48 unsigned int input_rms_l[64];
49 unsigned int playback_rms_l[64];
50 unsigned int output_rms_l[64];
51 unsigned int xxx_rms_l[64]; /* not used */
52
53 unsigned int input_rms_h[64];
54 unsigned int playback_rms_h[64];
55 unsigned int output_rms_h[64];
56 unsigned int xxx_rms_h[64]; /* not used */
57};
58
Takashi Iwai98274f02005-11-17 14:52:34 +010059struct hdspm_peak_rms_ioctl {
60 struct hdspm_peak_rms *peak;
Takashi Iwai763f3562005-06-03 11:25:34 +020061};
62
63/* use indirect access due to the limit of ioctl bit size */
Takashi Iwai98274f02005-11-17 14:52:34 +010064#define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct hdspm_peak_rms_ioctl)
Takashi Iwai763f3562005-06-03 11:25:34 +020065
66/* ------------ CONFIG block IOCTL ---------------------- */
67
Takashi Iwai98274f02005-11-17 14:52:34 +010068struct hdspm_config_info {
Takashi Iwai763f3562005-06-03 11:25:34 +020069 unsigned char pref_sync_ref;
70 unsigned char wordclock_sync_check;
71 unsigned char madi_sync_check;
72 unsigned int system_sample_rate;
73 unsigned int autosync_sample_rate;
74 unsigned char system_clock_mode;
75 unsigned char clock_source;
76 unsigned char autosync_ref;
77 unsigned char line_out;
78 unsigned int passthru;
79 unsigned int analog_out;
80};
81
Takashi Iwai98274f02005-11-17 14:52:34 +010082#define SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, struct hdspm_config_info)
Takashi Iwai763f3562005-06-03 11:25:34 +020083
84
85/* get Soundcard Version */
86
Takashi Iwai98274f02005-11-17 14:52:34 +010087struct hdspm_version {
Takashi Iwai763f3562005-06-03 11:25:34 +020088 unsigned short firmware_rev;
89};
90
Takashi Iwai98274f02005-11-17 14:52:34 +010091#define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdspm_version)
Takashi Iwai763f3562005-06-03 11:25:34 +020092
93
94/* ------------- get Matrix Mixer IOCTL --------------- */
95
96/* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte = 32768 Bytes */
97
98/* organisation is 64 channelfader in a continous memory block */
99/* equivalent to hardware definition, maybe for future feature of mmap of them */
100/* each of 64 outputs has 64 infader and 64 outfader:
101 Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */
102
103#define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
104
Takashi Iwai98274f02005-11-17 14:52:34 +0100105struct hdspm_channelfader {
Takashi Iwai763f3562005-06-03 11:25:34 +0200106 unsigned int in[HDSPM_MIXER_CHANNELS];
107 unsigned int pb[HDSPM_MIXER_CHANNELS];
108};
109
Takashi Iwai98274f02005-11-17 14:52:34 +0100110struct hdspm_mixer {
111 struct hdspm_channelfader ch[HDSPM_MIXER_CHANNELS];
Takashi Iwai763f3562005-06-03 11:25:34 +0200112};
113
Takashi Iwai98274f02005-11-17 14:52:34 +0100114struct hdspm_mixer_ioctl {
115 struct hdspm_mixer *mixer;
Takashi Iwai763f3562005-06-03 11:25:34 +0200116};
117
118/* use indirect access due to the limit of ioctl bit size */
Takashi Iwai98274f02005-11-17 14:52:34 +0100119#define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl)
120
121/* typedefs for compatibility to user-space */
122typedef struct hdspm_peak_rms hdspm_peak_rms_t;
123typedef struct hdspm_config_info hdspm_config_info_t;
124typedef struct hdspm_version hdspm_version_t;
125typedef struct hdspm_channelfader snd_hdspm_channelfader_t;
126typedef struct hdspm_mixer hdspm_mixer_t;
Takashi Iwai763f3562005-06-03 11:25:34 +0200127
128#endif /* __SOUND_HDSPM_H */