blob: 0909a3843479222aebc4edcfb6930644366229fd [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __SOUND_HDSP_H
2#define __SOUND_HDSP_H
3
4/*
5 * Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (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 of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
Jaswinder Singh Rajputbb9f1132009-01-30 22:33:29 +053022#include <linux/types.h>
23
Linus Torvalds1da177e2005-04-16 15:20:36 -070024#define HDSP_MATRIX_MIXER_SIZE 2048
25
Takashi Iwai55e957d2005-11-17 14:52:13 +010026enum HDSP_IO_Type {
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 Digiface,
28 Multiface,
29 H9652,
30 H9632,
Florian Faber28b26e12010-12-01 12:14:47 +010031 RPM,
Linus Torvalds1da177e2005-04-16 15:20:36 -070032 Undefined,
Takashi Iwai55e957d2005-11-17 14:52:13 +010033};
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
Takashi Iwai55e957d2005-11-17 14:52:13 +010035struct hdsp_peak_rms {
David Woodhouse888855d2006-05-04 00:42:42 +010036 __u32 input_peaks[26];
37 __u32 playback_peaks[26];
38 __u32 output_peaks[28];
39 __u64 input_rms[26];
40 __u64 playback_rms[26];
Linus Torvalds1da177e2005-04-16 15:20:36 -070041 /* These are only used for H96xx cards */
David Woodhouse888855d2006-05-04 00:42:42 +010042 __u64 output_rms[26];
Linus Torvalds1da177e2005-04-16 15:20:36 -070043};
44
Takashi Iwai55e957d2005-11-17 14:52:13 +010045#define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct hdsp_peak_rms)
Linus Torvalds1da177e2005-04-16 15:20:36 -070046
Takashi Iwai55e957d2005-11-17 14:52:13 +010047struct hdsp_config_info {
Linus Torvalds1da177e2005-04-16 15:20:36 -070048 unsigned char pref_sync_ref;
49 unsigned char wordclock_sync_check;
50 unsigned char spdif_sync_check;
51 unsigned char adatsync_sync_check;
52 unsigned char adat_sync_check[3];
53 unsigned char spdif_in;
54 unsigned char spdif_out;
55 unsigned char spdif_professional;
56 unsigned char spdif_emphasis;
57 unsigned char spdif_nonaudio;
58 unsigned int spdif_sample_rate;
59 unsigned int system_sample_rate;
60 unsigned int autosync_sample_rate;
61 unsigned char system_clock_mode;
62 unsigned char clock_source;
63 unsigned char autosync_ref;
64 unsigned char line_out;
65 unsigned char passthru;
66 unsigned char da_gain;
67 unsigned char ad_gain;
68 unsigned char phone_gain;
69 unsigned char xlr_breakout_cable;
70 unsigned char analog_extension_board;
71};
72
Takashi Iwai55e957d2005-11-17 14:52:13 +010073#define SNDRV_HDSP_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, struct hdsp_config_info)
Linus Torvalds1da177e2005-04-16 15:20:36 -070074
Takashi Iwai55e957d2005-11-17 14:52:13 +010075struct hdsp_firmware {
Linus Torvalds1da177e2005-04-16 15:20:36 -070076 void __user *firmware_data; /* 24413 x 4 bytes */
77};
78
Takashi Iwai55e957d2005-11-17 14:52:13 +010079#define SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE _IOW('H', 0x42, struct hdsp_firmware)
Linus Torvalds1da177e2005-04-16 15:20:36 -070080
Takashi Iwai55e957d2005-11-17 14:52:13 +010081struct hdsp_version {
82 enum HDSP_IO_Type io_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -070083 unsigned short firmware_rev;
84};
85
Takashi Iwai55e957d2005-11-17 14:52:13 +010086#define SNDRV_HDSP_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdsp_version)
Linus Torvalds1da177e2005-04-16 15:20:36 -070087
Takashi Iwai55e957d2005-11-17 14:52:13 +010088struct hdsp_mixer {
Linus Torvalds1da177e2005-04-16 15:20:36 -070089 unsigned short matrix[HDSP_MATRIX_MIXER_SIZE];
90};
91
Takashi Iwai55e957d2005-11-17 14:52:13 +010092#define SNDRV_HDSP_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdsp_mixer)
Linus Torvalds1da177e2005-04-16 15:20:36 -070093
Takashi Iwai55e957d2005-11-17 14:52:13 +010094struct hdsp_9632_aeb {
Linus Torvalds1da177e2005-04-16 15:20:36 -070095 int aebi;
96 int aebo;
97};
98
Takashi Iwai55e957d2005-11-17 14:52:13 +010099#define SNDRV_HDSP_IOCTL_GET_9632_AEB _IOR('H', 0x45, struct hdsp_9632_aeb)
100
101/* typedefs for compatibility to user-space */
102typedef enum HDSP_IO_Type HDSP_IO_Type;
103typedef struct hdsp_peak_rms hdsp_peak_rms_t;
104typedef struct hdsp_config_info hdsp_config_info_t;
105typedef struct hdsp_firmware hdsp_firmware_t;
106typedef struct hdsp_version hdsp_version_t;
107typedef struct hdsp_mixer hdsp_mixer_t;
108typedef struct hdsp_9632_aeb hdsp_9632_aeb_t;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700109
110#endif /* __SOUND_HDSP_H */