summaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-04 22:12:09 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-16 19:36:29 +0100
commitc74184ed30ecce2a5e9ae9aa22cb5e3942e0c7c7 (patch)
tree6d0043cf3b0b7734b8b98dd0d632309d94969c47 /include/sound
parent054880febeb890b24d705240384856ea6b3ccf7b (diff)
downloadlinux-c74184ed30ecce2a5e9ae9aa22cb5e3942e0c7c7.tar.gz
linux-c74184ed30ecce2a5e9ae9aa22cb5e3942e0c7c7.tar.bz2
linux-c74184ed30ecce2a5e9ae9aa22cb5e3942e0c7c7.zip
ASoC: core: Support transparent CODEC<->CODEC DAI links
Rather than having the user half start a stream but avoid any DMA to trigger data flow on links which don't pass through the CPU create a DAPM route between the two DAI widgets using a hw_params configuration provided by the machine driver with the new 'params' member of the dai_link struct. If no configuration is provided in the dai_link then use the old style even for CODEC<->CODEC links to avoid breaking systems. This greatly simplifies the userspace usage of such links, making them as simple as analogue connections with the stream configuration being completely transparent to them. This is achieved by defining a new dai_link widget type which is created when CODECs are linked and triggering the configuration of the link via the normal PCM operations from there. It is expected that the bias level callbacks will be used for clock configuration. Currently only the DAI format, rate and channel count can be configured and currently the only DAI operations which can be called are hw_params and digital_mute(). This corresponds well to the majority of CODEC drivers which only use other callbacks for constraint setting but there is obviously much room for extension here. We can't simply call hw_params() on startup as things like the system clocking configuration may change at runtime and in future it will be desirable to offer some configurability of the link parameters. At present we are also restricted to a single DAPM link for the entire DAI. Once we have better support for channel mapping it would also be desirable to extend this feature so that we can propagate per-channel power state over the link. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/soc-dapm.h6
-rw-r--r--include/sound/soc.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 01e7ad1f3f9d..bea0c8658aa0 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -356,6 +356,10 @@ int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm,
int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
struct snd_soc_dai *dai);
int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card);
+int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
+ const struct snd_soc_pcm_stream *params,
+ struct snd_soc_dapm_widget *source,
+ struct snd_soc_dapm_widget *sink);
/* dapm path setup */
int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm);
@@ -427,6 +431,7 @@ enum snd_soc_dapm_type {
snd_soc_dapm_aif_out, /* audio interface output */
snd_soc_dapm_siggen, /* signal generator */
snd_soc_dapm_dai, /* link to DAI structure */
+ snd_soc_dapm_dai_link, /* link between two DAI structures */
};
enum snd_soc_dapm_subclass {
@@ -485,6 +490,7 @@ struct snd_soc_dapm_widget {
void *priv; /* widget specific data */
struct regulator *regulator; /* attached regulator */
+ const struct snd_soc_pcm_stream *params; /* params for dai links */
/* dapm control */
int reg; /* negative reg = no direct dapm */
diff --git a/include/sound/soc.h b/include/sound/soc.h
index acb57b834e58..afc3204d389b 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -761,6 +761,8 @@ struct snd_soc_dai_link {
const struct device_node *cpu_dai_of_node;
const char *codec_dai_name;
+ const struct snd_soc_pcm_stream *params;
+
unsigned int dai_fmt; /* format to set on init */
/* Keep DAI active over suspend */