mainline tlv320aic26 driver
A message that is not in the archive (sent off-list or not yet received): [email protected]
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 fromsocdev->codec_data. I see howaic26_spi_probe()kzalloc's the structure, sets some values inaic26->codec, but I have no idea when you expectedcodec_datawould 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.
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()anddev_get_drvdata()to resolve to the value thatcodec_datashould 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.