Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mic_privacy: initial implementation #9788

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/audio/base_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,20 @@ 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)
{
Comment on lines +278 to +281
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation looks wrong

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;
}

static int basefw_set_mic_priv_policy(bool first_block,
bool last_block,
uint32_t data_offset_or_size,
Expand Down Expand Up @@ -664,6 +678,9 @@ 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,
Copy link
Contributor

@jsarha jsarha Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are quite big and enlightening comment about the earlier basefw_params. Would be good to add something here too.

};

Expand Down
Loading