-
Notifications
You must be signed in to change notification settings - Fork 132
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
ASoC: SOF: Intel: Add support for hardware mic privacy change reporting #5312
base: topic/sof-dev
Are you sure you want to change the base?
Changes from all commits
6178620
e3cc721
3d5ff5b
54f085a
4ed3e51
bd8c18f
fb1860e
cf0443d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -400,6 +400,7 @@ enum sof_ipc4_base_fw_params { | |
SOF_IPC4_FW_PARAM_MODULES_INFO_GET, | ||
SOF_IPC4_FW_PARAM_LIBRARIES_INFO_GET = 16, | ||
SOF_IPC4_FW_PARAM_SYSTEM_TIME = 20, | ||
SOF_IPC4_FW_PARAM_MIC_PRIVACY_STATE_CHANGE = 35, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is very controversial. In other words, this IPC does not seem to have a purpose other than academic - and it's mind-blowing that such a split implementation for a 'secure' solution relies on an IPC from the host. Recompile your kernel and the privacy is crippled... That does not sound good, does it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @plbossart, this is not the codec implemented privacy (SPE), I think SDCA spec also have similar described for the Function agent (iow, DSP). |
||
}; | ||
|
||
enum sof_ipc4_fw_config_params { | ||
|
@@ -450,6 +451,18 @@ struct sof_ipc4_dx_state_info { | |
uint32_t dx_mask; | ||
} __packed __aligned(4); | ||
|
||
enum sof_ipc4_hw_config_params { | ||
SOF_IPC4_HW_CFG_INTEL_MIC_PRIVACY_CAPS = 11, | ||
}; | ||
|
||
#define SOF_IPC_INTEL_MIC_PRIVACY_VERSION_PTL 1 | ||
|
||
struct sof_ipc4_intel_mic_privacy_cap { | ||
uint32_t version; | ||
uint32_t capabilities_length; | ||
uint32_t capabilities[]; | ||
} __packed; | ||
|
||
/* Reply messages */ | ||
|
||
/* | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -352,6 +352,27 @@ void hda_sdw_process_wakeen_common(struct snd_sof_dev *sdev) | |
} | ||
ranj063 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
EXPORT_SYMBOL_NS(hda_sdw_process_wakeen_common, "SND_SOC_SOF_INTEL_HDA_GENERIC"); | ||
|
||
static bool hda_dsp_sdw_check_mic_privacy_irq(struct snd_sof_dev *sdev) | ||
{ | ||
const struct sof_intel_dsp_desc *chip; | ||
|
||
chip = get_chip_info(sdev->pdata); | ||
if (chip && chip->check_mic_privacy_irq) | ||
return chip->check_mic_privacy_irq(sdev, true, | ||
AZX_REG_ML_LEPTR_ID_SDW); | ||
|
||
return false; | ||
} | ||
|
||
static void hda_dsp_sdw_process_mic_privacy(struct snd_sof_dev *sdev) | ||
{ | ||
const struct sof_intel_dsp_desc *chip; | ||
|
||
chip = get_chip_info(sdev->pdata); | ||
if (chip && chip->process_mic_privacy) | ||
chip->process_mic_privacy(sdev, true, AZX_REG_ML_LEPTR_ID_SDW); | ||
} | ||
|
||
#else /* IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE) */ | ||
static inline int hda_sdw_acpi_scan(struct snd_sof_dev *sdev) | ||
{ | ||
|
@@ -383,6 +404,13 @@ static inline bool hda_sdw_check_wakeen_irq(struct snd_sof_dev *sdev) | |
return false; | ||
} | ||
|
||
static inline bool hda_dsp_sdw_check_mic_privacy_irq(struct snd_sof_dev *sdev) | ||
{ | ||
return false; | ||
} | ||
|
||
static inline void hda_dsp_sdw_process_mic_privacy(struct snd_sof_dev *sdev) { } | ||
|
||
#endif /* IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE) */ | ||
|
||
/* pre fw run operations */ | ||
|
@@ -683,7 +711,13 @@ static irqreturn_t hda_dsp_interrupt_thread(int irq, void *context) | |
|
||
if (hda_dsp_check_sdw_irq(sdev)) { | ||
trace_sof_intel_hda_irq(sdev, "sdw"); | ||
|
||
hda_dsp_sdw_thread(irq, hdev->sdw); | ||
|
||
if (hda_dsp_sdw_check_mic_privacy_irq(sdev)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this have to inside the if (hda_dsp_check_sdw_irq(sdev)) @ujfalusi or is it independent of the sdw_irq like the wakeen irq? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The mic privacy interrupt in PTL is piggy-backing on the SDW interrupt for host (and on DMIC interrupt in DSP), if the SDW is not powered up we will not receive interrupt about the change. Even if we have SDW active, but the link which is under HW managed mic privacy mode is not active we will not receive interrupt (we only enable the interrupt via the managed link). |
||
trace_sof_intel_hda_irq(sdev, "mic privacy"); | ||
hda_dsp_sdw_process_mic_privacy(sdev); | ||
} | ||
} | ||
|
||
if (hda_sdw_check_wakeen_irq(sdev)) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the commit message should be clearer that the information is from hardware to host only. This is different to the previous patch in the sense that the host can select to receive information on the privacy changes, but it is not involved in the privacy flows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The interrupt is to the owner of the IP, if we would have DMIC handling in kernel side then the interrupt would be coming to host.
I made the API generic to avoid churn (with sdw/dmic/ssp/hda/this/that/ variants) if ever we will have to deal with this on different IPs in kernel.
Let me think how I can improve the commit message.