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

Commit 50402ced authored by Phani Kumar Uppalapati's avatar Phani Kumar Uppalapati
Browse files

ASoC: wcd9335: Update low-power mode settings for wcd9335 1.1



Update the register configuration for wcd9335 v1.1
for low-power mode audio playback.

Change-Id: I8d8c2c0d8c62cedb0a78b114fc06fa0e69b6dc6d
Signed-off-by: default avatarPhani Kumar Uppalapati <phaniu@codeaurora.org>
parent 186138d8
Loading
Loading
Loading
Loading
+28 −2
Original line number Diff line number Diff line
@@ -2104,6 +2104,7 @@ static int tasha_codec_hphr_dac_event(struct snd_soc_dapm_widget *w,
{
	struct snd_soc_codec *codec = w->codec;
	struct tasha_priv *tasha = snd_soc_codec_get_drvdata(codec);
	struct wcd9xxx *wcd9xxx = dev_get_drvdata(codec->dev->parent);
	int hph_mode = tasha->hph_mode;
	u8 dem_inp;

@@ -2129,6 +2130,18 @@ static int tasha_codec_hphr_dac_event(struct snd_soc_dapm_widget *w,
	case SND_SOC_DAPM_POST_PMU:
		/* 1000us required as per HW requirement */
		usleep_range(1000, 1100);
		if ((hph_mode == CLS_H_LP) &&
		   (TASHA_IS_1_1(wcd9xxx->version))) {
			snd_soc_update_bits(codec, WCD9335_HPH_L_DAC_CTL,
					    0x03, 0x03);
		}
		break;
	case SND_SOC_DAPM_PRE_PMD:
		if ((hph_mode == CLS_H_LP) &&
		   (TASHA_IS_1_1(wcd9xxx->version))) {
			snd_soc_update_bits(codec, WCD9335_HPH_L_DAC_CTL,
					    0x03, 0x00);
		}
		break;
	case SND_SOC_DAPM_POST_PMD:
		/* 1000us required as per HW requirement */
@@ -2149,6 +2162,7 @@ static int tasha_codec_hphl_dac_event(struct snd_soc_dapm_widget *w,
{
	struct snd_soc_codec *codec = w->codec;
	struct tasha_priv *tasha = snd_soc_codec_get_drvdata(codec);
	struct wcd9xxx *wcd9xxx = dev_get_drvdata(codec->dev->parent);
	int hph_mode = tasha->hph_mode;
	u8 dem_inp;

@@ -2174,6 +2188,18 @@ static int tasha_codec_hphl_dac_event(struct snd_soc_dapm_widget *w,
	case SND_SOC_DAPM_POST_PMU:
		/* 1000us required as per HW requirement */
		usleep_range(1000, 1100);
		if ((hph_mode == CLS_H_LP) &&
		   (TASHA_IS_1_1(wcd9xxx->version))) {
			snd_soc_update_bits(codec, WCD9335_HPH_L_DAC_CTL,
					    0x03, 0x03);
		}
		break;
	case SND_SOC_DAPM_PRE_PMD:
		if ((hph_mode == CLS_H_LP) &&
		   (TASHA_IS_1_1(wcd9xxx->version))) {
			snd_soc_update_bits(codec, WCD9335_HPH_L_DAC_CTL,
					    0x03, 0x00);
		}
		break;
	case SND_SOC_DAPM_POST_PMD:
		/* 1000us required as per HW requirement */
@@ -6361,11 +6387,11 @@ static const struct snd_soc_dapm_widget tasha_dapm_widgets[] = {
	SND_SOC_DAPM_DAC_E("RX INT1 DAC", NULL, WCD9335_ANA_HPH,
		5, 0, tasha_codec_hphl_dac_event,
		SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
		SND_SOC_DAPM_POST_PMD),
		SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD),
	SND_SOC_DAPM_DAC_E("RX INT2 DAC", NULL, WCD9335_ANA_HPH,
		4, 0, tasha_codec_hphr_dac_event,
		SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
		SND_SOC_DAPM_POST_PMD),
		SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD),
	SND_SOC_DAPM_DAC_E("RX INT3 DAC", NULL, SND_SOC_NOPM,
		0, 0, tasha_codec_lineout_dac_event,
		SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),