Skip to content

Commit 764ce67

Browse files
Chao Songkv2019i
authored andcommitted
smart_amp_test: add ipc4 support for smart amp test
Smart amp test module read config from ipc msg and convert ipc4 settings to ipc3. It is a dummy module used for smart amplifier validation. Signed-off-by: Chao Song <chao.song@linux.intel.com> Signed-off-by: Rander Wang <rander.wang@intel.com>
1 parent 5ac79ea commit 764ce67

2 files changed

Lines changed: 272 additions & 12 deletions

File tree

src/include/sof/samples/audio/smart_amp_test.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
#include <sof/audio/component.h>
1313
#include <sof/audio/data_blob.h>
1414

15+
#if CONFIG_IPC_MAJOR_4
16+
#include <ipc4/base-config.h>
17+
18+
#define SOF_SMART_AMP_FEEDBACK_QUEUE_ID 1
19+
#endif
20+
1521
#define SMART_AMP_MAX_STREAM_CHAN 8
1622

1723
/** IPC blob types */
@@ -81,10 +87,31 @@ typedef int(*smart_amp_proc)(struct comp_dev *dev,
8187
*/
8288

8389
struct sof_smart_amp_config {
90+
#if CONFIG_IPC_MAJOR_4
91+
struct ipc4_base_module_cfg base;
92+
uint16_t num_input_pin_fmt;
93+
uint16_t num_output_pin_fmt;
94+
uint8_t reserved[8];
95+
/* length of data after output_pin_fmt */
96+
uint32_t priv_param_len;
97+
struct ipc4_input_pin_format input_pin_fmt[2];
98+
struct ipc4_output_pin_format output_pin_fmt;
99+
#else
84100
uint32_t size;
101+
#endif
85102
uint32_t feedback_channels;
86103
int8_t source_ch_map[PLATFORM_MAX_CHANNELS];
87104
int8_t feedback_ch_map[PLATFORM_MAX_CHANNELS];
88105
};
89106

107+
#if CONFIG_IPC_MAJOR_4
108+
109+
enum smart_amp_config_params {
110+
SMART_AMP_SET_MODEL = 1,
111+
SMART_AMP_SET_CONFIG = 2,
112+
SMART_AMP_GET_CONFIG = 3
113+
};
114+
115+
#endif
116+
90117
#endif /* __SOF_AUDIO_SMART_AMP_H__ */

0 commit comments

Comments
 (0)