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

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

Merge "ASoC: wcd934x: Fix headset TX mode setting" into msm-4.9

parents 5b902f77 afdc5a80
Loading
Loading
Loading
Loading
+10 −13
Original line number Diff line number Diff line
@@ -5123,19 +5123,18 @@ static int tavil_amic_pwr_lvl_get(struct snd_kcontrol *kcontrol,
				  struct snd_ctl_elem_value *ucontrol)
{
	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
	u16 amic_reg;
	u16 amic_reg = 0;

	if (!strcmp(kcontrol->id.name, "AMIC_1_2 PWR MODE"))
		amic_reg = WCD934X_ANA_AMIC1;
	if (!strcmp(kcontrol->id.name, "AMIC_3_4 PWR MODE"))
		amic_reg = WCD934X_ANA_AMIC3;
	else
		goto ret;

	if (amic_reg)
		ucontrol->value.integer.value[0] =
		(snd_soc_read(codec, amic_reg) & WCD934X_AMIC_PWR_LVL_MASK) >>
			(snd_soc_read(codec, amic_reg) &
			 WCD934X_AMIC_PWR_LVL_MASK) >>
			  WCD934X_AMIC_PWR_LVL_SHIFT;
ret:
	return 0;
}

@@ -5144,7 +5143,7 @@ static int tavil_amic_pwr_lvl_put(struct snd_kcontrol *kcontrol,
{
	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
	u32 mode_val;
	u16 amic_reg;
	u16 amic_reg = 0;

	mode_val = ucontrol->value.enumerated.item[0];

@@ -5154,12 +5153,10 @@ static int tavil_amic_pwr_lvl_put(struct snd_kcontrol *kcontrol,
		amic_reg = WCD934X_ANA_AMIC1;
	if (!strcmp(kcontrol->id.name, "AMIC_3_4 PWR MODE"))
		amic_reg = WCD934X_ANA_AMIC3;
	else
		goto ret;

	if (amic_reg)
		snd_soc_update_bits(codec, amic_reg, WCD934X_AMIC_PWR_LVL_MASK,
				    mode_val << WCD934X_AMIC_PWR_LVL_SHIFT);
ret:
	return 0;
}