[alsa-devel] [PATCH] ASoC: wm8962: Provide a .hw_free function

Mark Brown broonie at kernel.org
Fri Jul 19 14:45:36 CEST 2013


On Fri, Jul 19, 2013 at 09:18:08AM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam at freescale.com>

> Currently after playing any audio file, we get the following error message:

> $ aplay clarinet.wav 
> Playing WAVE 'clarinet.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
> $ wm8962 0-001a: Unsupported sysclk ratio 544

> This error message appears about 5 seconds after the audio playback has 
> finished.

> In order to avoid such error message, let's add a .hw_free function which will
> zero out wm8962->lrclk and wm8962->bclk, which according to the code below:

> 	if (!wm8962->bclk || !wm8962->lrclk) {
> 		dev_dbg(codec->dev, "No audio clocks configured\n");
> 		return;
> 	}

> ,will cause the wm8962_configure_bclk() function not to search a valid sysclk 
> ratio after playback has finished.

This means that if we start a bypass path the driver won't remember the
last sample rate setting so there's zero chance that we'll come up with
something useful by default.  The issue here is triggered by the machine
switching from the FLL to direct MCLK usage where the MCLK isn't
generating a useful ratio.

I suspect we should just kill the configure_bclk() in set_sysclk(), that
one isn't safe as we can't reconfigure a live SYSCLK and it's probably
the one that generates your warnings.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20130719/2f04b1f0/attachment-0001.sig>


More information about the Alsa-devel mailing list