hdsp.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2. #ifndef __SOUND_HDSP_H
  3. #define __SOUND_HDSP_H
  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. #include <linux/types.h>
  22. #define HDSP_MATRIX_MIXER_SIZE 2048
  23. enum HDSP_IO_Type {
  24. Digiface,
  25. Multiface,
  26. H9652,
  27. H9632,
  28. RPM,
  29. Undefined,
  30. };
  31. struct hdsp_peak_rms {
  32. __u32 input_peaks[26];
  33. __u32 playback_peaks[26];
  34. __u32 output_peaks[28];
  35. __u64 input_rms[26];
  36. __u64 playback_rms[26];
  37. /* These are only used for H96xx cards */
  38. __u64 output_rms[26];
  39. };
  40. #define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct hdsp_peak_rms)
  41. struct hdsp_config_info {
  42. unsigned char pref_sync_ref;
  43. unsigned char wordclock_sync_check;
  44. unsigned char spdif_sync_check;
  45. unsigned char adatsync_sync_check;
  46. unsigned char adat_sync_check[3];
  47. unsigned char spdif_in;
  48. unsigned char spdif_out;
  49. unsigned char spdif_professional;
  50. unsigned char spdif_emphasis;
  51. unsigned char spdif_nonaudio;
  52. unsigned int spdif_sample_rate;
  53. unsigned int system_sample_rate;
  54. unsigned int autosync_sample_rate;
  55. unsigned char system_clock_mode;
  56. unsigned char clock_source;
  57. unsigned char autosync_ref;
  58. unsigned char line_out;
  59. unsigned char passthru;
  60. unsigned char da_gain;
  61. unsigned char ad_gain;
  62. unsigned char phone_gain;
  63. unsigned char xlr_breakout_cable;
  64. unsigned char analog_extension_board;
  65. };
  66. #define SNDRV_HDSP_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, struct hdsp_config_info)
  67. struct hdsp_firmware {
  68. void *firmware_data; /* 24413 x 4 bytes */
  69. };
  70. #define SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE _IOW('H', 0x42, struct hdsp_firmware)
  71. struct hdsp_version {
  72. enum HDSP_IO_Type io_type;
  73. unsigned short firmware_rev;
  74. };
  75. #define SNDRV_HDSP_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdsp_version)
  76. struct hdsp_mixer {
  77. unsigned short matrix[HDSP_MATRIX_MIXER_SIZE];
  78. };
  79. #define SNDRV_HDSP_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdsp_mixer)
  80. struct hdsp_9632_aeb {
  81. int aebi;
  82. int aebo;
  83. };
  84. #define SNDRV_HDSP_IOCTL_GET_9632_AEB _IOR('H', 0x45, struct hdsp_9632_aeb)
  85. /* typedefs for compatibility to user-space */
  86. typedef enum HDSP_IO_Type HDSP_IO_Type;
  87. typedef struct hdsp_peak_rms hdsp_peak_rms_t;
  88. typedef struct hdsp_config_info hdsp_config_info_t;
  89. typedef struct hdsp_firmware hdsp_firmware_t;
  90. typedef struct hdsp_version hdsp_version_t;
  91. typedef struct hdsp_mixer hdsp_mixer_t;
  92. typedef struct hdsp_9632_aeb hdsp_9632_aeb_t;
  93. #endif /* __SOUND_HDSP_H */