[alsa-devel] [PATCH 07/11] ASoC: tegra: Add tegra-das driver
Stephen Warren
swarren at nvidia.com
Wed Dec 22 19:30:15 CET 2010
Mark Brown wrote:
> On Fri, Dec 17, 2010 at 02:41:26PM -0700, Stephen Warren wrote:
>
> > /*
> > * Terminology:
> > * DAS: Digital audio switch (HW module controlled by this driver)
> > * DAP: Digital audio port (port/pins on Tegra device)
> > * DAC: Digital audio controller (e.g. I2S or AC97 controller elsewhere)
> > *
> > * The Tegra DAS is a mux/cross-bar which can connect each DAP to a specific
> > * DAC, or another DAP. When DAPs are connected, one must be the master and
> > * one the slave. Each DAC allows selection of a specific DAP for input, to
> > * cater for the case where N DAPs are connected to 1 DAC for broadcast
> > * output.
> > *
> > * This driver is dumb; no attempt is made to ensure that a valid routing
> > * configuration is programmed.
> > */
>
> Reading this it's essentially just exporting point to point switches
> within the DAS block. This really feels like it ought to be represented
> as a CODEC driver to give runtime flexibility to userspace to control
> the mux - it looks like the AP part of the system streams data into this
> block which then has very flexible switching on to the externally
> connected audio devices.
Hmm. I don't see any examples of anything like Tegra's DAS in the existing
ASoC code-base. So, I'm slightly unsure how to recast the DAS driver as
a codec. In particular, in the machine driver, would I do something like:
static struct snd_soc_dai_link harmony_i2s_das_link = {
.name = "WM8903",
.stream_name = "WM8903 PCM",
.cpu_dai_name = "tegra-i2s-dai.0",
.platform_name = "tegra-pcm-audio",
.codec_name = "tegra-das.0",
.codec_dai_name = "tegra-das.0-in",
.ops = &harmony_i2s_das_ops,
};
static struct snd_soc_dai_link harmony_das_wm8903_link = {
.cpu_dai_name = "tegra-das.0-out",
.codec_name = "wm8903-codec.0-001a",
.codec_dai_name = "wm8903-hifi",
.ops = &harmony_das_codec_ops,
};
static struct snd_soc_dai_link *harmony_links[] = {
& harmony_i2s_das_link,
& harmony_das_wm8903_link,
};
static struct snd_soc_card snd_soc_harmony = {
.name = "tegra-harmony",
.dai_link = &harmony_links,
.num_links = ARRAY_SIZE(harmony_links),
};
And then re-write the tegra-das driver to expose two DAIs somehow?
Wouldn't that end up exposing two streams to user-space, one for each entry
in harmony_links[]?
--
nvpublic
More information about the Alsa-devel
mailing list