wsa-macro.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* Copyright (c) 2018, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef WSA_MACRO_H
  13. #define WSA_MACRO_H
  14. /*
  15. * Selects compander and smart boost settings
  16. * for a given speaker mode
  17. */
  18. enum {
  19. WSA_MACRO_SPKR_MODE_DEFAULT,
  20. WSA_MACRO_SPKR_MODE_1, /* COMP Gain = 12dB, Smartboost Max = 5.5V */
  21. };
  22. /* Rx path gain offsets */
  23. enum {
  24. WSA_MACRO_GAIN_OFFSET_M1P5_DB,
  25. WSA_MACRO_GAIN_OFFSET_0_DB,
  26. };
  27. #if IS_ENABLED(CONFIG_WSA_MACRO)
  28. extern int wsa_macro_set_spkr_mode(struct snd_soc_codec *codec, int mode);
  29. extern int wsa_macro_set_spkr_gain_offset(struct snd_soc_codec *codec,
  30. int offset);
  31. #else /* CONFIG_WSA_MACRO */
  32. static inline int wsa_macro_set_spkr_mode(struct snd_soc_codec *codec, int mode)
  33. {
  34. return 0;
  35. }
  36. static inline int wsa_macro_set_spkr_gain_offset(struct snd_soc_codec *codec,
  37. int offset);
  38. {
  39. return 0;
  40. }
  41. #endif /* CONFIG_WSA_MACRO */
  42. #endif