Loading sound/soc/msm/msm8952-dai-links.c +2 −2 Original line number Diff line number Diff line Loading @@ -154,11 +154,11 @@ static struct snd_soc_dai_link msm8952_tasha_be_dai[] = { .cpu_dai_name = "msm-dai-q6-dev.16387", .platform_name = "msm-pcm-routing", .codec_name = "tasha_codec", .codec_dai_name = "tasha_tx1", .codec_dai_name = "tasha_tx3", .no_pcm = 1, .dpcm_capture = 1, .be_id = MSM_BACKEND_DAI_SLIMBUS_1_TX, .be_hw_params_fixup = msm_slim_0_tx_be_hw_params_fixup, .be_hw_params_fixup = msm_slim_1_tx_be_hw_params_fixup, .ops = &msm8952_slimbus_be_ops, .ignore_suspend = 1, }, Loading sound/soc/msm/msm8952-slimbus.c +42 −1 Original line number Diff line number Diff line Loading @@ -75,10 +75,13 @@ enum btsco_rates { static int slim0_rx_sample_rate = SAMPLING_RATE_48KHZ; static int slim0_tx_sample_rate = SAMPLING_RATE_48KHZ; static int slim1_tx_sample_rate = SAMPLING_RATE_48KHZ; static int slim0_rx_bit_format = SNDRV_PCM_FORMAT_S16_LE; static int slim0_tx_bit_format = SNDRV_PCM_FORMAT_S16_LE; static int slim1_tx_bit_format = SNDRV_PCM_FORMAT_S16_LE; static int msm_slim_0_rx_ch = 1; static int msm_slim_0_tx_ch = 1; static int msm_slim_1_tx_ch = 1; static int msm_vi_feed_tx_ch = 2; static int msm_slim_5_rx_ch = 1; static int slim5_rx_sample_rate = SAMPLING_RATE_48KHZ; Loading Loading @@ -524,6 +527,24 @@ static int mi2s_rx_bit_format_put(struct snd_kcontrol *kcontrol, return 0; } static int msm_slim_1_tx_ch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { pr_debug("%s: msm_slim_1_tx_ch = %d\n", __func__, msm_slim_1_tx_ch); ucontrol->value.integer.value[0] = msm_slim_1_tx_ch - 1; return 0; } static int msm_slim_1_tx_ch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { msm_slim_1_tx_ch = ucontrol->value.integer.value[0] + 1; pr_debug("%s: msm_slim_1_tx_ch = %d\n", __func__, msm_slim_1_tx_ch); return 1; } static int slim0_rx_sample_rate_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { Loading Loading @@ -884,6 +905,8 @@ static const struct snd_kcontrol_new msm_snd_controls[] = { msm_slim_5_rx_ch_get, msm_slim_5_rx_ch_put), SOC_ENUM_EXT("SLIM_0_TX Channels", msm_snd_enum[2], msm_slim_0_tx_ch_get, msm_slim_0_tx_ch_put), SOC_ENUM_EXT("SLIM_1_TX Channels", msm_snd_enum[2], msm_slim_1_tx_ch_get, msm_slim_1_tx_ch_put), SOC_ENUM_EXT("MI2S_RX Format", msm_snd_enum[3], mi2s_rx_bit_format_get, mi2s_rx_bit_format_put), SOC_ENUM_EXT("SLIM_0_RX Format", msm_snd_enum[3], Loading Loading @@ -1056,7 +1079,7 @@ int msm_snd_hw_params(struct snd_pcm_substream *substream, user_set_tx_ch = msm_slim_0_tx_ch; /* For <codec>_tx2 case */ else if (dai_link->be_id == MSM_BACKEND_DAI_SLIMBUS_1_TX) user_set_tx_ch = params_channels(params); user_set_tx_ch = msm_slim_1_tx_ch; else if (dai_link->be_id == MSM_BACKEND_DAI_SLIMBUS_3_TX) /* DAI 5 is used for external EC reference from codec. * Since Rx is fed as reference for EC, the config of Loading Loading @@ -1175,6 +1198,24 @@ int msm_slim_0_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, return 0; } int msm_slim_1_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); pr_debug("%s()\n", __func__); param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, slim1_tx_bit_format); rate->min = rate->max = slim1_tx_sample_rate; channels->min = channels->max = msm_slim_1_tx_ch; return 0; } int msm_slim_4_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { Loading sound/soc/msm/msm8952-slimbus.h +2 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ int msm_slim_0_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params); int msm_slim_0_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params); int msm_slim_1_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params); int msm_slim_4_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params); int msm_slim_5_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, Loading Loading
sound/soc/msm/msm8952-dai-links.c +2 −2 Original line number Diff line number Diff line Loading @@ -154,11 +154,11 @@ static struct snd_soc_dai_link msm8952_tasha_be_dai[] = { .cpu_dai_name = "msm-dai-q6-dev.16387", .platform_name = "msm-pcm-routing", .codec_name = "tasha_codec", .codec_dai_name = "tasha_tx1", .codec_dai_name = "tasha_tx3", .no_pcm = 1, .dpcm_capture = 1, .be_id = MSM_BACKEND_DAI_SLIMBUS_1_TX, .be_hw_params_fixup = msm_slim_0_tx_be_hw_params_fixup, .be_hw_params_fixup = msm_slim_1_tx_be_hw_params_fixup, .ops = &msm8952_slimbus_be_ops, .ignore_suspend = 1, }, Loading
sound/soc/msm/msm8952-slimbus.c +42 −1 Original line number Diff line number Diff line Loading @@ -75,10 +75,13 @@ enum btsco_rates { static int slim0_rx_sample_rate = SAMPLING_RATE_48KHZ; static int slim0_tx_sample_rate = SAMPLING_RATE_48KHZ; static int slim1_tx_sample_rate = SAMPLING_RATE_48KHZ; static int slim0_rx_bit_format = SNDRV_PCM_FORMAT_S16_LE; static int slim0_tx_bit_format = SNDRV_PCM_FORMAT_S16_LE; static int slim1_tx_bit_format = SNDRV_PCM_FORMAT_S16_LE; static int msm_slim_0_rx_ch = 1; static int msm_slim_0_tx_ch = 1; static int msm_slim_1_tx_ch = 1; static int msm_vi_feed_tx_ch = 2; static int msm_slim_5_rx_ch = 1; static int slim5_rx_sample_rate = SAMPLING_RATE_48KHZ; Loading Loading @@ -524,6 +527,24 @@ static int mi2s_rx_bit_format_put(struct snd_kcontrol *kcontrol, return 0; } static int msm_slim_1_tx_ch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { pr_debug("%s: msm_slim_1_tx_ch = %d\n", __func__, msm_slim_1_tx_ch); ucontrol->value.integer.value[0] = msm_slim_1_tx_ch - 1; return 0; } static int msm_slim_1_tx_ch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { msm_slim_1_tx_ch = ucontrol->value.integer.value[0] + 1; pr_debug("%s: msm_slim_1_tx_ch = %d\n", __func__, msm_slim_1_tx_ch); return 1; } static int slim0_rx_sample_rate_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { Loading Loading @@ -884,6 +905,8 @@ static const struct snd_kcontrol_new msm_snd_controls[] = { msm_slim_5_rx_ch_get, msm_slim_5_rx_ch_put), SOC_ENUM_EXT("SLIM_0_TX Channels", msm_snd_enum[2], msm_slim_0_tx_ch_get, msm_slim_0_tx_ch_put), SOC_ENUM_EXT("SLIM_1_TX Channels", msm_snd_enum[2], msm_slim_1_tx_ch_get, msm_slim_1_tx_ch_put), SOC_ENUM_EXT("MI2S_RX Format", msm_snd_enum[3], mi2s_rx_bit_format_get, mi2s_rx_bit_format_put), SOC_ENUM_EXT("SLIM_0_RX Format", msm_snd_enum[3], Loading Loading @@ -1056,7 +1079,7 @@ int msm_snd_hw_params(struct snd_pcm_substream *substream, user_set_tx_ch = msm_slim_0_tx_ch; /* For <codec>_tx2 case */ else if (dai_link->be_id == MSM_BACKEND_DAI_SLIMBUS_1_TX) user_set_tx_ch = params_channels(params); user_set_tx_ch = msm_slim_1_tx_ch; else if (dai_link->be_id == MSM_BACKEND_DAI_SLIMBUS_3_TX) /* DAI 5 is used for external EC reference from codec. * Since Rx is fed as reference for EC, the config of Loading Loading @@ -1175,6 +1198,24 @@ int msm_slim_0_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, return 0; } int msm_slim_1_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); pr_debug("%s()\n", __func__); param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, slim1_tx_bit_format); rate->min = rate->max = slim1_tx_sample_rate; channels->min = channels->max = msm_slim_1_tx_ch; return 0; } int msm_slim_4_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { Loading
sound/soc/msm/msm8952-slimbus.h +2 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ int msm_slim_0_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params); int msm_slim_0_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params); int msm_slim_1_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params); int msm_slim_4_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params); int msm_slim_5_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, Loading