msm-dolby-dap-config.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2013-2014, 2017-2018, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _MSM_DOLBY_DAP_CONFIG_H_
  6. #define _MSM_DOLBY_DAP_CONFIG_H_
  7. #include <sound/soc.h>
  8. #include "msm-dolby-common.h"
  9. #ifdef CONFIG_DOLBY_DAP
  10. /* DOLBY DOLBY GUIDS */
  11. #define DOLBY_ADM_COPP_TOPOLOGY_ID 0x0001033B
  12. #define NUM_DOLBY_ENDP_DEVICE 23
  13. #define DOLBY_NUM_ENDP_DEPENDENT_PARAMS 3
  14. #define DOLBY_ENDDEP_PARAM_DVLO_OFFSET 0
  15. #define DOLBY_ENDDEP_PARAM_DVLO_LENGTH 1
  16. #define DOLBY_ENDDEP_PARAM_DVLI_OFFSET (DOLBY_ENDDEP_PARAM_DVLO_OFFSET + \
  17. DOLBY_ENDDEP_PARAM_DVLO_LENGTH)
  18. #define DOLBY_ENDDEP_PARAM_DVLI_LENGTH 1
  19. #define DOLBY_ENDDEP_PARAM_VMB_OFFSET (DOLBY_ENDDEP_PARAM_DVLI_OFFSET + \
  20. DOLBY_ENDDEP_PARAM_DVLI_LENGTH)
  21. #define DOLBY_ENDDEP_PARAM_VMB_LENGTH 1
  22. #define DOLBY_ENDDEP_PARAM_LENGTH (DOLBY_ENDDEP_PARAM_DVLO_LENGTH + \
  23. DOLBY_ENDDEP_PARAM_DVLI_LENGTH + DOLBY_ENDDEP_PARAM_VMB_LENGTH)
  24. #define MAX_DOLBY_PARAMS 47
  25. #define MAX_DOLBY_CTRL_PARAMS 5
  26. #define ALL_DOLBY_PARAMS (MAX_DOLBY_PARAMS + \
  27. MAX_DOLBY_CTRL_PARAMS)
  28. #define DOLBY_COMMIT_ALL_IDX MAX_DOLBY_PARAMS
  29. #define DOLBY_COMMIT_IDX (MAX_DOLBY_PARAMS+1)
  30. #define DOLBY_USE_CACHE_IDX (MAX_DOLBY_PARAMS+2)
  31. #define DOLBY_AUTO_ENDP_IDX (MAX_DOLBY_PARAMS+3)
  32. #define DOLBY_AUTO_ENDDEP_IDX (MAX_DOLBY_PARAMS+4)
  33. /* DOLBY device definitions */
  34. enum {
  35. DOLBY_ENDP_INT_SPEAKERS = 0,
  36. DOLBY_ENDP_EXT_SPEAKERS,
  37. DOLBY_ENDP_HEADPHONES,
  38. DOLBY_ENDP_HDMI,
  39. DOLBY_ENDP_SPDIF,
  40. DOLBY_ENDP_DLNA,
  41. DOLBY_ENDP_ANALOG,
  42. };
  43. /* DOLBY device definitions end */
  44. struct dolby_dap_params {
  45. uint32_t value[TOTAL_LENGTH_DOLBY_PARAM + MAX_DOLBY_PARAMS];
  46. } __packed;
  47. int msm_dolby_dap_init(int port_id, int copp_idx, int channels,
  48. bool is_custom_stereo_on);
  49. void msm_dolby_dap_deinit(int port_id);
  50. void msm_dolby_dap_add_controls(struct snd_soc_platform *platform);
  51. int dolby_dap_set_custom_stereo_onoff(int port_id, int copp_idx,
  52. bool is_custom_stereo_enabled);
  53. /* Dolby DOLBY end */
  54. #else
  55. int msm_dolby_dap_init(int port_id, int copp_idx, int channels,
  56. bool is_custom_stereo_on)
  57. {
  58. return 0;
  59. }
  60. void msm_dolby_dap_deinit(int port_id) { }
  61. void msm_dolby_dap_add_controls(struct snd_soc_component *component) { }
  62. int dolby_dap_set_custom_stereo_onoff(int port_id, int copp_idx,
  63. bool is_custom_stereo_enabled)
  64. {
  65. return 0;
  66. }
  67. #endif
  68. #endif