[alsa-devel] mainline tlv320aic26 driver

Grant Likely grant.likely at secretlab.ca
Tue May 19 18:09:50 CEST 2009

BTW, Please cc: the the alsa-devel at alsa-project.org mailing list when
asking questions.  I don't know everything and others can chime in
that way.

On Mon, May 18, 2009 at 12:44 PM, Joey Oravec <joravec at drewtech.com> wrote:
> Grant -
> I'm trying to create an ASoC driver for my at91 platform with a tlv320aic26,
> and I have a question about your driver. I'm looking at mainline 2.6.29.
> Inside aic26_probe() it's looking for struct aic26 to from
> socdev->codec_data. I see how aic26_spi_probe() kzalloc's the structure,
> sets some values in aic26->codec, but I have no idea when you expected
> codec_data would get set. Could you briefly explain which function is
> responsible to set that pointer and when it should happen?

Since the aic26 is an SPI device, it is first probed (as you found) in
the aic26_spi_probe() function.  On my platform, the connection
between the codec and the bus driver is described in an OF Flattened
Device Tree and it uses the snd-of-simple driver to match the codec
and platform drivers.  So, the codec_data value is pass via the
of_snd_soc_register_codec() function.

I don't know the best way for your fabric driver to find the aic26 spi
device.  It probably should use bus_find_device() and
dev_get_drvdata() to resolve to the value that codec_data should be
set to.


Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

More information about the Alsa-devel mailing list