Skip to content

Commit 37336ba

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 <michal.bukowski@intel.com>
1 parent aa73744 commit 37336ba

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
@@ -277,6 +277,25 @@ static int basefw_resource_allocation_request(bool first_block,
277277
}
278278
}
279279

280+
static int basefw_mic_priv_state_changed(bool first_block,
281+
bool last_block,
282+
uint32_t data_offset_or_size,
283+
const char *data)
284+
{
285+
#if CONFIG_MICROPHONE_PRIVACY
286+
tr_info(&basefw_comp_tr, "basefw_mic_priv_state_changed, status = %d", *data);
287+
288+
uint32_t mic_disable_status = (uint32_t)(*data);
289+
struct mic_privacy_settings settings = fill_mic_priv_settings(mic_disable_status);
290+
291+
propagate_privacy_settings(&settings);
292+
293+
return 0;
294+
#else
295+
return IPC4_UNAVAILABLE;
296+
#endif
297+
}
298+
280299
static int basefw_set_mic_priv_policy(bool first_block,
281300
bool last_block,
282301
uint32_t data_offset_or_size,
@@ -667,6 +686,8 @@ static int basefw_set_large_config(struct comp_dev *dev,
667686
case IPC4_RESOURCE_ALLOCATION_REQUEST:
668687
return basefw_resource_allocation_request(first_block, last_block, data_offset,
669688
data);
689+
case SNDW_MIC_PRIVACY_HW_MANAGED_STATE_CHANGE:
690+
return basefw_mic_priv_state_changed(first_block, last_block, data_offset, data);
670691
case IPC4_SET_MIC_PRIVACY_FW_MANAGED_POLICY_MASK:
671692
return basefw_set_mic_priv_policy(first_block, last_block, data_offset, data);
672693
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)