Skip to content

Commit

Permalink
dma: fix mic_privacy build
Browse files Browse the repository at this point in the history
This will fix PTL build with mic_privacy

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
  • Loading branch information
abonislawski committed Jul 5, 2024
1 parent dafaf2a commit 786626d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 24 deletions.
7 changes: 2 additions & 5 deletions src/audio/base_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);

Expand Down
22 changes: 6 additions & 16 deletions src/audio/mic_privacy_manager/mic_privacy_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
//
// Copyright(c) 2023 Intel Corporation. All rights reserved.


#include "sof/audio/mic_privacy_manager.h"

#include <sof/audio/audio_stream.h>
#include <sof/audio/buffer.h>
#include <sof/audio/mic_privacy_manager.h>

#include <zephyr/device.h>
#include <zephyr/drivers/mic_privacy.h>
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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){
Expand All @@ -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);
}
}

3 changes: 0 additions & 3 deletions src/include/sof/audio/mic_privacy_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
4 changes: 4 additions & 0 deletions src/lib/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <rtos/atomic.h>
#include <sof/audio/audio_stream.h>
#include <sof/audio/buffer.h>
#include <sof/audio/component.h>
#include <sof/audio/mic_privacy_manager.h>
#include <rtos/alloc.h>
#include <rtos/cache.h>
#include <sof/lib/dma.h>
Expand All @@ -19,6 +21,8 @@
#include <errno.h>
#include <stddef.h>
#include <stdint.h>
#include <module/module/base.h>
#include "../audio/copier/copier.h"

LOG_MODULE_REGISTER(dma, CONFIG_SOF_LOG_LEVEL);

Expand Down

0 comments on commit 786626d

Please sign in to comment.