u_uac1.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * u_uac1.h - Utility definitions for UAC1 function
  4. *
  5. * Copyright (C) 2016 Ruslan Bilovol <ruslan.bilovol@gmail.com>
  6. */
  7. #ifndef __U_UAC1_H
  8. #define __U_UAC1_H
  9. #include <linux/usb/composite.h>
  10. #include "uac_common.h"
  11. #define UAC1_OUT_EP_MAX_PACKET_SIZE 200
  12. #define UAC1_DEF_CCHMASK 0x3
  13. #define UAC1_DEF_CSRATE 48000
  14. #define UAC1_DEF_CSSIZE 2
  15. #define UAC1_DEF_PCHMASK 0x3
  16. #define UAC1_DEF_PSRATE 48000
  17. #define UAC1_DEF_PSSIZE 2
  18. #define UAC1_DEF_REQ_NUM 2
  19. #define UAC1_DEF_INT_REQ_NUM 10
  20. #define UAC1_DEF_MUTE_PRESENT 1
  21. #define UAC1_DEF_VOLUME_PRESENT 1
  22. #define UAC1_DEF_MIN_DB (-100*256) /* -100 dB */
  23. #define UAC1_DEF_MAX_DB 0 /* 0 dB */
  24. #define UAC1_DEF_RES_DB (1*256) /* 1 dB */
  25. struct f_uac1_opts {
  26. struct usb_function_instance func_inst;
  27. int c_chmask;
  28. int c_srates[UAC_MAX_RATES];
  29. int c_ssize;
  30. int p_chmask;
  31. int p_srates[UAC_MAX_RATES];
  32. int p_ssize;
  33. bool p_mute_present;
  34. bool p_volume_present;
  35. s16 p_volume_min;
  36. s16 p_volume_max;
  37. s16 p_volume_res;
  38. bool c_mute_present;
  39. bool c_volume_present;
  40. s16 c_volume_min;
  41. s16 c_volume_max;
  42. s16 c_volume_res;
  43. int req_number;
  44. unsigned bound:1;
  45. char function_name[32];
  46. struct mutex lock;
  47. int refcnt;
  48. };
  49. #endif /* __U_UAC1_H */