From: Timur Tabi <timur@freescale.com>
To: Liam Girdwood <lg@opensource.wolfsonmicro.com>,
alsa-devel@alsa-project.org
Subject: Question on snd_soc_dai_link
Date: Fri, 25 May 2007 16:55:10 -0500 [thread overview]
Message-ID: <46575B3E.2020603@freescale.com> (raw)
I have a question about these DAI structs for ASoC.
Let's take eti_b1_wm8731.c as an example. It contains this structure:
static struct snd_soc_dai_link eti_b1_dai = {
.name = "WM8731",
.stream_name = "WM8731",
.cpu_dai = &at91_i2s_dai[1],
.codec_dai = &wm8731_dai,
.init = eti_b1_wm8731_init,
.ops = &eti_b1_ops,
};
Notice that the .cpu_dai field is hard-coded to use the 2nd I2S device on the AT91.
The problem I'm having with this approach is that everything is hard-coded. On PowerPC,
this approach doesn't work well, because we have a "device tree" that dictates what
devices are present on the SOC.
For a Freescale SOC that has two I2S devices (for example), both devices would be listed
in the device tree, with the base address of the memory-mapped registers. This means that
a Freescale I2S driver would have its 'probe' function called (much like PCI does) each
time the kernel processes an I2S node in the device tree.
This means that when the machine driver (which has the snd_soc_dai_link structure) loads,
there's no guarantee that the I2S driver has also loaded and the probe functions have been
called. It gets even more complicated if only one I2S device has a codec connected to it,
because then I need to kmalloc the snd_soc_cpu_dai structures and somehow tell the
snd_soc_dai_link structure which one to use.
Has any thought been given to making these structures more dynamic and handling
interdependencies among the drivers? As it stands now, it looks like I'm going to have to
hard-code everything in the drivers and break the device tree paradigm.
--
Timur Tabi
Linux Kernel Developer @ Freescale
next reply other threads:[~2007-05-25 21:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-25 21:55 Timur Tabi [this message]
2007-05-28 12:19 ` Question on snd_soc_dai_link Liam Girdwood
2007-05-29 1:36 ` Timur Tabi
2007-05-29 14:19 ` Liam Girdwood
2007-05-29 14:36 ` Timur Tabi
2007-05-29 14:51 ` Liam Girdwood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46575B3E.2020603@freescale.com \
--to=timur@freescale.com \
--cc=alsa-devel@alsa-project.org \
--cc=lg@opensource.wolfsonmicro.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).