[alsa-devel] [PATCH v3 11/14] ASoC: SOF: Add PM support

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Wed Dec 12 17:08:01 CET 2018


On 12/12/18 5:32 AM, Takashi Iwai wrote:
> On Tue, 11 Dec 2018 22:23:15 +0100,
> Pierre-Louis Bossart wrote:
>> +#define RUNTIME_PM 1
> What's this?  This seems used in snd_soc_runtime_suspend() and
> _resume().  But it's a just normal boolean flag, no?

yes, it's useless. I saw it in one of my checks and forgot about it, 
will fix.

>
>> +static void sof_suspend_streams(struct snd_sof_dev *sdev)
>> +{
>> +	struct snd_sof_pcm *spcm;
>> +	struct snd_pcm_substream *substream;
>> +	int dir;
>> +
>> +	/* suspend all running streams */
>> +	list_for_each_entry(spcm, &sdev->pcm_list, list) {
>> +
>> +		mutex_lock(&spcm->mutex);
>> +
>> +		/* suspend running playback stream */
>> +		dir = SNDRV_PCM_STREAM_PLAYBACK;
>> +		substream = spcm->stream[dir].substream;
>> +
>> +		if (substream && substream->runtime) {
>> +
>> +			snd_pcm_suspend(substream);
>> +
>> +			/*
>> +			 * set restore_stream so that hw_params can be
>> +			 * restored during resume
>> +			 */
>> +			spcm->restore_stream[dir] = 1;
>> +		}
>> +
>> +		/* suspend running capture stream */
>> +		dir = SNDRV_PCM_STREAM_CAPTURE;
>> +		substream = spcm->stream[dir].substream;
>> +
>> +		if (substream && substream->runtime) {
>> +
>> +			snd_pcm_suspend(substream);
>> +
>> +			/*
>> +			 * set restore_stream so that hw_params can be
>> +			 * restored during resume
>> +			 */
>> +			spcm->restore_stream[dir] = 1;
>> +		}
> Both playback and capture do the same thing, so this can be a loop of
> dir.
yes, valid point, will fix.
>
>
> thanks,
>
> Takashi
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel


More information about the Alsa-devel mailing list