Skip to content

Commit d499592

Browse files
mbukowskabonislawski
authored andcommitted
mic_privacy: implement new IPC - SNDW_MIC_PRIVACY_HW_MANAGED_STATE_CHANGE
SW sends this IPC when microphone privacy state is changed for HW_MANAGED mode and SNDW interface. Signed-off-by: Michal Bukowski <[email protected]>
1 parent 46b2efd commit d499592

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

src/audio/base_fw.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,25 @@ static int basefw_resource_allocation_request(bool first_block,
276276
}
277277
}
278278

279+
static int basefw_mic_priv_state_changed(bool first_block,
280+
bool last_block,
281+
uint32_t data_offset_or_size,
282+
const char *data)
283+
{
284+
#if CONFIG_MICROPHONE_PRIVACY
285+
tr_info(&basefw_comp_tr, "basefw_mic_priv_state_changed, status = %d", *data);
286+
287+
uint32_t mic_disable_status = (uint32_t)(*data);
288+
struct mic_privacy_settings settings = fill_mic_priv_settings(mic_disable_status);
289+
290+
propagate_privacy_settings(&settings);
291+
292+
return 0;
293+
#else
294+
return IPC4_UNAVAILABLE;
295+
#endif
296+
}
297+
279298
static int basefw_set_mic_priv_policy(bool first_block,
280299
bool last_block,
281300
uint32_t data_offset_or_size,
@@ -666,6 +685,8 @@ static int basefw_set_large_config(struct comp_dev *dev,
666685
case IPC4_RESOURCE_ALLOCATION_REQUEST:
667686
return basefw_resource_allocation_request(first_block, last_block, data_offset,
668687
data);
688+
case SNDW_MIC_PRIVACY_HW_MANAGED_STATE_CHANGE:
689+
return basefw_mic_priv_state_changed(first_block, last_block, data_offset, data);
669690
case IPC4_SET_MIC_PRIVACY_FW_MANAGED_POLICY_MASK:
670691
return basefw_set_mic_priv_policy(first_block, last_block, data_offset, data);
671692
default:

src/include/ipc4/base_fw.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,12 @@ enum ipc4_basefw_params {
289289
/* Use LARGE_CONFIG_SET to change SDW ownership */
290290
IPC4_SDW_OWNERSHIP = 31,
291291

292+
/*!
293+
* This command is used by SW to notify FW for changing state of Mic Privacy
294+
* for SoundWire Gateways
295+
*/
296+
SNDW_MIC_PRIVACY_HW_MANAGED_STATE_CHANGE = 35,
297+
292298
IPC4_SET_MIC_PRIVACY_FW_MANAGED_POLICY_MASK = 36,
293299
};
294300

0 commit comments

Comments
 (0)