q6core.h 5.4 KB

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