]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: Hold runtime PM references to components of active DAIs
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 3 Dec 2011 20:14:31 +0000 (20:14 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 8 Dec 2011 01:21:45 +0000 (09:21 +0800)
commit4b88f0dd8313dab8ff64c0c430817dfe04eb31ed
tree874dcde67ec2f2681a588047afed8a3aebb67c51
parent2194a8531df70cb48547d28f4699d648e72fdbe8
ASoC: Hold runtime PM references to components of active DAIs

Every device that implements runtime power management for DAIs is doing
it in pretty much the same way: in the startup callback they take a
runtime PM reference and then in the shutdown callback they release that
reference, keeping the device active while the DAI is active. Given the
frequency with which this is done and the obviousness of the need to keep
the device active in this period factor the code out into the core, taking
references on the device for each CPU DAI, CODEC DAI and DMA device in the
core.

As runtime PM is reference counted this shouldn't interfere with any
other reference holding by the drivers, and since (in common with the
existing implementations) we don't check for errors on enabling it
shouldn't matter if the device actually has runtime PM enabled or not.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
sound/soc/soc-pcm.c