@@ -215,6 +215,15 @@ int hda_dsp_pcm_open(struct snd_sof_dev *sdev,
return -ENODEV;
}
+ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
+ sdev->capture_stream_num++;
+ if (sdev->capture_stream_num == 1)
+ snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR,
+ HDA_DSP_EM2,
+ HDA_DSP_L1SEN,
+ 0);
+ }
+
/* binding pcm substream to hda stream */
substream->runtime->private_data = &dsp_stream->hstream;
return 0;
@@ -234,6 +243,15 @@ int hda_dsp_pcm_close(struct snd_sof_dev *sdev,
return -ENODEV;
}
+ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
+ sdev->capture_stream_num--;
+ if (sdev->capture_stream_num == 0)
+ snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR,
+ HDA_DSP_EM2,
+ HDA_DSP_L1SEN,
+ 1);
+ }
+
/* unbinding pcm substream to hda stream */
substream->runtime->private_data = NULL;
return 0;
@@ -332,6 +332,9 @@
#define SOF_SKL_NUM_DAIS 8
#endif
+#define HDA_DSP_EM2 0x1030
+#define HDA_DSP_L1SEN BIT(13)
+
/* Intel HD Audio SRAM Window 0*/
#define HDA_ADSP_SRAM0_BASE_SKL 0x8000
@@ -427,6 +427,7 @@ struct snd_sof_dev {
u32 dtrace_error;
u32 msi_enabled;
+ u32 capture_stream_num;
void *private; /* core does not touch this */
};