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 8, 2025
1 parent 46b2efd commit d499592
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/audio/base_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,25 @@ static int basefw_resource_allocation_request(bool first_block,
}
}

static int basefw_mic_priv_state_changed(bool first_block,
bool last_block,
uint32_t data_offset_or_size,
const char *data)
{
#if CONFIG_MICROPHONE_PRIVACY
tr_info(&basefw_comp_tr, "basefw_mic_priv_state_changed, status = %d", *data);

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

propagate_privacy_settings(&settings);

return 0;
#else
return IPC4_UNAVAILABLE;
#endif
}

static int basefw_set_mic_priv_policy(bool first_block,
bool last_block,
uint32_t data_offset_or_size,
Expand Down Expand Up @@ -666,6 +685,8 @@ static int basefw_set_large_config(struct comp_dev *dev,
case IPC4_RESOURCE_ALLOCATION_REQUEST:
return basefw_resource_allocation_request(first_block, last_block, data_offset,
data);
case SNDW_MIC_PRIVACY_HW_MANAGED_STATE_CHANGE:
return basefw_mic_priv_state_changed(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);
default:
Expand Down
6 changes: 6 additions & 0 deletions src/include/ipc4/base_fw.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ 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
* for SoundWire Gateways
*/
SNDW_MIC_PRIVACY_HW_MANAGED_STATE_CHANGE = 35,

IPC4_SET_MIC_PRIVACY_FW_MANAGED_POLICY_MASK = 36,
};

Expand Down

0 comments on commit d499592

Please sign in to comment.