Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6b77cb6 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: msm: Fix tasha vi_channel config"

parents 6fb9c483 1e60b9e5
Loading
Loading
Loading
Loading
+20 −10
Original line number Diff line number Diff line
@@ -678,7 +678,15 @@ static int slim0_rx_bit_format_put(struct snd_kcontrol *kcontrol,
static int msm_vi_feed_tx_ch_get(struct snd_kcontrol *kcontrol,
	struct snd_ctl_elem_value *ucontrol)
{
	ucontrol->value.integer.value[0] = (msm_vi_feed_tx_ch/2 - 1);
	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);

	if (!strcmp(dev_name(codec->dev), "tasha_codec"))
		ucontrol->value.integer.value[0] =
					(msm_vi_feed_tx_ch - 1);
	else
		ucontrol->value.integer.value[0] =
					(msm_vi_feed_tx_ch/2 - 1);

	pr_debug("%s: msm_vi_feed_tx_ch = %ld\n", __func__,
				ucontrol->value.integer.value[0]);
	return 0;
@@ -687,8 +695,15 @@ static int msm_vi_feed_tx_ch_get(struct snd_kcontrol *kcontrol,
static int msm_vi_feed_tx_ch_put(struct snd_kcontrol *kcontrol,
			struct snd_ctl_elem_value *ucontrol)
{
	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);

	if (!strcmp(dev_name(codec->dev), "tasha_codec"))
		msm_vi_feed_tx_ch =
		roundup_pow_of_two(ucontrol->value.integer.value[0] + 2);
			ucontrol->value.integer.value[0] + 1;
	else
		msm_vi_feed_tx_ch =
			roundup_pow_of_two(
				ucontrol->value.integer.value[0] + 2);

	pr_debug("%s: msm_vi_feed_tx_ch = %d\n", __func__, msm_vi_feed_tx_ch);
	return 1;
@@ -1235,16 +1250,11 @@ int msm_slim_4_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
	struct snd_soc_dai *codec_dai = rtd->codec_dai;

	pr_debug("%s: codec name: %s", __func__, codec_dai->name);
	if (!strcmp(dev_name(codec_dai->dev), "tomtom_codec")) {
		rate->min = rate->max = SAMPLING_RATE_48KHZ;
		channels->min = channels->max = msm_vi_feed_tx_ch;
		pr_debug("%s: tomtom vi sample rate = %d\n",
				__func__, rate->min);
	} else if (!strcmp(dev_name(codec_dai->dev), "tasha_codec")) {
	if (!strcmp(dev_name(codec_dai->dev), "tasha_codec")) {
		param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT,
			SNDRV_PCM_FORMAT_S32_LE);
		rate->min = rate->max = SAMPLING_RATE_8KHZ;
		channels->min = channels->max = msm_vi_feed_tx_ch/2;
		channels->min = channels->max = msm_vi_feed_tx_ch;
		pr_debug("%s: tasha vi sample rate = %d\n",
				__func__, rate->min);
	} else {