msm-dolby-dap-config.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright (c) 2013-2014, 2017 The Linux Foundation. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 and
  6. * only version 2 as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef _MSM_DOLBY_DAP_CONFIG_H_
  14. #define _MSM_DOLBY_DAP_CONFIG_H_
  15. #include <sound/soc.h>
  16. #include "msm-dolby-common.h"
  17. #ifdef CONFIG_DOLBY_DAP
  18. /* DOLBY DOLBY GUIDS */
  19. #define DOLBY_ADM_COPP_TOPOLOGY_ID 0x0001033B
  20. #define NUM_DOLBY_ENDP_DEVICE 23
  21. #define DOLBY_NUM_ENDP_DEPENDENT_PARAMS 3
  22. #define DOLBY_ENDDEP_PARAM_DVLO_OFFSET 0
  23. #define DOLBY_ENDDEP_PARAM_DVLO_LENGTH 1
  24. #define DOLBY_ENDDEP_PARAM_DVLI_OFFSET (DOLBY_ENDDEP_PARAM_DVLO_OFFSET + \
  25. DOLBY_ENDDEP_PARAM_DVLO_LENGTH)
  26. #define DOLBY_ENDDEP_PARAM_DVLI_LENGTH 1
  27. #define DOLBY_ENDDEP_PARAM_VMB_OFFSET (DOLBY_ENDDEP_PARAM_DVLI_OFFSET + \
  28. DOLBY_ENDDEP_PARAM_DVLI_LENGTH)
  29. #define DOLBY_ENDDEP_PARAM_VMB_LENGTH 1
  30. #define DOLBY_ENDDEP_PARAM_LENGTH (DOLBY_ENDDEP_PARAM_DVLO_LENGTH + \
  31. DOLBY_ENDDEP_PARAM_DVLI_LENGTH + DOLBY_ENDDEP_PARAM_VMB_LENGTH)
  32. #define MAX_DOLBY_PARAMS 47
  33. #define MAX_DOLBY_CTRL_PARAMS 5
  34. #define ALL_DOLBY_PARAMS (MAX_DOLBY_PARAMS + \
  35. MAX_DOLBY_CTRL_PARAMS)
  36. #define DOLBY_COMMIT_ALL_IDX MAX_DOLBY_PARAMS
  37. #define DOLBY_COMMIT_IDX (MAX_DOLBY_PARAMS+1)
  38. #define DOLBY_USE_CACHE_IDX (MAX_DOLBY_PARAMS+2)
  39. #define DOLBY_AUTO_ENDP_IDX (MAX_DOLBY_PARAMS+3)
  40. #define DOLBY_AUTO_ENDDEP_IDX (MAX_DOLBY_PARAMS+4)
  41. /* DOLBY device definitions */
  42. enum {
  43. DOLBY_ENDP_INT_SPEAKERS = 0,
  44. DOLBY_ENDP_EXT_SPEAKERS,
  45. DOLBY_ENDP_HEADPHONES,
  46. DOLBY_ENDP_HDMI,
  47. DOLBY_ENDP_SPDIF,
  48. DOLBY_ENDP_DLNA,
  49. DOLBY_ENDP_ANALOG,
  50. };
  51. /* DOLBY device definitions end */
  52. struct dolby_dap_params {
  53. uint32_t value[TOTAL_LENGTH_DOLBY_PARAM + MAX_DOLBY_PARAMS];
  54. } __packed;
  55. int msm_dolby_dap_init(int port_id, int copp_idx, int channels,
  56. bool is_custom_stereo_on);
  57. void msm_dolby_dap_deinit(int port_id);
  58. void msm_dolby_dap_add_controls(struct snd_soc_platform *platform);
  59. int dolby_dap_set_custom_stereo_onoff(int port_id, int copp_idx,
  60. bool is_custom_stereo_enabled);
  61. /* Dolby DOLBY end */
  62. #else
  63. int msm_dolby_dap_init(int port_id, int copp_idx, int channels,
  64. bool is_custom_stereo_on)
  65. {
  66. return 0;
  67. }
  68. void msm_dolby_dap_deinit(int port_id) { }
  69. void msm_dolby_dap_add_controls(struct snd_soc_platform *platform) { }
  70. int dolby_dap_set_custom_stereo_onoff(int port_id, int copp_idx,
  71. bool is_custom_stereo_enabled)
  72. {
  73. return 0;
  74. }
  75. #endif
  76. #endif