[alsa-devel] [PATCH] ASoC: Clarify API for bias configuration
Jarkko Nikula
jarkko.nikula at nokia.com
Mon May 19 16:15:58 CEST 2008
On Mon, 19 May 2008 11:20:39 +0100
"ext Mark Brown" <broonie at opensource.wolfsonmicro.com> wrote:
> Currently the ASoC core configures the bias levels in the system using
> a callback on codecs and machines called "dapm_event", passing it PCI
> style power levels as SNDRV_CTL_POWER_ constants. This is more obscure
> than it needs to be and has caused confusion to driver authors,
> especially given that DAPM is also performing power management.
>
> Address this by renaming the callback function to "set_bias_level" and
> using constants explicitly representing the off, standby, pre-on and
> on states which DAPM transitions through.
>
First impression: Is that somewhat confusing to refer power state event
as a bias level? First what comes to my is this related to mic bias...
If there's a need to change name of dapm_event callback, probably some
dapm_device_event etc. would be better if need to separate from other
dapm events?
> --- a/include/sound/soc.h
> +++ b/include/sound/soc.h
> +enum snd_soc_bias_level {
> + SND_SOC_BIAS_ON,
> + SND_SOC_BIAS_PREPARE,
> + SND_SOC_BIAS_STANDBY,
> + SND_SOC_BIAS_OFF,
Yeah, those SNDRV_CTL_POWER_ constants are not so clear and I think
some more meaningful naming like here would be better.
Jarkko
More information about the Alsa-devel
mailing list