Re: [alsa-devel] mainline tlv320aic26 driver
BTW, Please cc: the the alsa-devel@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@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.
g.
On Tue, May 19, 2009 at 10:09:50AM -0600, Grant Likely wrote:
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.
With non-PowerPC platforms that don't use the of-simple bodge the machine driver finds the CODEC by referencing them from the data structures referenced from the snd_soc_device. You don't need to look up the struct device for the CODEC.
For an AT91 example look at the sam9g20_wm8731.c driver - you want to replace the references to the wm8731 DAI and CODEC with those for the tlv320aic26.
participants (2)
-
Grant Likely
-
Mark Brown