From 786626dce52910507ce4f101b05f817212aae908 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Fri, 5 Jul 2024 18:27:56 +0200 Subject: [PATCH] dma: fix mic_privacy build This will fix PTL build with mic_privacy Signed-off-by: Adrian Bonislawski --- src/audio/base_fw.c | 7 ++---- .../mic_privacy_manager/mic_privacy_manager.c | 22 +++++-------------- src/include/sof/audio/mic_privacy_manager.h | 3 --- src/lib/dma.c | 4 ++++ 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/src/audio/base_fw.c b/src/audio/base_fw.c index e10dc0fb9889..d56fbcad707c 100644 --- a/src/audio/base_fw.c +++ b/src/audio/base_fw.c @@ -50,6 +50,7 @@ static int basefw_config(uint32_t *data_offset, char *data) uint16_t version[4] = {SOF_MAJOR, SOF_MINOR, SOF_MICRO, SOF_BUILD}; struct sof_tlv *tuple = (struct sof_tlv *)data; struct ipc4_scheduler_config sche_cfg; + struct privacy_capabilities priv_caps; uint32_t plat_data_offset = 0; uint32_t log_bytes_size = 0; @@ -120,14 +121,10 @@ static int basefw_config(uint32_t *data_offset, char *data) IS_ENABLED(CONFIG_ADSP_IMR_CONTEXT_SAVE)); tuple = tlv_next(tuple); - - struct privacy_capabilities priv_caps; - priv_caps.privacy_version = 1; priv_caps.capabilities_length = 1; priv_caps.capabilities[0] = mic_privacy_get_policy_register(); - - tlv_value_uint32_set(tuple, IPC4_PRIVACY_CAPS_HW_CFG, value); + tlv_value_set(tuple, IPC4_PRIVACY_CAPS_HW_CFG, sizeof(priv_caps), &priv_caps); tuple = tlv_next(tuple); diff --git a/src/audio/mic_privacy_manager/mic_privacy_manager.c b/src/audio/mic_privacy_manager/mic_privacy_manager.c index 5e6694dfca32..36e48ceabdd9 100644 --- a/src/audio/mic_privacy_manager/mic_privacy_manager.c +++ b/src/audio/mic_privacy_manager/mic_privacy_manager.c @@ -2,9 +2,9 @@ // // Copyright(c) 2023 Intel Corporation. All rights reserved. - -#include "sof/audio/mic_privacy_manager.h" - +#include +#include +#include #include #include @@ -88,16 +88,6 @@ void handle_dmic_interrupt(void *const self, int a, int b) //TODO } -void mic_priv_get_disable_stat(int num) -{ - - uint32_t mic_disable_status = mic_privacy_api->get_fw_managed_mic_disable_status(); - - if(mbu_mic_stat != mic_disable_status) - LOG_INF("mic_priv_get_disable_stat(%d) = 0x%x STATE CHANGE", num, mic_disable_status); - -} - void handle_fw_managed_interrupt(void * const dev) { LOG_INF("handle_fw_managed_interrupt"); @@ -243,7 +233,7 @@ void mic_privacy_process(struct mic_privacy_data *mic_priv, struct comp_buffer * if (mic_priv->max_ramp_time_in_ms > 0) { //gain_input(buffer, &mic_priv->mic_priv_gain_params, &mic_priv->mic_priv_gain_coefs_ioctl, copy_bytes); - data_zeroing(buffer); //Gain temporarily disabled + buffer_zero(buffer); //Gain temporarily disabled } } else if (mic_priv->mic_privacy_state == FADE_OUT){ @@ -261,11 +251,11 @@ void mic_privacy_process(struct mic_privacy_data *mic_priv, struct comp_buffer * if (mic_priv->max_ramp_time_in_ms > 0) { //LOG_INF("FADE_OUT dmic_gain_input ramp time ms = %d", mic_priv->max_ramp_time_in_ms); //gain_input(buffer, &mic_priv->mic_priv_gain_params, &mic_priv->mic_priv_gain_coefs_ioctl, copy_bytes); - data_zeroing(buffer); //Gain temporarily disabled + buffer_zero(buffer); //Gain temporarily disabled } } else if (mic_priv->mic_privacy_state == MUTED) { - data_zeroing(buffer); + buffer_zero(buffer); } } diff --git a/src/include/sof/audio/mic_privacy_manager.h b/src/include/sof/audio/mic_privacy_manager.h index 4bc5cea829f8..63617dd7f1e3 100644 --- a/src/include/sof/audio/mic_privacy_manager.h +++ b/src/include/sof/audio/mic_privacy_manager.h @@ -97,7 +97,4 @@ void mic_privacy_process(struct mic_privacy_data *mic_priv, struct comp_buffer * void mic_priv_gain_input(uint8_t *buff, uint32_t buff_size, uint32_t mic_priv_state, const struct ipc4_audio_format *in_fmt); -void mic_priv_get_disable_stat(int num); - - #endif /* ADSP_FW_MIC_PRIVACY_MANAGER_H */ diff --git a/src/lib/dma.c b/src/lib/dma.c index 3836738086bc..4496853f5178 100644 --- a/src/lib/dma.c +++ b/src/lib/dma.c @@ -7,6 +7,8 @@ #include #include #include +#include +#include #include #include #include @@ -19,6 +21,8 @@ #include #include #include +#include +#include "../audio/copier/copier.h" LOG_MODULE_REGISTER(dma, CONFIG_SOF_LOG_LEVEL);