asoc: compress: move compress controls to compress_new
Move compress controls to compress_new API to initialize compress related mixer controls. Change-Id: I7038d3c4644d0071477016b186ea0550e92f6214 Signed-off-by: Meng Wang <mengw@codeaurora.org>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

orang tua
cbbff6809b
melakukan
86907313a3
@@ -5621,9 +5621,17 @@ fail:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int msm_compr_new(struct snd_soc_pcm_runtime *rtd)
|
||||
int msm_compr_new(struct snd_soc_pcm_runtime *rtd, int num)
|
||||
{
|
||||
int rc;
|
||||
int rc = 0;
|
||||
|
||||
if (rtd == NULL) {
|
||||
pr_err("%s: RTD is NULL\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
rc = snd_soc_new_compress(rtd, num);
|
||||
if (rc)
|
||||
pr_err("%s: Fail to create pcm for compress\n", __func__);
|
||||
|
||||
rc = msm_compr_add_volume_control(rtd);
|
||||
if (rc)
|
||||
@@ -5677,6 +5685,7 @@ static int msm_compr_new(struct snd_soc_pcm_runtime *rtd)
|
||||
__func__);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(msm_compr_new);
|
||||
|
||||
static struct snd_compr_ops msm_compr_ops = {
|
||||
.open = msm_compr_open,
|
||||
@@ -5699,7 +5708,6 @@ static struct snd_soc_component_driver msm_soc_component = {
|
||||
.name = DRV_NAME,
|
||||
.probe = msm_compr_probe,
|
||||
.compr_ops = &msm_compr_ops,
|
||||
.pcm_new = msm_compr_new,
|
||||
};
|
||||
|
||||
static int msm_compr_dev_probe(struct platform_device *pdev)
|
||||
|
4
asoc/msm-compress-q6-v2.h
Normal file
4
asoc/msm-compress-q6-v2.h
Normal file
@@ -0,0 +1,4 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/* Copyright (c) 2020 The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
int msm_compr_new(struct snd_soc_pcm_runtime *rtd, int num);
|
@@ -12,6 +12,8 @@
|
||||
#include <sound/pcm.h>
|
||||
#include <sound/soc.h>
|
||||
|
||||
#include "msm-compress-q6-v2.h"
|
||||
|
||||
static struct snd_soc_dai_ops msm_fe_dai_ops = {};
|
||||
|
||||
/* Conventional and unconventional sample rate supported */
|
||||
@@ -222,7 +224,7 @@ static struct snd_soc_dai_driver msm_fe_dais[] = {
|
||||
.rate_max = 384000,
|
||||
},
|
||||
.ops = &msm_fe_Multimedia_dai_ops,
|
||||
.compress_new = snd_soc_new_compress,
|
||||
.compress_new = msm_compr_new,
|
||||
.name = "MultiMedia4",
|
||||
.probe = fe_dai_probe,
|
||||
},
|
||||
@@ -308,7 +310,7 @@ static struct snd_soc_dai_driver msm_fe_dais[] = {
|
||||
.rate_max = 384000,
|
||||
},
|
||||
.ops = &msm_fe_Multimedia_dai_ops,
|
||||
.compress_new = snd_soc_new_compress,
|
||||
.compress_new = msm_compr_new,
|
||||
.name = "MultiMedia7",
|
||||
.probe = fe_dai_probe,
|
||||
},
|
||||
@@ -2401,7 +2403,7 @@ static struct snd_soc_dai_driver msm_fe_dais[] = {
|
||||
.rate_max = 384000,
|
||||
},
|
||||
.ops = &msm_fe_Multimedia_dai_ops,
|
||||
.compress_new = snd_soc_new_compress,
|
||||
.compress_new = msm_compr_new,
|
||||
.name = "MultiMedia11",
|
||||
.probe = fe_dai_probe,
|
||||
},
|
||||
@@ -2421,7 +2423,7 @@ static struct snd_soc_dai_driver msm_fe_dais[] = {
|
||||
.rate_max = 384000,
|
||||
},
|
||||
.ops = &msm_fe_Multimedia_dai_ops,
|
||||
.compress_new = snd_soc_new_compress,
|
||||
.compress_new = msm_compr_new,
|
||||
.name = "MultiMedia12",
|
||||
.probe = fe_dai_probe,
|
||||
},
|
||||
@@ -2441,7 +2443,7 @@ static struct snd_soc_dai_driver msm_fe_dais[] = {
|
||||
.rate_max = 384000,
|
||||
},
|
||||
.ops = &msm_fe_Multimedia_dai_ops,
|
||||
.compress_new = snd_soc_new_compress,
|
||||
.compress_new = msm_compr_new,
|
||||
.name = "MultiMedia13",
|
||||
.probe = fe_dai_probe,
|
||||
},
|
||||
@@ -2461,7 +2463,7 @@ static struct snd_soc_dai_driver msm_fe_dais[] = {
|
||||
.rate_max = 384000,
|
||||
},
|
||||
.ops = &msm_fe_Multimedia_dai_ops,
|
||||
.compress_new = snd_soc_new_compress,
|
||||
.compress_new = msm_compr_new,
|
||||
.name = "MultiMedia14",
|
||||
.probe = fe_dai_probe,
|
||||
},
|
||||
@@ -2481,7 +2483,7 @@ static struct snd_soc_dai_driver msm_fe_dais[] = {
|
||||
.rate_max = 384000,
|
||||
},
|
||||
.ops = &msm_fe_Multimedia_dai_ops,
|
||||
.compress_new = snd_soc_new_compress,
|
||||
.compress_new = msm_compr_new,
|
||||
.name = "MultiMedia15",
|
||||
.probe = fe_dai_probe,
|
||||
},
|
||||
@@ -2583,7 +2585,7 @@ static struct snd_soc_dai_driver msm_fe_dais[] = {
|
||||
.rate_max = 192000,
|
||||
},
|
||||
.ops = &msm_fe_Multimedia_dai_ops,
|
||||
.compress_new = snd_soc_new_compress,
|
||||
.compress_new = msm_compr_new,
|
||||
.name = "MultiMedia17",
|
||||
.probe = fe_dai_probe,
|
||||
},
|
||||
@@ -2602,7 +2604,7 @@ static struct snd_soc_dai_driver msm_fe_dais[] = {
|
||||
.rate_max = 192000,
|
||||
},
|
||||
.ops = &msm_fe_Multimedia_dai_ops,
|
||||
.compress_new = snd_soc_new_compress,
|
||||
.compress_new = msm_compr_new,
|
||||
.name = "MultiMedia18",
|
||||
.probe = fe_dai_probe,
|
||||
},
|
||||
@@ -2621,7 +2623,7 @@ static struct snd_soc_dai_driver msm_fe_dais[] = {
|
||||
.rate_max = 192000,
|
||||
},
|
||||
.ops = &msm_fe_Multimedia_dai_ops,
|
||||
.compress_new = snd_soc_new_compress,
|
||||
.compress_new = msm_compr_new,
|
||||
.name = "MultiMedia19",
|
||||
.probe = fe_dai_probe,
|
||||
},
|
||||
@@ -2839,7 +2841,7 @@ static struct snd_soc_dai_driver msm_fe_dais[] = {
|
||||
.rate_max = 384000,
|
||||
},
|
||||
.ops = &msm_fe_Multimedia_dai_ops,
|
||||
.compress_new = snd_soc_new_compress,
|
||||
.compress_new = msm_compr_new,
|
||||
.name = "MultiMedia26",
|
||||
.probe = fe_dai_probe,
|
||||
},
|
||||
@@ -2858,7 +2860,7 @@ static struct snd_soc_dai_driver msm_fe_dais[] = {
|
||||
.rate_max = 192000,
|
||||
},
|
||||
.ops = &msm_fe_Multimedia_dai_ops,
|
||||
.compress_new = snd_soc_new_compress,
|
||||
.compress_new = msm_compr_new,
|
||||
.name = "MultiMedia27",
|
||||
.probe = fe_dai_probe,
|
||||
},
|
||||
@@ -2877,7 +2879,7 @@ static struct snd_soc_dai_driver msm_fe_dais[] = {
|
||||
.rate_max = 192000,
|
||||
},
|
||||
.ops = &msm_fe_Multimedia_dai_ops,
|
||||
.compress_new = snd_soc_new_compress,
|
||||
.compress_new = msm_compr_new,
|
||||
.name = "MultiMedia28",
|
||||
.probe = fe_dai_probe,
|
||||
},
|
||||
@@ -2896,7 +2898,7 @@ static struct snd_soc_dai_driver msm_fe_dais[] = {
|
||||
.rate_max = 192000,
|
||||
},
|
||||
.ops = &msm_fe_Multimedia_dai_ops,
|
||||
.compress_new = snd_soc_new_compress,
|
||||
.compress_new = msm_compr_new,
|
||||
.name = "MultiMedia29",
|
||||
.probe = fe_dai_probe,
|
||||
},
|
||||
@@ -2915,7 +2917,7 @@ static struct snd_soc_dai_driver msm_fe_dais[] = {
|
||||
.rate_max = 192000,
|
||||
},
|
||||
.ops = &msm_fe_Multimedia_dai_ops,
|
||||
.compress_new = snd_soc_new_compress,
|
||||
.compress_new = msm_compr_new,
|
||||
.name = "MultiMedia30",
|
||||
.probe = fe_dai_probe,
|
||||
},
|
||||
|
Reference in New Issue
Block a user