[alsa-devel] ASoC: multi-component updates from RFC
I've just pushed some updates to multi-component that came out of the RFC discussion.
The main update is the use of dev_name (or DAI name for devices with multiple DAIs) to identify ASoC components. This replaces the current method of using a struct codec|dai|platform pointer and ID to define a DAI link. e.g. we can now define a DAI link as follows :-
static struct snd_soc_dai_link sdp3430_dai[] = { { .name = "TWL4030 I2S", .stream_name = "TWL4030 Audio", .cpu_dai_name = "omap-mcbsp-dai.1", .codec_dai_name = "twl4030-hifi", .platform_name = "omap-pcm-audio", .codec_name = "twl4030-codec", .init = sdp3430_twl4030_init, .ops = &sdp3430_ops, }, { .name = "TWL4030 PCM", .stream_name = "TWL4030 Voice", .cpu_dai_name = "omap-mcbsp-dai.2", .codec_dai_name = "twl4030-voice", .platform_name = "omap-pcm-audio", .codec_name = "twl4030-codec", .init = sdp3430_twl4030_voice_init, .ops = &sdp3430_voice_ops, }, };
This now means we now no longer have to export all the CODEC | DAI | platform structure symbols around and can keep them static. We also manage to delete a few headers as a result of this change.
Since we are now using dev_name or DAI name (for single devices with multiple DAIs) I've taken the opportunity to standardise the ASoC component naming. It's currently very ad-hoc and platform specific, so I've now added some useful prefixes to help. e.g. So we now have :-
"-codec" prefix for codecs, e.g. "wm8731-codec" "-dai" prefix for CPU DAI's e.g. "pxa-i2s-dai" "-hifi", -"voice", etc for CODEC DAIs e.g. "wm8731-hifi" "-pcm-audio" for platform DMA, e.g. "pxa-pcm-audio" for PXA DMA (although most platform DMA controllers used this anyway).
This naming standard will also come in handy for device tree too.
The only other change I've made is fixing the twl4030 and DAC33 codec probe and remove (as spotted by Peter).
I've also received and applied numerous patches from Jarkko, Timur, Ryan, Chanwoo, Joonyoug, Kyungmin, Jassi and Seungwhan.
The multi-component code can be found here :-
git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6.git topic/multi-component
As usual, please give this some testing (especially ASoC platform maintainers) and if all is OK we can upstream some time next week (or the week after).
Thanks
Liam
Hello Liam,
On Wednesday 21 July 2010 15:31:30 ext Liam Girdwood wrote:
...
The only other change I've made is fixing the twl4030 and DAC33 codec probe and remove (as spotted by Peter).
I'm in the process of checking the changes. For the twl4030 I have spotted the following: 1. twl-core registers "twl4030_codec" platform device. 2. The driver for this is the drivers/mfd/twl4030-codec.c 3. this MFD driver registers the following platform devices: twl4030_codec_audio twl4030_codec_vibra 4. the sound/soc/codecs/twl4030.c is the twl4030_codec_audio driver 5. the drivers/input/misc/twl4030-vibra.c is the twl4030_codec_vibra driver Note: the platform data is propagated from board files to mfd/twl4030-codec.c, than this mfd driver passes the appropriate platform data to the soc codec, and vibra driver.
The codec part of twl40x0, twl50x0 has vibra and audio functionality, and they have interoperability problems (sharing the same resources).
The name for the drivers/mfd/twl4030-codec.c is chosen, because the TRM refers to this block as codec (audio + vibra). We could go, and rename however this mfd driver to twl4030-audio (since the TRM randomly refers to audio block instead of codec). Than we can have twl4030-codec as device name for the soc codec, and twl4030- vibra for the vibra.
I'll continue on checking the changes...
On Thu, 2010-07-22 at 09:27 +0300, Peter Ujfalusi wrote:
Hello Liam,
On Wednesday 21 July 2010 15:31:30 ext Liam Girdwood wrote:
...
The only other change I've made is fixing the twl4030 and DAC33 codec probe and remove (as spotted by Peter).
I'm in the process of checking the changes. For the twl4030 I have spotted the following:
- twl-core registers "twl4030_codec" platform device.
- The driver for this is the drivers/mfd/twl4030-codec.c
- this MFD driver registers the following platform devices: twl4030_codec_audio twl4030_codec_vibra
- the sound/soc/codecs/twl4030.c is the twl4030_codec_audio driver
Ah, I didn't see that part. I'll revert the twl-core name change.
- the drivers/input/misc/twl4030-vibra.c is the twl4030_codec_vibra driver
Note: the platform data is propagated from board files to mfd/twl4030-codec.c, than this mfd driver passes the appropriate platform data to the soc codec, and vibra driver.
The codec part of twl40x0, twl50x0 has vibra and audio functionality, and they have interoperability problems (sharing the same resources).
I'm actually looking into the interop problems later as twl6040 + vibra has the same issues.
The name for the drivers/mfd/twl4030-codec.c is chosen, because the TRM refers to this block as codec (audio + vibra). We could go, and rename however this mfd driver to twl4030-audio (since the TRM randomly refers to audio block instead of codec). Than we can have twl4030-codec as device name for the soc codec, and twl4030- vibra for the vibra.
Agreed, I'll make that change.
I'll continue on checking the changes...
Thanks
Liam
On Thu, 2010-07-22 at 09:18 +0100, Liam Girdwood wrote:
On Thu, 2010-07-22 at 09:27 +0300, Peter Ujfalusi wrote:
The name for the drivers/mfd/twl4030-codec.c is chosen, because the TRM refers to this block as codec (audio + vibra). We could go, and rename however this mfd driver to twl4030-audio (since the TRM randomly refers to audio block instead of codec). Than we can have twl4030-codec as device name for the soc codec, and twl4030- vibra for the vibra.
Agreed, I'll make that change.
Pushed to git. I also fixed a naming bug in the mcbsp DAI devices too.
Liam
participants (2)
-
Liam Girdwood
-
Peter Ujfalusi