q6core.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /* Copyright (c) 2012-2017, 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 __Q6CORE_H__
  13. #define __Q6CORE_H__
  14. #include <ipc/apr.h>
  15. #include <dsp/apr_audio-v2.h>
  16. #define AVCS_CMD_ADSP_EVENT_GET_STATE 0x0001290C
  17. #define AVCS_CMDRSP_ADSP_EVENT_GET_STATE 0x0001290D
  18. bool q6core_is_adsp_ready(void);
  19. int q6core_get_service_version(uint32_t service_id,
  20. struct avcs_fwk_ver_info *ver_info,
  21. size_t size);
  22. size_t q6core_get_avcs_service_size(uint32_t service_id);
  23. #define ADSP_CMD_SET_DTS_EAGLE_DATA_ID 0x00012919
  24. #define DTS_EAGLE_LICENSE_ID 0x00028346
  25. struct adsp_dts_eagle {
  26. struct apr_hdr hdr;
  27. uint32_t id;
  28. uint32_t overwrite;
  29. uint32_t size;
  30. char data[];
  31. };
  32. int core_dts_eagle_set(int size, char *data);
  33. int core_dts_eagle_get(int id, int size, char *data);
  34. #define ADSP_CMD_SET_DOLBY_MANUFACTURER_ID 0x00012918
  35. struct adsp_dolby_manufacturer_id {
  36. struct apr_hdr hdr;
  37. int manufacturer_id;
  38. };
  39. uint32_t core_set_dolby_manufacturer_id(int manufacturer_id);
  40. /* Dolby Surround1 Module License ID. This ID is used as an identifier
  41. * for DS1 license via ADSP generic license mechanism.
  42. * Please refer AVCS_CMD_SET_LICENSE for more details.
  43. */
  44. #define DOLBY_DS1_LICENSE_ID 0x00000001
  45. #define AVCS_CMD_SET_LICENSE 0x00012919
  46. struct avcs_cmd_set_license {
  47. struct apr_hdr hdr;
  48. uint32_t id; /**< A unique ID used to refer to this license */
  49. uint32_t overwrite;
  50. /* 0 = do not overwrite an existing license with this id.
  51. * 1 = overwrite an existing license with this id.
  52. */
  53. uint32_t size;
  54. /**< Size in bytes of the license data following this header. */
  55. /* uint8_t* data , data and padding follows this structure
  56. * total packet size needs to be multiple of 4 Bytes
  57. */
  58. };
  59. #define AVCS_CMD_GET_LICENSE_VALIDATION_RESULT 0x0001291A
  60. struct avcs_cmd_get_license_validation_result {
  61. struct apr_hdr hdr;
  62. uint32_t id; /**< A unique ID used to refer to this license */
  63. };
  64. #define AVCS_CMDRSP_GET_LICENSE_VALIDATION_RESULT 0x0001291B
  65. struct avcs_cmdrsp_get_license_validation_result {
  66. uint32_t result;
  67. /* ADSP_EOK if the license validation result was successfully retrieved.
  68. * ADSP_ENOTEXIST if there is no license with the given id.
  69. * ADSP_ENOTIMPL if there is no validation function for a license
  70. * with this id.
  71. */
  72. uint32_t size;
  73. /* Length in bytes of the result that follows this structure*/
  74. };
  75. /* Set Q6 topologies */
  76. /*
  77. * Registers custom topologies in the aDSP for
  78. * use in audio, voice, AFE and LSM.
  79. */
  80. #define AVCS_CMD_SHARED_MEM_MAP_REGIONS 0x00012924
  81. #define AVCS_CMDRSP_SHARED_MEM_MAP_REGIONS 0x00012925
  82. #define AVCS_CMD_SHARED_MEM_UNMAP_REGIONS 0x00012926
  83. #define AVCS_CMD_REGISTER_TOPOLOGIES 0x00012923
  84. /* The payload for the AVCS_CMD_REGISTER_TOPOLOGIES command */
  85. struct avcs_cmd_register_topologies {
  86. struct apr_hdr hdr;
  87. uint32_t payload_addr_lsw;
  88. /* Lower 32 bits of the topology buffer address. */
  89. uint32_t payload_addr_msw;
  90. /* Upper 32 bits of the topology buffer address. */
  91. uint32_t mem_map_handle;
  92. /* Unique identifier for an address.
  93. * -This memory map handle is returned by the aDSP through the
  94. * memory map command.
  95. * -NULL mem_map_handle is interpreted as in-band parameter
  96. * passing.
  97. * -Client has the flexibility to choose in-band or out-of-band.
  98. * -Out-of-band is recommended in this case.
  99. */
  100. uint32_t payload_size;
  101. /* Size in bytes of the valid data in the topology buffer. */
  102. } __packed;
  103. #define AVCS_CMD_DEREGISTER_TOPOLOGIES 0x0001292a
  104. /* The payload for the AVCS_CMD_DEREGISTER_TOPOLOGIES command */
  105. struct avcs_cmd_deregister_topologies {
  106. struct apr_hdr hdr;
  107. uint32_t payload_addr_lsw;
  108. /* Lower 32 bits of the topology buffer address. */
  109. uint32_t payload_addr_msw;
  110. /* Upper 32 bits of the topology buffer address. */
  111. uint32_t mem_map_handle;
  112. /* Unique identifier for an address.
  113. * -This memory map handle is returned by the aDSP through the
  114. * memory map command.
  115. * -NULL mem_map_handle is interpreted as in-band parameter
  116. * passing.
  117. * -Client has the flexibility to choose in-band or out-of-band.
  118. * -Out-of-band is recommended in this case.
  119. */
  120. uint32_t payload_size;
  121. /* Size in bytes of the valid data in the topology buffer. */
  122. uint32_t mode;
  123. /* 1: Deregister selected topologies
  124. * 2: Deregister all topologies
  125. */
  126. } __packed;
  127. #define AVCS_MODE_DEREGISTER_ALL_CUSTOM_TOPOLOGIES 2
  128. int32_t core_set_license(uint32_t key, uint32_t module_id);
  129. int32_t core_get_license_status(uint32_t module_id);
  130. #endif /* __Q6CORE_H__ */