Skip to content

Commit c6e6b47

Browse files
committed
ASoC: SOF: Intel: hda-pcm: Follow the pause_supported flag to drop PAUSE support
If the stream's pause_supported flag is false then mask out the PAUSE support so user space will be prevented to use it. Introduce a module parameter to ignore the pause_supported flag, named as force_pause_support to allow testing of the PAUSE feature. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 3965ae8 commit c6e6b47

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

sound/soc/sof/intel/hda-pcm.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ static bool hda_disable_rewinds;
3737
module_param_named(disable_rewinds, hda_disable_rewinds, bool, 0444);
3838
MODULE_PARM_DESC(disable_rewinds, "SOF HDA disable rewinds");
3939

40+
static bool hda_force_pause_support;
41+
module_param_named(hda_force_pause_support, hda_force_pause_support, bool, 0444);
42+
MODULE_PARM_DESC(hda_force_pause_support,
43+
"SOF HDA ignore pause_supported flag to allow pause operation");
44+
4045
u32 hda_dsp_get_mult_div(struct snd_sof_dev *sdev, int rate)
4146
{
4247
switch (rate) {
@@ -240,6 +245,14 @@ int hda_dsp_pcm_open(struct snd_sof_dev *sdev,
240245
if (hda_always_enable_dmi_l1 && direction == SNDRV_PCM_STREAM_CAPTURE)
241246
runtime->hw.info &= ~SNDRV_PCM_INFO_PAUSE;
242247

248+
/*
249+
* Follow the hint (unless a module parameter is set to ignore it) and
250+
* disable the pause push/release support
251+
*/
252+
if (!hda_force_pause_support &&
253+
!spcm->stream[substream->stream].pause_supported)
254+
runtime->hw.info &= ~SNDRV_PCM_INFO_PAUSE;
255+
243256
if (hda_always_enable_dmi_l1 ||
244257
direction == SNDRV_PCM_STREAM_PLAYBACK ||
245258
spcm->stream[substream->stream].d0i3_compatible)

0 commit comments

Comments
 (0)