asoc: msm-pcm-routing: add Listen app type config v2 mixer control

It is required to know the number of output channels for any
particular app_type so that channel mixing can be performed
if the channels do not match as that of the listen stream.
Add new Listen app type config V2 mixer control that reads the
num_out_channels field along with the others.

Change-Id: I49a74004e12dfa5a4c1ebaac4ac065acc6ff5bc3
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
此提交包含在:
Bhalchandra Gajare
2018-05-12 18:52:56 -07:00
提交者 Gerrit - the friendly Code Review server
父節點 bbb641427b
當前提交 3693b6559c
共有 2 個檔案被更改,包括 13 行新增1 行删除

查看文件

@@ -14826,16 +14826,20 @@ static int msm_routing_put_lsm_app_type_cfg_control(
struct snd_kcontrol *kcontrol, struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
int shift = ((struct soc_multi_mixer_control *)
kcontrol->private_value)->shift;
int i = 0, j; int i = 0, j;
int num_app_types = ucontrol->value.integer.value[i++]; int num_app_types = ucontrol->value.integer.value[i++];
memset(lsm_app_type_cfg, 0, MAX_APP_TYPES* memset(lsm_app_type_cfg, 0, MAX_APP_TYPES*
sizeof(struct msm_pcm_routing_app_type_data)); sizeof(struct msm_pcm_routing_app_type_data));
if (num_app_types > MAX_APP_TYPES) { if (num_app_types > MAX_APP_TYPES) {
pr_err("%s: number of app types exceed the max supported\n", pr_err("%s: number of app types exceed the max supported\n",
__func__); __func__);
return -EINVAL; return -EINVAL;
} }
for (j = 0; j < num_app_types; j++) { for (j = 0; j < num_app_types; j++) {
lsm_app_type_cfg[j].app_type = lsm_app_type_cfg[j].app_type =
ucontrol->value.integer.value[i++]; ucontrol->value.integer.value[i++];
@@ -14843,6 +14847,10 @@ static int msm_routing_put_lsm_app_type_cfg_control(
ucontrol->value.integer.value[i++]; ucontrol->value.integer.value[i++];
lsm_app_type_cfg[j].bit_width = lsm_app_type_cfg[j].bit_width =
ucontrol->value.integer.value[i++]; ucontrol->value.integer.value[i++];
/* Shift of 1 indicates this is V2 mixer control */
if (shift == 1)
lsm_app_type_cfg[j].num_out_channels =
ucontrol->value.integer.value[i++];
} }
return 0; return 0;
@@ -14852,6 +14860,9 @@ static const struct snd_kcontrol_new lsm_app_type_cfg_controls[] = {
SOC_SINGLE_MULTI_EXT("Listen App Type Config", SND_SOC_NOPM, 0, SOC_SINGLE_MULTI_EXT("Listen App Type Config", SND_SOC_NOPM, 0,
0xFFFFFFFF, 0, 128, msm_routing_get_lsm_app_type_cfg_control, 0xFFFFFFFF, 0, 128, msm_routing_get_lsm_app_type_cfg_control,
msm_routing_put_lsm_app_type_cfg_control), msm_routing_put_lsm_app_type_cfg_control),
SOC_SINGLE_MULTI_EXT("Listen App Type Config V2", SND_SOC_NOPM, 1,
0xFFFFFFFF, 0, 128, msm_routing_get_lsm_app_type_cfg_control,
msm_routing_put_lsm_app_type_cfg_control),
}; };
static int msm_routing_get_use_ds1_or_ds2_control( static int msm_routing_get_use_ds1_or_ds2_control(

查看文件

@@ -500,6 +500,7 @@ struct msm_pcm_routing_app_type_data {
int app_type; int app_type;
u32 sample_rate; u32 sample_rate;
int bit_width; int bit_width;
u32 num_out_channels;
}; };
struct msm_pcm_stream_app_type_cfg { struct msm_pcm_stream_app_type_cfg {