Skip to contentSkip to conversation

mainline tlv320aic26 driver

DISCUSSION Grant Likely 2 participants 2 messages May 19, 2009 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

BTW, Please cc: the the [email protected] mailing list when asking questions. I don't know everything and others can chime in that way.

Quoted 10 lines · Joey Oravec

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.

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
#2 lore raw
Quoted 4 lines · Grant Likely

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.