[alsa-devel] [PATCH 2/2] ASoC: rename dapm_generic_apply_power()

Mark Brown broonie at opensource.wolfsonmicro.com
Sat Apr 2 09:35:29 CEST 2011

On Sat, Apr 02, 2011 at 03:23:36PM +0800, Lu Guanqun wrote:
> dapm_generic_apply_power() is only called in dapm_seq_run() when w->id is
> snd_soc_dapm_{input|output|hp|line|mic}. So, it's not a generic function at
> all, we better rename it to reflect what it's doing.

I don't think you've really understood what the code is doing here.
While it's true that we don't ever call this function for most widget
types due to the write compression code it is actually the generic
method for applying power changes to a widget in isolation - it does a
register update surrounded by the event callbacks in the appropriate
sequence which really is something that is generic to all widgets.  A
better question if you want to refector the code here would be why these
widgets are treated differently to other widgets.

More information about the Alsa-devel mailing list