From: Timur Tabi <timur@freescale.com>
To: alsa-devel@alsa-project.org
Subject: ASOC: Best way to get private data from machine driver to the other drivers?
Date: Fri, 28 Sep 2007 16:14:18 -0500 [thread overview]
Message-ID: <46FD6EAA.5050801@freescale.com> (raw)
I'm writing an ASOC driver. When my machine driver loads, it determines some
hardware information for the DMA controllers, some other hardware information
for the I2S controller, and even more information for the codec.
I want to be able to pass all this information to each of the three other
drivers. Unfortunately, it doesn't appear that I have enough "private_data"
pointers available to me.
The current ASOC drivers all use statically defined global structures and
indexes into arrays of these structures to identify individual devices, such
associating I2S controller #2 with DMA channels 3 and 4. On PowerPC, this
doesn't work. The actual hardware configuration is determined at runtime (see
arch/powerpc/boot/dts/), and so the machine driver needs to collect all the
information and make all the device-to-device associations.
For example, the PCM driver has an open function:
static struct snd_pcm_ops fsl_dma_ops = {
.open = fsl_dma_open,
...
static int fsl_dma_open(struct snd_pcm_substream *substream)
{
...
What I would like is for fsl_dma_open() to be able to obtain pointers to the
DMA controller's registers (there are two controllers with 4 channels each) by
looking inside 'substream'. How can I do that?
--
Timur Tabi
Linux Kernel Developer @ Freescale
next reply other threads:[~2007-09-28 21:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-28 21:14 Timur Tabi [this message]
2007-10-01 10:53 ` ASOC: Best way to get private data from machine driver to the other drivers? Liam Girdwood
2007-10-01 20:10 ` Timur Tabi
2007-10-02 16:40 ` Liam Girdwood
2007-10-02 16:49 ` Timur Tabi
2007-10-02 16:50 ` Timur Tabi
2007-10-01 21:49 ` Timur Tabi
2007-10-02 16:37 ` Liam Girdwood
2007-10-02 16:48 ` Timur Tabi
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=46FD6EAA.5050801@freescale.com \
--to=timur@freescale.com \
--cc=alsa-devel@alsa-project.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.