xref: /openbmc/linux/include/uapi/sound/hdsp.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2674e95caSDavid Howells #ifndef __SOUND_HDSP_H
3674e95caSDavid Howells #define __SOUND_HDSP_H
4674e95caSDavid Howells 
5674e95caSDavid Howells /*
6674e95caSDavid Howells  *   Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
7674e95caSDavid Howells  */
8674e95caSDavid Howells 
9*d06ed0c2STakashi Iwai #ifdef __linux__
10*d06ed0c2STakashi Iwai #include <linux/types.h>
11*d06ed0c2STakashi Iwai #endif
12*d06ed0c2STakashi Iwai 
13674e95caSDavid Howells #define HDSP_MATRIX_MIXER_SIZE 2048
14674e95caSDavid Howells 
15674e95caSDavid Howells enum HDSP_IO_Type {
16674e95caSDavid Howells 	Digiface,
17674e95caSDavid Howells 	Multiface,
18674e95caSDavid Howells 	H9652,
19674e95caSDavid Howells 	H9632,
20674e95caSDavid Howells 	RPM,
21674e95caSDavid Howells 	Undefined,
22674e95caSDavid Howells };
23674e95caSDavid Howells 
24674e95caSDavid Howells struct hdsp_peak_rms {
25674e95caSDavid Howells 	__u32 input_peaks[26];
26674e95caSDavid Howells 	__u32 playback_peaks[26];
27674e95caSDavid Howells 	__u32 output_peaks[28];
28674e95caSDavid Howells 	__u64 input_rms[26];
29674e95caSDavid Howells 	__u64 playback_rms[26];
30674e95caSDavid Howells 	/* These are only used for H96xx cards */
31674e95caSDavid Howells 	__u64 output_rms[26];
32674e95caSDavid Howells };
33674e95caSDavid Howells 
34674e95caSDavid Howells #define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct hdsp_peak_rms)
35674e95caSDavid Howells 
36674e95caSDavid Howells struct hdsp_config_info {
37674e95caSDavid Howells 	unsigned char pref_sync_ref;
38674e95caSDavid Howells 	unsigned char wordclock_sync_check;
39674e95caSDavid Howells 	unsigned char spdif_sync_check;
40674e95caSDavid Howells 	unsigned char adatsync_sync_check;
41674e95caSDavid Howells 	unsigned char adat_sync_check[3];
42674e95caSDavid Howells 	unsigned char spdif_in;
43674e95caSDavid Howells 	unsigned char spdif_out;
44674e95caSDavid Howells 	unsigned char spdif_professional;
45674e95caSDavid Howells 	unsigned char spdif_emphasis;
46674e95caSDavid Howells 	unsigned char spdif_nonaudio;
47674e95caSDavid Howells 	unsigned int spdif_sample_rate;
48674e95caSDavid Howells 	unsigned int system_sample_rate;
49674e95caSDavid Howells 	unsigned int autosync_sample_rate;
50674e95caSDavid Howells 	unsigned char system_clock_mode;
51674e95caSDavid Howells 	unsigned char clock_source;
52674e95caSDavid Howells 	unsigned char autosync_ref;
53674e95caSDavid Howells 	unsigned char line_out;
54674e95caSDavid Howells 	unsigned char passthru;
55674e95caSDavid Howells 	unsigned char da_gain;
56674e95caSDavid Howells 	unsigned char ad_gain;
57674e95caSDavid Howells 	unsigned char phone_gain;
58674e95caSDavid Howells 	unsigned char xlr_breakout_cable;
59674e95caSDavid Howells 	unsigned char analog_extension_board;
60674e95caSDavid Howells };
61674e95caSDavid Howells 
62674e95caSDavid Howells #define SNDRV_HDSP_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, struct hdsp_config_info)
63674e95caSDavid Howells 
64674e95caSDavid Howells struct hdsp_firmware {
65d63e63d4STakashi Iwai 	void *firmware_data;	/* 24413 x 4 bytes */
66674e95caSDavid Howells };
67674e95caSDavid Howells 
68674e95caSDavid Howells #define SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE _IOW('H', 0x42, struct hdsp_firmware)
69674e95caSDavid Howells 
70674e95caSDavid Howells struct hdsp_version {
71674e95caSDavid Howells 	enum HDSP_IO_Type io_type;
72674e95caSDavid Howells 	unsigned short firmware_rev;
73674e95caSDavid Howells };
74674e95caSDavid Howells 
75674e95caSDavid Howells #define SNDRV_HDSP_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdsp_version)
76674e95caSDavid Howells 
77674e95caSDavid Howells struct hdsp_mixer {
78674e95caSDavid Howells 	unsigned short matrix[HDSP_MATRIX_MIXER_SIZE];
79674e95caSDavid Howells };
80674e95caSDavid Howells 
81674e95caSDavid Howells #define SNDRV_HDSP_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdsp_mixer)
82674e95caSDavid Howells 
83674e95caSDavid Howells struct hdsp_9632_aeb {
84674e95caSDavid Howells 	int aebi;
85674e95caSDavid Howells 	int aebo;
86674e95caSDavid Howells };
87674e95caSDavid Howells 
88674e95caSDavid Howells #define SNDRV_HDSP_IOCTL_GET_9632_AEB _IOR('H', 0x45, struct hdsp_9632_aeb)
89674e95caSDavid Howells 
90674e95caSDavid Howells #endif /* __SOUND_HDSP_H */
91