[alsa-devel] [RFC PATCH] ASoC: au1x: platform driver restructuring

Mark Brown broonie at opensource.wolfsonmicro.com
Sat Jun 13 19:44:25 CEST 2009


On Sat, Jun 13, 2009 at 05:00:00PM +0200, Manuel Lauss wrote:

> -static int au1xpsc_ac97_suspend(struct snd_soc_dai *dai)
> +static int au1xpsc_ac97_suspend(struct platform_device *pdev, pm_message_t m)
>  {
>  	/* save interesting registers and disable PSC */
>  	au1xpsc_ac97_workdata->pm[0] =
> @@ -328,7 +366,7 @@ static int au1xpsc_ac97_suspend(struct snd_soc_dai *dai)
>  	return 0;
>  }

I'm don't think this is a good idea - it will remove any sequencing
between the suspend of the various ASoC device components, meaning that
the AC97 controller could suspend before the rest of ASoC.  This would
break if ASoC then comes along and tries to suspend the CODEC over an
AC97 link which has been disabled.  With I2S it's probably less serious
but there's a risk of audio issues if the hardware does something dodgy
when suspending or if the SoC is the clock master and the CODEC gets
upset about having clocks stopping when it's using them.

In order to do this properly I have a plan to add a calls into the ASoC
core that the individual drivers can call when they get suspend and
resume calls.  The core will suspend the entire ASoC device when it gets
the first suspend call and will wait for all the suspended devices to
resume before it resumes the ASoC device.  I've not actually added those
calls yet, though.  I can add stubs quickly enough, though - I should
probably do that just now so that we don't need a separate driver
conversion step.

One other thing I'd say is that before registering the DAIs you should
assign the dev field in the DAI structure to be the struct device that
was used to probe the DAI.


More information about the Alsa-devel mailing list