[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (1/9)
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / include / sound / hdspm.h
blobc34427ccd0b3730b6eee5bc9630f864eb01feee7
1 #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.
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.
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.
23 /* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
24 #define HDSPM_MAX_CHANNELS 64
26 /* -------------------- IOCTL Peak/RMS Meters -------------------- */
28 typedef struct _snd_hdspm_peak_rms hdspm_peak_rms_t;
30 /* peam rms level structure like we get from hardware
32 maybe in future we can memory map it so I just copy it
33 to user on ioctl call now an dont change anything
34 rms are made out of low and high values
35 where (long) ????_rms = (????_rms_l >> 8) + ((????_rms_h & 0xFFFFFF00)<<24)
36 (i asume so from the code)
39 struct _snd_hdspm_peak_rms {
41 unsigned int level_offset[1024];
43 unsigned int input_peak[64];
44 unsigned int playback_peak[64];
45 unsigned int output_peak[64];
46 unsigned int xxx_peak[64]; /* not used */
48 unsigned int reserved[256]; /* not used */
50 unsigned int input_rms_l[64];
51 unsigned int playback_rms_l[64];
52 unsigned int output_rms_l[64];
53 unsigned int xxx_rms_l[64]; /* not used */
55 unsigned int input_rms_h[64];
56 unsigned int playback_rms_h[64];
57 unsigned int output_rms_h[64];
58 unsigned int xxx_rms_h[64]; /* not used */
61 struct sndrv_hdspm_peak_rms_ioctl {
62 hdspm_peak_rms_t *peak;
65 /* use indirect access due to the limit of ioctl bit size */
66 #define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct sndrv_hdspm_peak_rms_ioctl)
68 /* ------------ CONFIG block IOCTL ---------------------- */
70 typedef struct _snd_hdspm_config_info hdspm_config_info_t;
72 struct _snd_hdspm_config_info {
73 unsigned char pref_sync_ref;
74 unsigned char wordclock_sync_check;
75 unsigned char madi_sync_check;
76 unsigned int system_sample_rate;
77 unsigned int autosync_sample_rate;
78 unsigned char system_clock_mode;
79 unsigned char clock_source;
80 unsigned char autosync_ref;
81 unsigned char line_out;
82 unsigned int passthru;
83 unsigned int analog_out;
86 #define SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, hdspm_config_info_t)
89 /* get Soundcard Version */
91 typedef struct _snd_hdspm_version hdspm_version_t;
93 struct _snd_hdspm_version {
94 unsigned short firmware_rev;
97 #define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x43, hdspm_version_t)
100 /* ------------- get Matrix Mixer IOCTL --------------- */
102 /* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte = 32768 Bytes */
104 /* organisation is 64 channelfader in a continous memory block */
105 /* equivalent to hardware definition, maybe for future feature of mmap of them */
106 /* each of 64 outputs has 64 infader and 64 outfader:
107 Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */
109 #define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
111 typedef struct _snd_hdspm_channelfader snd_hdspm_channelfader_t;
113 struct _snd_hdspm_channelfader {
114 unsigned int in[HDSPM_MIXER_CHANNELS];
115 unsigned int pb[HDSPM_MIXER_CHANNELS];
118 typedef struct _snd_hdspm_mixer hdspm_mixer_t;
120 struct _snd_hdspm_mixer {
121 snd_hdspm_channelfader_t ch[HDSPM_MIXER_CHANNELS];
124 struct sndrv_hdspm_mixer_ioctl {
125 hdspm_mixer_t *mixer;
128 /* use indirect access due to the limit of ioctl bit size */
129 #define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct sndrv_hdspm_mixer_ioctl)
131 #endif /* __SOUND_HDSPM_H */