xref: /OK3568_Linux_fs/kernel/include/uapi/sound/hdsp.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2*4882a593Smuzhiyun #ifndef __SOUND_HDSP_H
3*4882a593Smuzhiyun #define __SOUND_HDSP_H
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun /*
6*4882a593Smuzhiyun  *   Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  *   This program is free software; you can redistribute it and/or modify
9*4882a593Smuzhiyun  *   it under the terms of the GNU General Public License as published by
10*4882a593Smuzhiyun  *   the Free Software Foundation; either version 2 of the License, or
11*4882a593Smuzhiyun  *   (at your option) any later version.
12*4882a593Smuzhiyun  *
13*4882a593Smuzhiyun  *   This program is distributed in the hope that it will be useful,
14*4882a593Smuzhiyun  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15*4882a593Smuzhiyun  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16*4882a593Smuzhiyun  *   GNU General Public License for more details.
17*4882a593Smuzhiyun  *
18*4882a593Smuzhiyun  *   You should have received a copy of the GNU General Public License
19*4882a593Smuzhiyun  *   along with this program; if not, write to the Free Software
20*4882a593Smuzhiyun  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21*4882a593Smuzhiyun  */
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun #ifdef __linux__
24*4882a593Smuzhiyun #include <linux/types.h>
25*4882a593Smuzhiyun #endif
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun #define HDSP_MATRIX_MIXER_SIZE 2048
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun enum HDSP_IO_Type {
30*4882a593Smuzhiyun 	Digiface,
31*4882a593Smuzhiyun 	Multiface,
32*4882a593Smuzhiyun 	H9652,
33*4882a593Smuzhiyun 	H9632,
34*4882a593Smuzhiyun 	RPM,
35*4882a593Smuzhiyun 	Undefined,
36*4882a593Smuzhiyun };
37*4882a593Smuzhiyun 
38*4882a593Smuzhiyun struct hdsp_peak_rms {
39*4882a593Smuzhiyun 	__u32 input_peaks[26];
40*4882a593Smuzhiyun 	__u32 playback_peaks[26];
41*4882a593Smuzhiyun 	__u32 output_peaks[28];
42*4882a593Smuzhiyun 	__u64 input_rms[26];
43*4882a593Smuzhiyun 	__u64 playback_rms[26];
44*4882a593Smuzhiyun 	/* These are only used for H96xx cards */
45*4882a593Smuzhiyun 	__u64 output_rms[26];
46*4882a593Smuzhiyun };
47*4882a593Smuzhiyun 
48*4882a593Smuzhiyun #define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct hdsp_peak_rms)
49*4882a593Smuzhiyun 
50*4882a593Smuzhiyun struct hdsp_config_info {
51*4882a593Smuzhiyun 	unsigned char pref_sync_ref;
52*4882a593Smuzhiyun 	unsigned char wordclock_sync_check;
53*4882a593Smuzhiyun 	unsigned char spdif_sync_check;
54*4882a593Smuzhiyun 	unsigned char adatsync_sync_check;
55*4882a593Smuzhiyun 	unsigned char adat_sync_check[3];
56*4882a593Smuzhiyun 	unsigned char spdif_in;
57*4882a593Smuzhiyun 	unsigned char spdif_out;
58*4882a593Smuzhiyun 	unsigned char spdif_professional;
59*4882a593Smuzhiyun 	unsigned char spdif_emphasis;
60*4882a593Smuzhiyun 	unsigned char spdif_nonaudio;
61*4882a593Smuzhiyun 	unsigned int spdif_sample_rate;
62*4882a593Smuzhiyun 	unsigned int system_sample_rate;
63*4882a593Smuzhiyun 	unsigned int autosync_sample_rate;
64*4882a593Smuzhiyun 	unsigned char system_clock_mode;
65*4882a593Smuzhiyun 	unsigned char clock_source;
66*4882a593Smuzhiyun 	unsigned char autosync_ref;
67*4882a593Smuzhiyun 	unsigned char line_out;
68*4882a593Smuzhiyun 	unsigned char passthru;
69*4882a593Smuzhiyun 	unsigned char da_gain;
70*4882a593Smuzhiyun 	unsigned char ad_gain;
71*4882a593Smuzhiyun 	unsigned char phone_gain;
72*4882a593Smuzhiyun 	unsigned char xlr_breakout_cable;
73*4882a593Smuzhiyun 	unsigned char analog_extension_board;
74*4882a593Smuzhiyun };
75*4882a593Smuzhiyun 
76*4882a593Smuzhiyun #define SNDRV_HDSP_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, struct hdsp_config_info)
77*4882a593Smuzhiyun 
78*4882a593Smuzhiyun struct hdsp_firmware {
79*4882a593Smuzhiyun 	void *firmware_data;	/* 24413 x 4 bytes */
80*4882a593Smuzhiyun };
81*4882a593Smuzhiyun 
82*4882a593Smuzhiyun #define SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE _IOW('H', 0x42, struct hdsp_firmware)
83*4882a593Smuzhiyun 
84*4882a593Smuzhiyun struct hdsp_version {
85*4882a593Smuzhiyun 	enum HDSP_IO_Type io_type;
86*4882a593Smuzhiyun 	unsigned short firmware_rev;
87*4882a593Smuzhiyun };
88*4882a593Smuzhiyun 
89*4882a593Smuzhiyun #define SNDRV_HDSP_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdsp_version)
90*4882a593Smuzhiyun 
91*4882a593Smuzhiyun struct hdsp_mixer {
92*4882a593Smuzhiyun 	unsigned short matrix[HDSP_MATRIX_MIXER_SIZE];
93*4882a593Smuzhiyun };
94*4882a593Smuzhiyun 
95*4882a593Smuzhiyun #define SNDRV_HDSP_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdsp_mixer)
96*4882a593Smuzhiyun 
97*4882a593Smuzhiyun struct hdsp_9632_aeb {
98*4882a593Smuzhiyun 	int aebi;
99*4882a593Smuzhiyun 	int aebo;
100*4882a593Smuzhiyun };
101*4882a593Smuzhiyun 
102*4882a593Smuzhiyun #define SNDRV_HDSP_IOCTL_GET_9632_AEB _IOR('H', 0x45, struct hdsp_9632_aeb)
103*4882a593Smuzhiyun 
104*4882a593Smuzhiyun #endif /* __SOUND_HDSP_H */
105