18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ 28c2ecf20Sopenharmony_ci#ifndef __SOUND_HDSP_H 38c2ecf20Sopenharmony_ci#define __SOUND_HDSP_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci/* 68c2ecf20Sopenharmony_ci * Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org) 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or modify 98c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License as published by 108c2ecf20Sopenharmony_ci * the Free Software Foundation; either version 2 of the License, or 118c2ecf20Sopenharmony_ci * (at your option) any later version. 128c2ecf20Sopenharmony_ci * 138c2ecf20Sopenharmony_ci * This program is distributed in the hope that it will be useful, 148c2ecf20Sopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of 158c2ecf20Sopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 168c2ecf20Sopenharmony_ci * GNU General Public License for more details. 178c2ecf20Sopenharmony_ci * 188c2ecf20Sopenharmony_ci * You should have received a copy of the GNU General Public License 198c2ecf20Sopenharmony_ci * along with this program; if not, write to the Free Software 208c2ecf20Sopenharmony_ci * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 218c2ecf20Sopenharmony_ci */ 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci#ifdef __linux__ 248c2ecf20Sopenharmony_ci#include <linux/types.h> 258c2ecf20Sopenharmony_ci#endif 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci#define HDSP_MATRIX_MIXER_SIZE 2048 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_cienum HDSP_IO_Type { 308c2ecf20Sopenharmony_ci Digiface, 318c2ecf20Sopenharmony_ci Multiface, 328c2ecf20Sopenharmony_ci H9652, 338c2ecf20Sopenharmony_ci H9632, 348c2ecf20Sopenharmony_ci RPM, 358c2ecf20Sopenharmony_ci Undefined, 368c2ecf20Sopenharmony_ci}; 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_cistruct hdsp_peak_rms { 398c2ecf20Sopenharmony_ci __u32 input_peaks[26]; 408c2ecf20Sopenharmony_ci __u32 playback_peaks[26]; 418c2ecf20Sopenharmony_ci __u32 output_peaks[28]; 428c2ecf20Sopenharmony_ci __u64 input_rms[26]; 438c2ecf20Sopenharmony_ci __u64 playback_rms[26]; 448c2ecf20Sopenharmony_ci /* These are only used for H96xx cards */ 458c2ecf20Sopenharmony_ci __u64 output_rms[26]; 468c2ecf20Sopenharmony_ci}; 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ci#define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct hdsp_peak_rms) 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_cistruct hdsp_config_info { 518c2ecf20Sopenharmony_ci unsigned char pref_sync_ref; 528c2ecf20Sopenharmony_ci unsigned char wordclock_sync_check; 538c2ecf20Sopenharmony_ci unsigned char spdif_sync_check; 548c2ecf20Sopenharmony_ci unsigned char adatsync_sync_check; 558c2ecf20Sopenharmony_ci unsigned char adat_sync_check[3]; 568c2ecf20Sopenharmony_ci unsigned char spdif_in; 578c2ecf20Sopenharmony_ci unsigned char spdif_out; 588c2ecf20Sopenharmony_ci unsigned char spdif_professional; 598c2ecf20Sopenharmony_ci unsigned char spdif_emphasis; 608c2ecf20Sopenharmony_ci unsigned char spdif_nonaudio; 618c2ecf20Sopenharmony_ci unsigned int spdif_sample_rate; 628c2ecf20Sopenharmony_ci unsigned int system_sample_rate; 638c2ecf20Sopenharmony_ci unsigned int autosync_sample_rate; 648c2ecf20Sopenharmony_ci unsigned char system_clock_mode; 658c2ecf20Sopenharmony_ci unsigned char clock_source; 668c2ecf20Sopenharmony_ci unsigned char autosync_ref; 678c2ecf20Sopenharmony_ci unsigned char line_out; 688c2ecf20Sopenharmony_ci unsigned char passthru; 698c2ecf20Sopenharmony_ci unsigned char da_gain; 708c2ecf20Sopenharmony_ci unsigned char ad_gain; 718c2ecf20Sopenharmony_ci unsigned char phone_gain; 728c2ecf20Sopenharmony_ci unsigned char xlr_breakout_cable; 738c2ecf20Sopenharmony_ci unsigned char analog_extension_board; 748c2ecf20Sopenharmony_ci}; 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_ci#define SNDRV_HDSP_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, struct hdsp_config_info) 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_cistruct hdsp_firmware { 798c2ecf20Sopenharmony_ci void *firmware_data; /* 24413 x 4 bytes */ 808c2ecf20Sopenharmony_ci}; 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_ci#define SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE _IOW('H', 0x42, struct hdsp_firmware) 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_cistruct hdsp_version { 858c2ecf20Sopenharmony_ci enum HDSP_IO_Type io_type; 868c2ecf20Sopenharmony_ci unsigned short firmware_rev; 878c2ecf20Sopenharmony_ci}; 888c2ecf20Sopenharmony_ci 898c2ecf20Sopenharmony_ci#define SNDRV_HDSP_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdsp_version) 908c2ecf20Sopenharmony_ci 918c2ecf20Sopenharmony_cistruct hdsp_mixer { 928c2ecf20Sopenharmony_ci unsigned short matrix[HDSP_MATRIX_MIXER_SIZE]; 938c2ecf20Sopenharmony_ci}; 948c2ecf20Sopenharmony_ci 958c2ecf20Sopenharmony_ci#define SNDRV_HDSP_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdsp_mixer) 968c2ecf20Sopenharmony_ci 978c2ecf20Sopenharmony_cistruct hdsp_9632_aeb { 988c2ecf20Sopenharmony_ci int aebi; 998c2ecf20Sopenharmony_ci int aebo; 1008c2ecf20Sopenharmony_ci}; 1018c2ecf20Sopenharmony_ci 1028c2ecf20Sopenharmony_ci#define SNDRV_HDSP_IOCTL_GET_9632_AEB _IOR('H', 0x45, struct hdsp_9632_aeb) 1038c2ecf20Sopenharmony_ci 1048c2ecf20Sopenharmony_ci#endif /* __SOUND_HDSP_H */ 105