Skip to content

Commit 764f2d8

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 d6f0647 commit 764f2d8

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/audio/base_fw_intel.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,26 @@ static int basefw_set_mic_priv_policy(bool first_block,
363363
#endif
364364
}
365365

366+
static int basefw_mic_priv_state_changed(bool first_block,
367+
bool last_block,
368+
uint32_t data_offset_or_size,
369+
const char *data)
370+
{
371+
#if CONFIG_INTEL_ADSP_MIC_PRIVACY
372+
tr_info(&basefw_comp_tr, "state changed to %d", *data);
373+
374+
uint32_t mic_disable_status = (uint32_t)(*data);
375+
struct mic_privacy_settings settings;
376+
377+
mic_privacy_fill_settings(&settings, mic_disable_status);
378+
mic_privacy_propagate_settings(&settings);
379+
380+
return 0;
381+
#else
382+
return IPC4_UNAVAILABLE;
383+
#endif
384+
}
385+
366386
int basefw_vendor_set_large_config(struct comp_dev *dev,
367387
uint32_t param_id,
368388
bool first_block,
@@ -375,6 +395,8 @@ int basefw_vendor_set_large_config(struct comp_dev *dev,
375395
return basefw_set_fw_config(first_block, last_block, data_offset, data);
376396
case IPC4_SET_MIC_PRIVACY_FW_MANAGED_POLICY_MASK:
377397
return basefw_set_mic_priv_policy(first_block, last_block, data_offset, data);
398+
case IPC4_MIC_PRIVACY_HW_MANAGED_STATE_CHANGE:
399+
return basefw_mic_priv_state_changed(first_block, last_block, data_offset, data);
378400
default:
379401
break;
380402
}

src/include/ipc4/base_fw.h

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

292+
/* This command is used by SW to notify FW for changing state of Mic Privacy */
293+
IPC4_MIC_PRIVACY_HW_MANAGED_STATE_CHANGE = 35,
294+
292295
/* Set policy mask for mic privacy in FW managed mode */
293296
IPC4_SET_MIC_PRIVACY_FW_MANAGED_POLICY_MASK = 36,
294297
};

0 commit comments

Comments
 (0)