mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 07:37:31 -04:00
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>
This commit is contained in:
parent
bbb641427b
commit
3693b6559c
2 changed files with 13 additions and 1 deletions
|
|
@ -14826,16 +14826,20 @@ static int msm_routing_put_lsm_app_type_cfg_control(
|
|||
struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
int shift = ((struct soc_multi_mixer_control *)
|
||||
kcontrol->private_value)->shift;
|
||||
int i = 0, j;
|
||||
int num_app_types = ucontrol->value.integer.value[i++];
|
||||
|
||||
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) {
|
||||
pr_err("%s: number of app types exceed the max supported\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
for (j = 0; j < num_app_types; j++) {
|
||||
lsm_app_type_cfg[j].app_type =
|
||||
ucontrol->value.integer.value[i++];
|
||||
|
|
@ -14843,6 +14847,10 @@ static int msm_routing_put_lsm_app_type_cfg_control(
|
|||
ucontrol->value.integer.value[i++];
|
||||
lsm_app_type_cfg[j].bit_width =
|
||||
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;
|
||||
|
|
@ -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,
|
||||
0xFFFFFFFF, 0, 128, msm_routing_get_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(
|
||||
|
|
|
|||
|
|
@ -500,6 +500,7 @@ struct msm_pcm_routing_app_type_data {
|
|||
int app_type;
|
||||
u32 sample_rate;
|
||||
int bit_width;
|
||||
u32 num_out_channels;
|
||||
};
|
||||
|
||||
struct msm_pcm_stream_app_type_cfg {
|
||||
|
|
|
|||
Loading…
Reference in a new issue