Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: SOF: core/Intel: Handle pause supported token

Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

A new set of tokens have been added to SOF topology to indicate that the pause
operation is supported or not on the given PCM device.
Pause is an optional feature that depends on pipeline, topology and modules
used by the PCM.

Add a pause_supported flag to snd_sof_pcm_stream and use this flag in Intel
platform code to keep the pause support enabled or to disable it.

+22
+2
include/uapi/sound/sof/tokens.h
··· 153 153 /* Stream */ 154 154 #define SOF_TKN_STREAM_PLAYBACK_COMPATIBLE_D0I3 1200 155 155 #define SOF_TKN_STREAM_CAPTURE_COMPATIBLE_D0I3 1201 156 + #define SOF_TKN_STREAM_PLAYBACK_PAUSE_SUPPORTED 1202 157 + #define SOF_TKN_STREAM_CAPTURE_PAUSE_SUPPORTED 1203 156 158 157 159 /* Led control for mute switches */ 158 160 #define SOF_TKN_MUTE_LED_USE 1300
+15
sound/soc/sof/intel/hda-pcm.c
··· 37 37 module_param_named(disable_rewinds, hda_disable_rewinds, bool, 0444); 38 38 MODULE_PARM_DESC(disable_rewinds, "SOF HDA disable rewinds"); 39 39 40 + static int hda_force_pause_support = -1; 41 + module_param_named(force_pause_support, hda_force_pause_support, int, 0444); 42 + MODULE_PARM_DESC(force_pause_support, 43 + "Pause support: -1: Use default, 0: Disable, 1: Enable (default -1)"); 44 + 40 45 u32 hda_dsp_get_mult_div(struct snd_sof_dev *sdev, int rate) 41 46 { 42 47 switch (rate) { ··· 243 238 * pause push/release to be disabled 244 239 */ 245 240 if (hda_always_enable_dmi_l1 && direction == SNDRV_PCM_STREAM_CAPTURE) 241 + runtime->hw.info &= ~SNDRV_PCM_INFO_PAUSE; 242 + 243 + /* 244 + * Do not advertise the PAUSE support if it is forced to be disabled via 245 + * module parameter or if the pause_supported is false for the PCM 246 + * device 247 + */ 248 + if (hda_force_pause_support == 0 || 249 + (hda_force_pause_support == -1 && 250 + !spcm->stream[substream->stream].pause_supported)) 246 251 runtime->hw.info &= ~SNDRV_PCM_INFO_PAUSE; 247 252 248 253 if (hda_always_enable_dmi_l1 ||
+1
sound/soc/sof/sof-audio.h
··· 332 332 struct work_struct period_elapsed_work; 333 333 struct snd_soc_dapm_widget_list *list; /* list of connected DAPM widgets */ 334 334 bool d0i3_compatible; /* DSP can be in D0I3 when this pcm is opened */ 335 + bool pause_supported; /* PCM device supports PAUSE operation */ 335 336 unsigned int dsp_max_burst_size_in_ms; /* The maximum size of the host DMA burst in ms */ 336 337 /* 337 338 * flag to indicate that the DSP pipelines should be kept
+4
sound/soc/sof/topology.c
··· 407 407 offsetof(struct snd_sof_pcm, stream[0].d0i3_compatible)}, 408 408 {SOF_TKN_STREAM_CAPTURE_COMPATIBLE_D0I3, SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16, 409 409 offsetof(struct snd_sof_pcm, stream[1].d0i3_compatible)}, 410 + {SOF_TKN_STREAM_PLAYBACK_PAUSE_SUPPORTED, SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16, 411 + offsetof(struct snd_sof_pcm, stream[0].pause_supported)}, 412 + {SOF_TKN_STREAM_CAPTURE_PAUSE_SUPPORTED, SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16, 413 + offsetof(struct snd_sof_pcm, stream[1].pause_supported)}, 410 414 }; 411 415 412 416 /* Leds */