From f35f6c67461f20ebaa363a6ff772e890f123c561 Mon Sep 17 00:00:00 2001 From: Ravi Kumar Alamanda Date: Mon, 25 Nov 2013 10:38:40 -0800 Subject: [PATCH] ANDROID: ASoC: Compress: Check and set pcm_new driver op Check and set if pcm_new driver op is initialized by the driver. This allows the compress offload drivers to register mixer controls. Bug: 161413837 Change-Id: If54fa36cf19cbca7239d6e3e30455472e9a173d8 Signed-off-by: Ravi Kumar Alamanda Signed-off-by: Banajit Goswami Signed-off-by: Meng Wang (cherry picked from commit 7ffe0db0148acf460812cc2a8b98fdd46642f1b9) Signed-off-by: Will McVicker --- sound/soc/soc-compress.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index 4e6e9b6463b0..9b1239ba7874 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c @@ -1006,8 +1006,21 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num) rtd->compr = compr; compr->private_data = rtd; + for_each_rtdcom(rtd, rtdcom) { + component = rtdcom->component; + + if (component->driver->pcm_new) { + ret = component->driver->pcm_new(rtd); + if (ret < 0) { + pr_err("asoc: compress pcm constructor failed\n"); + goto compr_err; + } + } + } + dev_info(rtd->card->dev, "Compress ASoC: %s <-> %s mapping ok\n", codec_dai->name, cpu_dai->name); + return ret; compr_err: