Skip to content

Commit

Permalink
mic_privacy: implement new IPC - SNDW_MIC_PRIVACY_HW_MANAGED_STATE_CH…
Browse files Browse the repository at this point in the history
…ANGE

SW sends this IPC when microphone privacy state is changed for
HW_MANAGED mode and SNDW interface.

Signed-off-by: Michal Bukowski <[email protected]>
  • Loading branch information
mbukowsk authored and abonislawski committed Feb 18, 2025
1 parent d6f0647 commit 764f2d8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/audio/base_fw_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,26 @@ static int basefw_set_mic_priv_policy(bool first_block,
#endif
}

static int basefw_mic_priv_state_changed(bool first_block,
bool last_block,
uint32_t data_offset_or_size,
const char *data)
{
#if CONFIG_INTEL_ADSP_MIC_PRIVACY
tr_info(&basefw_comp_tr, "state changed to %d", *data);

uint32_t mic_disable_status = (uint32_t)(*data);
struct mic_privacy_settings settings;

mic_privacy_fill_settings(&settings, mic_disable_status);
mic_privacy_propagate_settings(&settings);

return 0;
#else
return IPC4_UNAVAILABLE;
#endif
}

int basefw_vendor_set_large_config(struct comp_dev *dev,
uint32_t param_id,
bool first_block,
Expand All @@ -375,6 +395,8 @@ int basefw_vendor_set_large_config(struct comp_dev *dev,
return basefw_set_fw_config(first_block, last_block, data_offset, data);
case IPC4_SET_MIC_PRIVACY_FW_MANAGED_POLICY_MASK:
return basefw_set_mic_priv_policy(first_block, last_block, data_offset, data);
case IPC4_MIC_PRIVACY_HW_MANAGED_STATE_CHANGE:
return basefw_mic_priv_state_changed(first_block, last_block, data_offset, data);
default:
break;
}
Expand Down
3 changes: 3 additions & 0 deletions src/include/ipc4/base_fw.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ enum ipc4_basefw_params {
/* Use LARGE_CONFIG_SET to change SDW ownership */
IPC4_SDW_OWNERSHIP = 31,

/* This command is used by SW to notify FW for changing state of Mic Privacy */
IPC4_MIC_PRIVACY_HW_MANAGED_STATE_CHANGE = 35,

/* Set policy mask for mic privacy in FW managed mode */
IPC4_SET_MIC_PRIVACY_FW_MANAGED_POLICY_MASK = 36,
};
Expand Down

0 comments on commit 764f2d8

Please sign in to comment.