[alsa-devel] [PATCH] ASoC: dapm: Fix the unpaired runtime_get/put cases

Mark Brown broonie at opensource.wolfsonmicro.com
Wed Dec 19 10:11:27 CET 2012


On Wed, Dec 19, 2012 at 06:36:37PM +0800, Chuansheng Liu wrote:

> But some devices has been set to STANDY bias directly during device probing,
> such as cs42l73_probe():
> cs42l73_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

> Then it will cause runtime_get() not be called but laterly runtime_put() will
> be called. Also found some other uppaired cases.

This is just a bug in the driver, if it's idle_bias_off then it really
should be starting in _OFF or at the very least starting actually in
_STANDBY (including taking the runtime reference) rather than partially
in _STANDBY.

> So here add new flag get_runtime, and the logic will be:
> 1/ when device is from off to non-off bias, runtime_get() will be called if not yet;
> 2/ When device is off bias, runtime_put() will be called if runtime_get() has
>    been called;

This is really not a good idea at all, it's just adding new special
cases and making the code more obscure.
-------------- 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/20121219/ff6b2a43/attachment.sig>


More information about the Alsa-devel mailing list