[alsa-devel] [PATCH] ASoC: DaVinci: Update suspend/resume support for McASP driver

Sergei Shtylyov sshtylyov at ru.mvista.com
Thu Dec 3 14:00:19 CET 2009


Hello.

Chaithrika U S wrote:

> Add clock enable and disable calls to resume and suspend respectively.
> Also add a member to the audio device data structure which tracks the clock
> status.

> Tested on DA850/OMAP-L138 EVM. For the purpose of testing, the patches[1] which 
> add suspend-to-RAM support to DA850/OMAP-L138 SoC were applied.

> [1] http://linux.davincidsp.com/pipermail/davinci-linux-open-source/
> 2009-November/016958.html

> Signed-off-by: Chaithrika U S <chaithrika at ti.com>
> ---

[...]

> diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
> index 0a302e1..0d263f1 100644
> --- a/sound/soc/davinci/davinci-mcasp.c
> +++ b/sound/soc/davinci/davinci-mcasp.c
> @@ -767,14 +767,27 @@ static int davinci_mcasp_trigger(struct snd_pcm_substream *substream,
>  	int ret = 0;
>  
>  	switch (cmd) {
> -	case SNDRV_PCM_TRIGGER_START:
>  	case SNDRV_PCM_TRIGGER_RESUME:
> +		if (!dev->clk_active) {
> +			clk_enable(dev->clk);
> +			dev->clk_active = 1;
> +		}

   You should add a comment in the cases where *break* is ommitted 
deliberately (if it indeed is), like:

		/* FALL THRU */

> +
> +	case SNDRV_PCM_TRIGGER_START:
>  	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
>  		davinci_mcasp_start(dev, substream->stream);
>  		break;
>  

WBR, Sergei


More information about the Alsa-devel mailing list