Loading sound/soc/msm/qdsp6v2/msm-qti-pp-config.c +36 −1 Original line number Diff line number Diff line /* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -597,6 +597,32 @@ static int msm_qti_pp_put_channel_map_mixer(struct snd_kcontrol *kcontrol, return 0; } static int msm_qti_pp_get_channel_map_capture(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { char channel_map[PCM_FORMAT_MAX_NUM_CHANNEL] = {0}; int i; adm_get_multi_ch_map(channel_map, ADM_PATH_LIVE_REC); for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL; i++) ucontrol->value.integer.value[i] = (unsigned int) channel_map[i]; return 0; } static int msm_qti_pp_put_channel_map_capture(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { char channel_map[PCM_FORMAT_MAX_NUM_CHANNEL]; int i; for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL; i++) channel_map[i] = (char)(ucontrol->value.integer.value[i]); adm_set_multi_ch_map(channel_map, ADM_PATH_LIVE_REC); return 0; } /* Audio Sphere functions */ static void msm_qti_pp_asphere_init_state(void) Loading Loading @@ -862,6 +888,11 @@ static const struct snd_kcontrol_new multi_ch_channel_map_mixer_controls[] = { msm_qti_pp_put_channel_map_mixer), }; static const struct snd_kcontrol_new multi_ch_channel_map_capture_controls[] = { SOC_SINGLE_MULTI_EXT("Capture Device Channel Map", SND_SOC_NOPM, 0, 16, 0, PCM_FORMAT_MAX_NUM_CHANNEL, msm_qti_pp_get_channel_map_capture, msm_qti_pp_put_channel_map_capture), }; static const struct snd_kcontrol_new get_rms_controls[] = { SOC_SINGLE_EXT("Get RMS", SND_SOC_NOPM, 0, 0xFFFFFFFF, Loading Loading @@ -1043,6 +1074,10 @@ void msm_qti_pp_add_controls(struct snd_soc_platform *platform) multi_ch_channel_map_mixer_controls, ARRAY_SIZE(multi_ch_channel_map_mixer_controls)); snd_soc_add_platform_controls(platform, multi_ch_channel_map_capture_controls, ARRAY_SIZE(multi_ch_channel_map_capture_controls)); snd_soc_add_platform_controls(platform, get_rms_controls, ARRAY_SIZE(get_rms_controls)); Loading Loading
sound/soc/msm/qdsp6v2/msm-qti-pp-config.c +36 −1 Original line number Diff line number Diff line /* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -597,6 +597,32 @@ static int msm_qti_pp_put_channel_map_mixer(struct snd_kcontrol *kcontrol, return 0; } static int msm_qti_pp_get_channel_map_capture(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { char channel_map[PCM_FORMAT_MAX_NUM_CHANNEL] = {0}; int i; adm_get_multi_ch_map(channel_map, ADM_PATH_LIVE_REC); for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL; i++) ucontrol->value.integer.value[i] = (unsigned int) channel_map[i]; return 0; } static int msm_qti_pp_put_channel_map_capture(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { char channel_map[PCM_FORMAT_MAX_NUM_CHANNEL]; int i; for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL; i++) channel_map[i] = (char)(ucontrol->value.integer.value[i]); adm_set_multi_ch_map(channel_map, ADM_PATH_LIVE_REC); return 0; } /* Audio Sphere functions */ static void msm_qti_pp_asphere_init_state(void) Loading Loading @@ -862,6 +888,11 @@ static const struct snd_kcontrol_new multi_ch_channel_map_mixer_controls[] = { msm_qti_pp_put_channel_map_mixer), }; static const struct snd_kcontrol_new multi_ch_channel_map_capture_controls[] = { SOC_SINGLE_MULTI_EXT("Capture Device Channel Map", SND_SOC_NOPM, 0, 16, 0, PCM_FORMAT_MAX_NUM_CHANNEL, msm_qti_pp_get_channel_map_capture, msm_qti_pp_put_channel_map_capture), }; static const struct snd_kcontrol_new get_rms_controls[] = { SOC_SINGLE_EXT("Get RMS", SND_SOC_NOPM, 0, 0xFFFFFFFF, Loading Loading @@ -1043,6 +1074,10 @@ void msm_qti_pp_add_controls(struct snd_soc_platform *platform) multi_ch_channel_map_mixer_controls, ARRAY_SIZE(multi_ch_channel_map_mixer_controls)); snd_soc_add_platform_controls(platform, multi_ch_channel_map_capture_controls, ARRAY_SIZE(multi_ch_channel_map_capture_controls)); snd_soc_add_platform_controls(platform, get_rms_controls, ARRAY_SIZE(get_rms_controls)); Loading