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