[alsa-devel] Advice on ASoC support for series of boards

Mark Brown broonie at opensource.wolfsonmicro.com
Fri May 15 21:56:53 CEST 2009

On Fri, May 15, 2009 at 08:34:06PM +0100, Ben Dooks wrote:

> Is there a standard method for binding an AMP to an driver, or is it
> necessary to have the AMPs in the driver itself? If not, what would
> people recommend to be the best example of this?

There's several drivers involved in an ASoC system - these things are
generally handled in the machine driver.

For power control for things like amplifiers this is done by providing
an event callback for one of the widgets for an output (eg, a
SND_SOC_DAPM_SPK()) and doing whatever is required to enable or disalbe
the device (usually updating a GPIO) in the callback.  This ensures that
the power control is integrated with DAPM power sequencing.  See the Mic
Jack handling in spitz.c for a mainline example of this.

For non-power control (eg, a mute controlled by a GPIO) a regular
control would be registered by the machine driver - the _EXT() controls
ASoC provides are designed for use here, allowing callbacks to be
registered to update GPIOs or do whatever other changes are required.
Of course, it's also possible to register normal ALSA controls as normal
without any ASoC specific stuff if desired.  Spitz also has some
examples of this.

I'm not sure if that answers your question?

More information about the Alsa-devel mailing list