Skip to content

Commit e5a1ec1

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 4f48162 commit e5a1ec1

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

src/audio/base_fw.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,25 @@ static int basefw_resource_allocation_request(bool first_block,
263263
}
264264
}
265265

266+
static int basefw_mic_priv_state_changed(bool first_block,
267+
bool last_block,
268+
uint32_t data_offset_or_size,
269+
const char *data)
270+
{
271+
#if CONFIG_MICROPHONE_PRIVACY
272+
tr_info(&basefw_comp_tr, "basefw_mic_priv_state_changed, status = %d", *data);
273+
274+
uint32_t mic_disable_status = (uint32_t)(*data);
275+
struct mic_privacy_settings settings = fill_mic_priv_settings(mic_disable_status);
276+
277+
propagate_privacy_settings(&settings);
278+
279+
return 0;
280+
#else
281+
return IPC4_UNAVAILABLE;
282+
#endif
283+
}
284+
266285
static int basefw_set_mic_priv_policy(bool first_block,
267286
bool last_block,
268287
uint32_t data_offset_or_size,
@@ -653,6 +672,8 @@ static int basefw_set_large_config(struct comp_dev *dev,
653672
case IPC4_RESOURCE_ALLOCATION_REQUEST:
654673
return basefw_resource_allocation_request(first_block, last_block, data_offset,
655674
data);
675+
case SNDW_MIC_PRIVACY_HW_MANAGED_STATE_CHANGE:
676+
return basefw_mic_priv_state_changed(first_block, last_block, data_offset, data);
656677
case IPC4_SET_MIC_PRIVACY_FW_MANAGED_POLICY_MASK:
657678
return basefw_set_mic_priv_policy(first_block, last_block, data_offset, data);
658679
default:

src/include/ipc4/base_fw.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,11 @@ 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+
* for SoundWire Gateways
294+
*/
295+
SNDW_MIC_PRIVACY_HW_MANAGED_STATE_CHANGE = 35,
296+
292297
/* Set policy mask for mic privacy in FW managed mode */
293298
IPC4_SET_MIC_PRIVACY_FW_MANAGED_POLICY_MASK = 36,
294299
};

0 commit comments

Comments
 (0)