Skip to content

Commit 54e7d2e

Browse files
ujfalusiranj063
authored andcommitted
ASoC: SOF: hda/shim: Add callbacks to handle mic privacy change for sdw
Add generic callback definitions for checking the mic privacy interrupt and status. Implement wrappers for mic privacy reported via the Soundwire interrupt and its vendor specific SHIM registers. Signed-off-by: Peter Ujfalusi <[email protected]>
1 parent 93085f8 commit 54e7d2e

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

sound/soc/sof/intel/hda.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,27 @@ void hda_sdw_process_wakeen_common(struct snd_sof_dev *sdev)
352352
}
353353
EXPORT_SYMBOL_NS(hda_sdw_process_wakeen_common, "SND_SOC_SOF_INTEL_HDA_GENERIC");
354354

355+
static bool hda_dsp_sdw_check_mic_privacy_irq(struct snd_sof_dev *sdev)
356+
{
357+
const struct sof_intel_dsp_desc *chip;
358+
359+
chip = get_chip_info(sdev->pdata);
360+
if (chip && chip->check_mic_privacy_irq)
361+
return chip->check_mic_privacy_irq(sdev, true,
362+
AZX_REG_ML_LEPTR_ID_SDW);
363+
364+
return false;
365+
}
366+
367+
static void hda_dsp_sdw_process_mic_privacy(struct snd_sof_dev *sdev)
368+
{
369+
const struct sof_intel_dsp_desc *chip;
370+
371+
chip = get_chip_info(sdev->pdata);
372+
if (chip && chip->process_mic_privacy)
373+
chip->process_mic_privacy(sdev, true, AZX_REG_ML_LEPTR_ID_SDW);
374+
}
375+
355376
#else /* IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE) */
356377
static inline int hda_sdw_acpi_scan(struct snd_sof_dev *sdev)
357378
{
@@ -383,6 +404,13 @@ static inline bool hda_sdw_check_wakeen_irq(struct snd_sof_dev *sdev)
383404
return false;
384405
}
385406

407+
static inline bool hda_dsp_sdw_check_mic_privacy_irq(struct snd_sof_dev *sdev)
408+
{
409+
return false;
410+
}
411+
412+
static inline void hda_dsp_sdw_process_mic_privacy(struct snd_sof_dev *sdev) { }
413+
386414
#endif /* IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE) */
387415

388416
/* pre fw run operations */
@@ -683,7 +711,13 @@ static irqreturn_t hda_dsp_interrupt_thread(int irq, void *context)
683711

684712
if (hda_dsp_check_sdw_irq(sdev)) {
685713
trace_sof_intel_hda_irq(sdev, "sdw");
714+
686715
hda_dsp_sdw_thread(irq, hdev->sdw);
716+
717+
if (hda_dsp_sdw_check_mic_privacy_irq(sdev)) {
718+
trace_sof_intel_hda_irq(sdev, "mic privacy");
719+
hda_dsp_sdw_process_mic_privacy(sdev);
720+
}
687721
}
688722

689723
if (hda_sdw_check_wakeen_irq(sdev)) {

sound/soc/sof/intel/shim.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ struct sof_intel_dsp_desc {
193193
bool (*check_sdw_wakeen_irq)(struct snd_sof_dev *sdev);
194194
void (*sdw_process_wakeen)(struct snd_sof_dev *sdev);
195195
bool (*check_ipc_irq)(struct snd_sof_dev *sdev);
196+
bool (*check_mic_privacy_irq)(struct snd_sof_dev *sdev, bool alt, int elid);
197+
void (*process_mic_privacy)(struct snd_sof_dev *sdev, bool alt, int elid);
196198
int (*power_down_dsp)(struct snd_sof_dev *sdev);
197199
int (*disable_interrupts)(struct snd_sof_dev *sdev);
198200
int (*cl_init)(struct snd_sof_dev *sdev, int stream_tag, bool imr_boot);

0 commit comments

Comments
 (0)