ASoC: add compress stream support

This patch adds the support to parse the compress dai's and then also adds the
soc-compress.c file while handles the compress stream operations, mostly analogus
to what is done in the soc-pcm.c and aditional handling of the compress
opertaions

Signed-off-by: Namarta Kohli <namartax.kohli@intel.com>
Signed-off-by: Ramesh Babu K V <ramesh.babu@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Namarta Kohli
2012-08-16 17:10:41 +05:30
committed by Mark Brown
parent 4968107786
commit 1245b7005d
4 changed files with 332 additions and 25 deletions

View File

@ -1388,37 +1388,48 @@ static int soc_probe_link_dais(struct snd_soc_card *card, int num, int order)
if (ret < 0)
pr_warn("asoc: failed to add pmdown_time sysfs:%d\n", ret);
if (!dai_link->params) {
/* create the pcm */
ret = soc_new_pcm(rtd, num);
if (cpu_dai->driver->compress_dai) {
/*create compress_device"*/
ret = soc_new_compress(rtd, num);
if (ret < 0) {
pr_err("asoc: can't create pcm %s :%d\n",
dai_link->stream_name, ret);
pr_err("asoc: can't create compress %s\n",
dai_link->stream_name);
return ret;
}
} else {
/* link the DAI widgets */
play_w = codec_dai->playback_widget;
capture_w = cpu_dai->capture_widget;
if (play_w && capture_w) {
ret = snd_soc_dapm_new_pcm(card, dai_link->params,
capture_w, play_w);
if (ret != 0) {
dev_err(card->dev, "Can't link %s to %s: %d\n",
play_w->name, capture_w->name, ret);
if (!dai_link->params) {
/* create the pcm */
ret = soc_new_pcm(rtd, num);
if (ret < 0) {
pr_err("asoc: can't create pcm %s :%d\n",
dai_link->stream_name, ret);
return ret;
}
}
play_w = cpu_dai->playback_widget;
capture_w = codec_dai->capture_widget;
if (play_w && capture_w) {
ret = snd_soc_dapm_new_pcm(card, dai_link->params,
} else {
/* link the DAI widgets */
play_w = codec_dai->playback_widget;
capture_w = cpu_dai->capture_widget;
if (play_w && capture_w) {
ret = snd_soc_dapm_new_pcm(card, dai_link->params,
capture_w, play_w);
if (ret != 0) {
dev_err(card->dev, "Can't link %s to %s: %d\n",
play_w->name, capture_w->name, ret);
return ret;
if (ret != 0) {
dev_err(card->dev, "Can't link %s to %s: %d\n",
play_w->name, capture_w->name, ret);
return ret;
}
}
play_w = cpu_dai->playback_widget;
capture_w = codec_dai->capture_widget;
if (play_w && capture_w) {
ret = snd_soc_dapm_new_pcm(card, dai_link->params,
capture_w, play_w);
if (ret != 0) {
dev_err(card->dev, "Can't link %s to %s: %d\n",
play_w->name, capture_w->name, ret);
return ret;
}
}
}
}