1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  * Copyright(c) 2019 Intel Corporation. All rights reserved.
4  *
5  * Author: Marcin Rajwa <marcin.rajwa@linux.intel.com>
6  */
7 
8 #ifndef __SOF_AUDIO_CADENCE_CODEC__
9 #define __SOF_AUDIO_CADENCE_CODEC__
10 
11 #include <sof/audio/cadence/xa_type_def.h>
12 #include <sof/audio/cadence/xa_apicmd_standards.h>
13 #include <sof/audio/cadence/xa_error_standards.h>
14 #include <sof/audio/cadence/xa_memory_standards.h>
15 
16 #define LIB_NAME_MAX_LEN 30
17 #define LIB_NO_ERROR XA_NO_ERROR
18 #define LIB_IS_FATAL_ERROR(e) ((e) & XA_FATAL_ERROR)
19 #define CODEC_GET_API_ID(id) ((id) & 0xFF)
20 
21 /*****************************************************************************/
22 /* Cadence API functions							     */
23 /*****************************************************************************/
24 extern xa_codec_func_t cadence_api_function;
25 extern xa_codec_func_t xa_aac_dec;
26 extern xa_codec_func_t xa_bsac_dec;
27 extern xa_codec_func_t xa_dabplus_dec;
28 extern xa_codec_func_t xa_drm_dec;
29 extern xa_codec_func_t xa_mp3_dec;
30 extern xa_codec_func_t xa_sbc_dec;
31 extern xa_codec_func_t xa_vorbis_dec;
32 extern xa_codec_func_t xa_src_pp;
33 
34 /*****************************************************************************/
35 /* Cadence private data types						     */
36 /*****************************************************************************/
37 struct cadence_api {
38 	uint32_t id;
39 	xa_codec_func_t *api;
40 };
41 
42 struct cadence_codec_data {
43 	char name[LIB_NAME_MAX_LEN];
44 	void *self;
45 	xa_codec_func_t *api;
46 	void *mem_tabs;
47 	uint32_t api_id;
48 	struct module_config setup_cfg;
49 };
50 
51 #endif /* __SOF_AUDIO_CADENCE_CODEC__ */
52