Loading sound/soc/msm/sdm845.c +112 −6 Original line number Diff line number Diff line Loading @@ -495,6 +495,8 @@ static SOC_ENUM_SINGLE_EXT_DECL(quat_mi2s_rx_chs, mi2s_ch_text); static SOC_ENUM_SINGLE_EXT_DECL(quat_mi2s_tx_chs, mi2s_ch_text); static SOC_ENUM_SINGLE_EXT_DECL(mi2s_rx_format, bit_format_text); static SOC_ENUM_SINGLE_EXT_DECL(mi2s_tx_format, bit_format_text); static SOC_ENUM_SINGLE_EXT_DECL(aux_pcm_rx_format, bit_format_text); static SOC_ENUM_SINGLE_EXT_DECL(aux_pcm_tx_format, bit_format_text); static SOC_ENUM_SINGLE_EXT_DECL(hifi_function, hifi_text); static struct platform_device *spdev; Loading Loading @@ -2252,7 +2254,7 @@ static int mi2s_get_sample_rate(int value) return sample_rate; } static int mi2s_get_format(int value) static int mi2s_auxpcm_get_format(int value) { int format; Loading @@ -2276,7 +2278,7 @@ static int mi2s_get_format(int value) return format; } static int mi2s_get_format_value(int format) static int mi2s_auxpcm_get_format_value(int format) { int value; Loading Loading @@ -2441,7 +2443,7 @@ static int msm_mi2s_rx_format_get(struct snd_kcontrol *kcontrol, return idx; ucontrol->value.enumerated.item[0] = mi2s_get_format_value(mi2s_rx_cfg[idx].bit_format); mi2s_auxpcm_get_format_value(mi2s_rx_cfg[idx].bit_format); pr_debug("%s: idx[%d]_rx_format = %d, item = %d\n", __func__, idx, mi2s_rx_cfg[idx].bit_format, Loading @@ -2459,7 +2461,7 @@ static int msm_mi2s_rx_format_put(struct snd_kcontrol *kcontrol, return idx; mi2s_rx_cfg[idx].bit_format = mi2s_get_format(ucontrol->value.enumerated.item[0]); mi2s_auxpcm_get_format(ucontrol->value.enumerated.item[0]); pr_debug("%s: idx[%d]_rx_format = %d, item = %d\n", __func__, idx, mi2s_rx_cfg[idx].bit_format, Loading @@ -2477,7 +2479,7 @@ static int msm_mi2s_tx_format_get(struct snd_kcontrol *kcontrol, return idx; ucontrol->value.enumerated.item[0] = mi2s_get_format_value(mi2s_tx_cfg[idx].bit_format); mi2s_auxpcm_get_format_value(mi2s_tx_cfg[idx].bit_format); pr_debug("%s: idx[%d]_tx_format = %d, item = %d\n", __func__, idx, mi2s_tx_cfg[idx].bit_format, Loading @@ -2495,7 +2497,7 @@ static int msm_mi2s_tx_format_put(struct snd_kcontrol *kcontrol, return idx; mi2s_tx_cfg[idx].bit_format = mi2s_get_format(ucontrol->value.enumerated.item[0]); mi2s_auxpcm_get_format(ucontrol->value.enumerated.item[0]); pr_debug("%s: idx[%d]_tx_format = %d, item = %d\n", __func__, idx, mi2s_tx_cfg[idx].bit_format, Loading @@ -2504,6 +2506,78 @@ static int msm_mi2s_tx_format_put(struct snd_kcontrol *kcontrol, return 0; } static int msm_aux_pcm_rx_format_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { int idx = aux_pcm_get_port_idx(kcontrol); if (idx < 0) return idx; ucontrol->value.enumerated.item[0] = mi2s_auxpcm_get_format_value(aux_pcm_rx_cfg[idx].bit_format); pr_debug("%s: idx[%d]_rx_format = %d, item = %d\n", __func__, idx, aux_pcm_rx_cfg[idx].bit_format, ucontrol->value.enumerated.item[0]); return 0; } static int msm_aux_pcm_rx_format_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { int idx = aux_pcm_get_port_idx(kcontrol); if (idx < 0) return idx; aux_pcm_rx_cfg[idx].bit_format = mi2s_auxpcm_get_format(ucontrol->value.enumerated.item[0]); pr_debug("%s: idx[%d]_rx_format = %d, item = %d\n", __func__, idx, aux_pcm_rx_cfg[idx].bit_format, ucontrol->value.enumerated.item[0]); return 0; } static int msm_aux_pcm_tx_format_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { int idx = aux_pcm_get_port_idx(kcontrol); if (idx < 0) return idx; ucontrol->value.enumerated.item[0] = mi2s_auxpcm_get_format_value(aux_pcm_tx_cfg[idx].bit_format); pr_debug("%s: idx[%d]_tx_format = %d, item = %d\n", __func__, idx, aux_pcm_tx_cfg[idx].bit_format, ucontrol->value.enumerated.item[0]); return 0; } static int msm_aux_pcm_tx_format_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { int idx = aux_pcm_get_port_idx(kcontrol); if (idx < 0) return idx; aux_pcm_tx_cfg[idx].bit_format = mi2s_auxpcm_get_format(ucontrol->value.enumerated.item[0]); pr_debug("%s: idx[%d]_tx_format = %d, item = %d\n", __func__, idx, aux_pcm_tx_cfg[idx].bit_format, ucontrol->value.enumerated.item[0]); return 0; } static int msm_hifi_ctrl(struct snd_soc_codec *codec) { struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); Loading Loading @@ -2765,6 +2839,22 @@ static const struct snd_kcontrol_new msm_snd_controls[] = { msm_mi2s_rx_format_get, msm_mi2s_rx_format_put), SOC_ENUM_EXT("QUAT_MI2S_TX Format", mi2s_tx_format, msm_mi2s_tx_format_get, msm_mi2s_tx_format_put), SOC_ENUM_EXT("PRIM_AUX_PCM_RX Format", aux_pcm_rx_format, msm_aux_pcm_rx_format_get, msm_aux_pcm_rx_format_put), SOC_ENUM_EXT("PRIM_AUX_PCM_TX Format", aux_pcm_tx_format, msm_aux_pcm_tx_format_get, msm_aux_pcm_tx_format_put), SOC_ENUM_EXT("SEC_AUX_PCM_RX Format", aux_pcm_rx_format, msm_aux_pcm_rx_format_get, msm_aux_pcm_rx_format_put), SOC_ENUM_EXT("SEC_AUX_PCM_TX Format", aux_pcm_tx_format, msm_aux_pcm_tx_format_get, msm_aux_pcm_tx_format_put), SOC_ENUM_EXT("TERT_AUX_PCM_RX Format", aux_pcm_rx_format, msm_aux_pcm_rx_format_get, msm_aux_pcm_rx_format_put), SOC_ENUM_EXT("TERT_AUX_PCM_TX Format", aux_pcm_tx_format, msm_aux_pcm_tx_format_get, msm_aux_pcm_tx_format_put), SOC_ENUM_EXT("QUAT_AUX_PCM_RX Format", aux_pcm_rx_format, msm_aux_pcm_rx_format_get, msm_aux_pcm_rx_format_put), SOC_ENUM_EXT("QUAT_AUX_PCM_TX Format", aux_pcm_tx_format, msm_aux_pcm_tx_format_get, msm_aux_pcm_tx_format_put), SOC_ENUM_EXT("HiFi Function", hifi_function, msm_hifi_get, msm_hifi_put), }; Loading Loading @@ -3166,6 +3256,8 @@ static int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, break; case MSM_BACKEND_DAI_AUXPCM_RX: param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, aux_pcm_rx_cfg[PRIM_AUX_PCM].bit_format); rate->min = rate->max = aux_pcm_rx_cfg[PRIM_AUX_PCM].sample_rate; channels->min = channels->max = Loading @@ -3173,6 +3265,8 @@ static int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, break; case MSM_BACKEND_DAI_AUXPCM_TX: param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, aux_pcm_tx_cfg[PRIM_AUX_PCM].bit_format); rate->min = rate->max = aux_pcm_tx_cfg[PRIM_AUX_PCM].sample_rate; channels->min = channels->max = Loading @@ -3180,6 +3274,8 @@ static int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, break; case MSM_BACKEND_DAI_SEC_AUXPCM_RX: param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, aux_pcm_rx_cfg[SEC_AUX_PCM].bit_format); rate->min = rate->max = aux_pcm_rx_cfg[SEC_AUX_PCM].sample_rate; channels->min = channels->max = Loading @@ -3187,6 +3283,8 @@ static int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, break; case MSM_BACKEND_DAI_SEC_AUXPCM_TX: param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, aux_pcm_tx_cfg[SEC_AUX_PCM].bit_format); rate->min = rate->max = aux_pcm_tx_cfg[SEC_AUX_PCM].sample_rate; channels->min = channels->max = Loading @@ -3194,6 +3292,8 @@ static int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, break; case MSM_BACKEND_DAI_TERT_AUXPCM_RX: param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, aux_pcm_rx_cfg[TERT_AUX_PCM].bit_format); rate->min = rate->max = aux_pcm_rx_cfg[TERT_AUX_PCM].sample_rate; channels->min = channels->max = Loading @@ -3201,6 +3301,8 @@ static int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, break; case MSM_BACKEND_DAI_TERT_AUXPCM_TX: param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, aux_pcm_tx_cfg[TERT_AUX_PCM].bit_format); rate->min = rate->max = aux_pcm_tx_cfg[TERT_AUX_PCM].sample_rate; channels->min = channels->max = Loading @@ -3208,6 +3310,8 @@ static int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, break; case MSM_BACKEND_DAI_QUAT_AUXPCM_RX: param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, aux_pcm_rx_cfg[QUAT_AUX_PCM].bit_format); rate->min = rate->max = aux_pcm_rx_cfg[QUAT_AUX_PCM].sample_rate; channels->min = channels->max = Loading @@ -3215,6 +3319,8 @@ static int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, break; case MSM_BACKEND_DAI_QUAT_AUXPCM_TX: param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, aux_pcm_tx_cfg[QUAT_AUX_PCM].bit_format); rate->min = rate->max = aux_pcm_tx_cfg[QUAT_AUX_PCM].sample_rate; channels->min = channels->max = Loading Loading
sound/soc/msm/sdm845.c +112 −6 Original line number Diff line number Diff line Loading @@ -495,6 +495,8 @@ static SOC_ENUM_SINGLE_EXT_DECL(quat_mi2s_rx_chs, mi2s_ch_text); static SOC_ENUM_SINGLE_EXT_DECL(quat_mi2s_tx_chs, mi2s_ch_text); static SOC_ENUM_SINGLE_EXT_DECL(mi2s_rx_format, bit_format_text); static SOC_ENUM_SINGLE_EXT_DECL(mi2s_tx_format, bit_format_text); static SOC_ENUM_SINGLE_EXT_DECL(aux_pcm_rx_format, bit_format_text); static SOC_ENUM_SINGLE_EXT_DECL(aux_pcm_tx_format, bit_format_text); static SOC_ENUM_SINGLE_EXT_DECL(hifi_function, hifi_text); static struct platform_device *spdev; Loading Loading @@ -2252,7 +2254,7 @@ static int mi2s_get_sample_rate(int value) return sample_rate; } static int mi2s_get_format(int value) static int mi2s_auxpcm_get_format(int value) { int format; Loading @@ -2276,7 +2278,7 @@ static int mi2s_get_format(int value) return format; } static int mi2s_get_format_value(int format) static int mi2s_auxpcm_get_format_value(int format) { int value; Loading Loading @@ -2441,7 +2443,7 @@ static int msm_mi2s_rx_format_get(struct snd_kcontrol *kcontrol, return idx; ucontrol->value.enumerated.item[0] = mi2s_get_format_value(mi2s_rx_cfg[idx].bit_format); mi2s_auxpcm_get_format_value(mi2s_rx_cfg[idx].bit_format); pr_debug("%s: idx[%d]_rx_format = %d, item = %d\n", __func__, idx, mi2s_rx_cfg[idx].bit_format, Loading @@ -2459,7 +2461,7 @@ static int msm_mi2s_rx_format_put(struct snd_kcontrol *kcontrol, return idx; mi2s_rx_cfg[idx].bit_format = mi2s_get_format(ucontrol->value.enumerated.item[0]); mi2s_auxpcm_get_format(ucontrol->value.enumerated.item[0]); pr_debug("%s: idx[%d]_rx_format = %d, item = %d\n", __func__, idx, mi2s_rx_cfg[idx].bit_format, Loading @@ -2477,7 +2479,7 @@ static int msm_mi2s_tx_format_get(struct snd_kcontrol *kcontrol, return idx; ucontrol->value.enumerated.item[0] = mi2s_get_format_value(mi2s_tx_cfg[idx].bit_format); mi2s_auxpcm_get_format_value(mi2s_tx_cfg[idx].bit_format); pr_debug("%s: idx[%d]_tx_format = %d, item = %d\n", __func__, idx, mi2s_tx_cfg[idx].bit_format, Loading @@ -2495,7 +2497,7 @@ static int msm_mi2s_tx_format_put(struct snd_kcontrol *kcontrol, return idx; mi2s_tx_cfg[idx].bit_format = mi2s_get_format(ucontrol->value.enumerated.item[0]); mi2s_auxpcm_get_format(ucontrol->value.enumerated.item[0]); pr_debug("%s: idx[%d]_tx_format = %d, item = %d\n", __func__, idx, mi2s_tx_cfg[idx].bit_format, Loading @@ -2504,6 +2506,78 @@ static int msm_mi2s_tx_format_put(struct snd_kcontrol *kcontrol, return 0; } static int msm_aux_pcm_rx_format_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { int idx = aux_pcm_get_port_idx(kcontrol); if (idx < 0) return idx; ucontrol->value.enumerated.item[0] = mi2s_auxpcm_get_format_value(aux_pcm_rx_cfg[idx].bit_format); pr_debug("%s: idx[%d]_rx_format = %d, item = %d\n", __func__, idx, aux_pcm_rx_cfg[idx].bit_format, ucontrol->value.enumerated.item[0]); return 0; } static int msm_aux_pcm_rx_format_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { int idx = aux_pcm_get_port_idx(kcontrol); if (idx < 0) return idx; aux_pcm_rx_cfg[idx].bit_format = mi2s_auxpcm_get_format(ucontrol->value.enumerated.item[0]); pr_debug("%s: idx[%d]_rx_format = %d, item = %d\n", __func__, idx, aux_pcm_rx_cfg[idx].bit_format, ucontrol->value.enumerated.item[0]); return 0; } static int msm_aux_pcm_tx_format_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { int idx = aux_pcm_get_port_idx(kcontrol); if (idx < 0) return idx; ucontrol->value.enumerated.item[0] = mi2s_auxpcm_get_format_value(aux_pcm_tx_cfg[idx].bit_format); pr_debug("%s: idx[%d]_tx_format = %d, item = %d\n", __func__, idx, aux_pcm_tx_cfg[idx].bit_format, ucontrol->value.enumerated.item[0]); return 0; } static int msm_aux_pcm_tx_format_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { int idx = aux_pcm_get_port_idx(kcontrol); if (idx < 0) return idx; aux_pcm_tx_cfg[idx].bit_format = mi2s_auxpcm_get_format(ucontrol->value.enumerated.item[0]); pr_debug("%s: idx[%d]_tx_format = %d, item = %d\n", __func__, idx, aux_pcm_tx_cfg[idx].bit_format, ucontrol->value.enumerated.item[0]); return 0; } static int msm_hifi_ctrl(struct snd_soc_codec *codec) { struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); Loading Loading @@ -2765,6 +2839,22 @@ static const struct snd_kcontrol_new msm_snd_controls[] = { msm_mi2s_rx_format_get, msm_mi2s_rx_format_put), SOC_ENUM_EXT("QUAT_MI2S_TX Format", mi2s_tx_format, msm_mi2s_tx_format_get, msm_mi2s_tx_format_put), SOC_ENUM_EXT("PRIM_AUX_PCM_RX Format", aux_pcm_rx_format, msm_aux_pcm_rx_format_get, msm_aux_pcm_rx_format_put), SOC_ENUM_EXT("PRIM_AUX_PCM_TX Format", aux_pcm_tx_format, msm_aux_pcm_tx_format_get, msm_aux_pcm_tx_format_put), SOC_ENUM_EXT("SEC_AUX_PCM_RX Format", aux_pcm_rx_format, msm_aux_pcm_rx_format_get, msm_aux_pcm_rx_format_put), SOC_ENUM_EXT("SEC_AUX_PCM_TX Format", aux_pcm_tx_format, msm_aux_pcm_tx_format_get, msm_aux_pcm_tx_format_put), SOC_ENUM_EXT("TERT_AUX_PCM_RX Format", aux_pcm_rx_format, msm_aux_pcm_rx_format_get, msm_aux_pcm_rx_format_put), SOC_ENUM_EXT("TERT_AUX_PCM_TX Format", aux_pcm_tx_format, msm_aux_pcm_tx_format_get, msm_aux_pcm_tx_format_put), SOC_ENUM_EXT("QUAT_AUX_PCM_RX Format", aux_pcm_rx_format, msm_aux_pcm_rx_format_get, msm_aux_pcm_rx_format_put), SOC_ENUM_EXT("QUAT_AUX_PCM_TX Format", aux_pcm_tx_format, msm_aux_pcm_tx_format_get, msm_aux_pcm_tx_format_put), SOC_ENUM_EXT("HiFi Function", hifi_function, msm_hifi_get, msm_hifi_put), }; Loading Loading @@ -3166,6 +3256,8 @@ static int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, break; case MSM_BACKEND_DAI_AUXPCM_RX: param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, aux_pcm_rx_cfg[PRIM_AUX_PCM].bit_format); rate->min = rate->max = aux_pcm_rx_cfg[PRIM_AUX_PCM].sample_rate; channels->min = channels->max = Loading @@ -3173,6 +3265,8 @@ static int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, break; case MSM_BACKEND_DAI_AUXPCM_TX: param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, aux_pcm_tx_cfg[PRIM_AUX_PCM].bit_format); rate->min = rate->max = aux_pcm_tx_cfg[PRIM_AUX_PCM].sample_rate; channels->min = channels->max = Loading @@ -3180,6 +3274,8 @@ static int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, break; case MSM_BACKEND_DAI_SEC_AUXPCM_RX: param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, aux_pcm_rx_cfg[SEC_AUX_PCM].bit_format); rate->min = rate->max = aux_pcm_rx_cfg[SEC_AUX_PCM].sample_rate; channels->min = channels->max = Loading @@ -3187,6 +3283,8 @@ static int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, break; case MSM_BACKEND_DAI_SEC_AUXPCM_TX: param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, aux_pcm_tx_cfg[SEC_AUX_PCM].bit_format); rate->min = rate->max = aux_pcm_tx_cfg[SEC_AUX_PCM].sample_rate; channels->min = channels->max = Loading @@ -3194,6 +3292,8 @@ static int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, break; case MSM_BACKEND_DAI_TERT_AUXPCM_RX: param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, aux_pcm_rx_cfg[TERT_AUX_PCM].bit_format); rate->min = rate->max = aux_pcm_rx_cfg[TERT_AUX_PCM].sample_rate; channels->min = channels->max = Loading @@ -3201,6 +3301,8 @@ static int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, break; case MSM_BACKEND_DAI_TERT_AUXPCM_TX: param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, aux_pcm_tx_cfg[TERT_AUX_PCM].bit_format); rate->min = rate->max = aux_pcm_tx_cfg[TERT_AUX_PCM].sample_rate; channels->min = channels->max = Loading @@ -3208,6 +3310,8 @@ static int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, break; case MSM_BACKEND_DAI_QUAT_AUXPCM_RX: param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, aux_pcm_rx_cfg[QUAT_AUX_PCM].bit_format); rate->min = rate->max = aux_pcm_rx_cfg[QUAT_AUX_PCM].sample_rate; channels->min = channels->max = Loading @@ -3215,6 +3319,8 @@ static int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, break; case MSM_BACKEND_DAI_QUAT_AUXPCM_TX: param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, aux_pcm_tx_cfg[QUAT_AUX_PCM].bit_format); rate->min = rate->max = aux_pcm_tx_cfg[QUAT_AUX_PCM].sample_rate; channels->min = channels->max = Loading