[alsa-devel] [RFC don't apply] ASoC: Add support for optional auxiliary dailess codecs

Jarkko Nikula jhnikula at gmail.com
Fri Nov 26 08:25:24 CET 2010

On Thu, 25 Nov 2010 21:32:54 +0000
Mark Brown <broonie at opensource.wolfsonmicro.com> wrote:

> On Thu, Nov 25, 2010 at 07:18:23PM +0000, Liam Girdwood wrote:
> > On Thu, 2010-11-25 at 17:47 +0200, Jarkko Nikula wrote:
> > > +	struct snd_soc_aux_dev *aux_dev;
> > > +	int num_aux_devs;
> > > +	struct snd_soc_pcm_runtime *rtd_aux;
> > > +	int num_aux_rtd;
> > Could we not just make this a new component type and have a list of aux
> > devices ?
> I'd certainly rather we didn't have to deal with the PCM runtime data
> since obviously the main feature of these things is that there's no PCM
> involved.  Need to review this properly to remind myself why we're doing
> this...
Exactly, that was the part I didn't like myself either. Only use for
rtd here is to hold struct device for virtual device creation
under /sys/devices/platform/soc-audio and share the use of
codec_reg_show and dapm_widget_show functions.

Probably something like below can be used as a common struct device
holder and carry either rtd or dapm to sysfs functions. E.g. in
dapm_widget_show we would be accessing the dapm and rtd in

struct foo {
	struct device dev;
	union {
		struct snd_soc_pcm_runtime *rtd;
		struct snd_soc_dapm_context *dapm;
	} context;

> > Why do aux devices need to be coupled with CODECs here ? 
> The way we've got things set up currently the CODEC isn't really just a
> CODEC, it's got a bunch of other random services which are more generic
> chip services associated with it like the register cache and the bias
> management.  There's so much overlap between the devices that I'm not
> sure that it's really worth splitting the types up too much at the root
> level (CODEC is pretty much a superclass that has everything on it but
> DMA).
> Given how widely used snd_soc_codec is I'm not sure it's worth fixing
> the naming thing here, especially since 99% of the time the device is
> actually a CODEC.

And codecs can be used as an amplifer only by not connecting the DAI.
Like if codec chip is cheaper or better available than amplifier or if
multicodec package saves board space compared to separate codec and
amplifier chips.

If I counted correctly we have currently only three amplifier drivers:
tpa6130a2.c, wm2000.c and wm9090.c so separation doesn't sound worth of
trouble at this point as the core serves well those cases also.


More information about the Alsa-devel mailing list