ASoC: msm: Fix adding channel mixer control failure issue
Add channel mixer control according to device direction defined in dai_link. Change-Id: I93db385f95334f168427a734459a8707df61ba7c Signed-off-by: Cong Tang <congt@codeaurora.org>
This commit is contained in:
parent
c3b8576cf9
commit
b6a23b8350
2 changed files with 144 additions and 88 deletions
|
@ -1077,6 +1077,15 @@ static int msm_pcm_add_channel_mixer_output_map_controls(
|
|||
channel_mixer_output_map_control[0].name = playback_mixer_str;
|
||||
channel_mixer_output_map_control[0].private_value =
|
||||
(rtd->dai_link->be_id) | (session_type << 8);
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
&channel_mixer_output_map_control[0],
|
||||
1);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream != NULL) {
|
||||
|
@ -1094,17 +1103,15 @@ static int msm_pcm_add_channel_mixer_output_map_controls(
|
|||
channel_mixer_output_map_control[1].name = capture_mixer_str;
|
||||
channel_mixer_output_map_control[1].private_value =
|
||||
(rtd->dai_link->be_id) | (session_type << 8);
|
||||
}
|
||||
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
channel_mixer_output_map_control,
|
||||
ARRAY_SIZE
|
||||
(channel_mixer_output_map_control));
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
&channel_mixer_output_map_control[1],
|
||||
1);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
|
@ -1172,6 +1179,15 @@ static int msm_pcm_add_channel_mixer_input_map_controls(
|
|||
channel_mixer_input_map_control[0].name = playback_mixer_str;
|
||||
channel_mixer_input_map_control[0].private_value =
|
||||
(rtd->dai_link->be_id) | (session_type << 8);
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
&channel_mixer_input_map_control[0],
|
||||
1);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream != NULL) {
|
||||
|
@ -1189,17 +1205,15 @@ static int msm_pcm_add_channel_mixer_input_map_controls(
|
|||
channel_mixer_input_map_control[1].name = capture_mixer_str;
|
||||
channel_mixer_input_map_control[1].private_value =
|
||||
(rtd->dai_link->be_id) | (session_type << 8);
|
||||
}
|
||||
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
channel_mixer_input_map_control,
|
||||
ARRAY_SIZE
|
||||
(channel_mixer_input_map_control));
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
&channel_mixer_input_map_control[1],
|
||||
1);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
|
@ -1278,6 +1292,15 @@ static int msm_pcm_add_channel_mixer_cfg_controls(
|
|||
channel_mixer_cfg_control[0].name = playback_mixer_str;
|
||||
channel_mixer_cfg_control[0].private_value =
|
||||
(rtd->dai_link->be_id) | (session_type << 8);
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
&channel_mixer_cfg_control[0],
|
||||
1);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream != NULL) {
|
||||
|
@ -1295,17 +1318,15 @@ static int msm_pcm_add_channel_mixer_cfg_controls(
|
|||
channel_mixer_cfg_control[1].name = capture_mixer_str;
|
||||
channel_mixer_cfg_control[1].private_value =
|
||||
(rtd->dai_link->be_id) | (session_type << 8);
|
||||
}
|
||||
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
channel_mixer_cfg_control,
|
||||
ARRAY_SIZE
|
||||
(channel_mixer_cfg_control));
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
&channel_mixer_cfg_control[1],
|
||||
1);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
|
@ -1378,6 +1399,15 @@ static int msm_pcm_add_channel_mixer_weight_controls(
|
|||
channel_mixer_weight_control[0].private_value =
|
||||
(rtd->dai_link->be_id) | (session_type << 8)
|
||||
| (channel << 16);
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
&channel_mixer_weight_control[0],
|
||||
1);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream != NULL) {
|
||||
|
@ -1398,17 +1428,15 @@ static int msm_pcm_add_channel_mixer_weight_controls(
|
|||
channel_mixer_weight_control[1].private_value =
|
||||
(rtd->dai_link->be_id) | (session_type << 8)
|
||||
| (channel << 16);
|
||||
}
|
||||
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
channel_mixer_weight_control,
|
||||
ARRAY_SIZE
|
||||
(channel_mixer_weight_control));
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
&channel_mixer_weight_control[1],
|
||||
1);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
|
|
|
@ -2459,6 +2459,15 @@ static int msm_pcm_add_channel_mixer_output_map_controls(
|
|||
channel_mixer_output_map_control[0].name = playback_mixer_str;
|
||||
channel_mixer_output_map_control[0].private_value =
|
||||
(rtd->dai_link->be_id) | (session_type << 8);
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
&channel_mixer_output_map_control[0],
|
||||
1);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream != NULL) {
|
||||
|
@ -2476,17 +2485,15 @@ static int msm_pcm_add_channel_mixer_output_map_controls(
|
|||
channel_mixer_output_map_control[1].name = capture_mixer_str;
|
||||
channel_mixer_output_map_control[1].private_value =
|
||||
(rtd->dai_link->be_id) | (session_type << 8);
|
||||
}
|
||||
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
channel_mixer_output_map_control,
|
||||
ARRAY_SIZE
|
||||
(channel_mixer_output_map_control));
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
&channel_mixer_output_map_control[1],
|
||||
1);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
|
@ -2554,6 +2561,15 @@ static int msm_pcm_add_channel_mixer_input_map_controls(
|
|||
channel_mixer_input_map_control[0].name = playback_mixer_str;
|
||||
channel_mixer_input_map_control[0].private_value =
|
||||
(rtd->dai_link->be_id) | (session_type << 8);
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
&channel_mixer_input_map_control[0],
|
||||
1);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream != NULL) {
|
||||
|
@ -2571,17 +2587,15 @@ static int msm_pcm_add_channel_mixer_input_map_controls(
|
|||
channel_mixer_input_map_control[1].name = capture_mixer_str;
|
||||
channel_mixer_input_map_control[1].private_value =
|
||||
(rtd->dai_link->be_id) | (session_type << 8);
|
||||
}
|
||||
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
channel_mixer_input_map_control,
|
||||
ARRAY_SIZE
|
||||
(channel_mixer_input_map_control));
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
&channel_mixer_input_map_control[1],
|
||||
1);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
|
@ -2660,6 +2674,15 @@ static int msm_pcm_add_channel_mixer_cfg_controls(
|
|||
channel_mixer_cfg_control[0].name = playback_mixer_str;
|
||||
channel_mixer_cfg_control[0].private_value =
|
||||
(rtd->dai_link->be_id) | (session_type << 8);
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
&channel_mixer_cfg_control[0],
|
||||
1);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream != NULL) {
|
||||
|
@ -2677,17 +2700,15 @@ static int msm_pcm_add_channel_mixer_cfg_controls(
|
|||
channel_mixer_cfg_control[1].name = capture_mixer_str;
|
||||
channel_mixer_cfg_control[1].private_value =
|
||||
(rtd->dai_link->be_id) | (session_type << 8);
|
||||
}
|
||||
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
channel_mixer_cfg_control,
|
||||
ARRAY_SIZE
|
||||
(channel_mixer_cfg_control));
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
&channel_mixer_cfg_control[1],
|
||||
1);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
|
@ -2760,6 +2781,15 @@ static int msm_pcm_add_channel_mixer_weight_controls(
|
|||
channel_mixer_weight_control[0].private_value =
|
||||
(rtd->dai_link->be_id) | (session_type << 8)
|
||||
| (channel << 16);
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
&channel_mixer_weight_control[0],
|
||||
1);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream != NULL) {
|
||||
|
@ -2780,17 +2810,15 @@ static int msm_pcm_add_channel_mixer_weight_controls(
|
|||
channel_mixer_weight_control[1].private_value =
|
||||
(rtd->dai_link->be_id) | (session_type << 8)
|
||||
| (channel << 16);
|
||||
}
|
||||
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
channel_mixer_weight_control,
|
||||
ARRAY_SIZE
|
||||
(channel_mixer_weight_control));
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
&channel_mixer_weight_control[1],
|
||||
1);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed add platform ctl, err = %d\n",
|
||||
__func__, ret);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
|
|
Loading…
Add table
Reference in a new issue