asoc: codecs: Fix pop issue on WSA cold start

Observe pop if FS clock is turned on at end of
powerup sequence. Ensure WSA PA is turned on
after FS clock to avoid pop.

Change-Id: Ic1214d361e77db252b7a90a89fc99c69f51e270b
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
This commit is contained in:
Laxminath Kasam
2019-09-17 23:43:34 +05:30
parent 13485b7fe1
commit 069df14aa0
5 changed files with 53 additions and 2 deletions

View File

@@ -117,6 +117,7 @@ enum {
BOLERO_WSA_EVT_PA_OFF_PRE_SSR,
BOLERO_WSA_EVT_SSR_DOWN,
BOLERO_WSA_EVT_SSR_UP,
BOLERO_WSA_EVT_PA_ON_POST_FSCLK,
};
struct wsa_ctrl_platform_data {
@@ -1030,6 +1031,10 @@ static int wsa881x_spkr_pa_event(struct snd_soc_dapm_widget *w,
break;
case SND_SOC_DAPM_POST_PMU:
if (!wsa881x->bolero_dev)
snd_soc_component_update_bits(component,
WSA881X_SPKR_DRV_EN,
0x80, 0x80);
if (!wsa881x->comp_enable) {
max_gain = wsa881x->pa_gain;
/*
@@ -1063,6 +1068,9 @@ static int wsa881x_spkr_pa_event(struct snd_soc_dapm_widget *w,
wsa881x->swr_slave->dev_num);
break;
case SND_SOC_DAPM_POST_PMD:
snd_soc_component_update_bits(component,
WSA881X_SPKR_DRV_EN,
0x80, 0x00);
if (wsa881x->visense_enable) {
wsa881x_visense_adc_ctrl(component, DISABLE);
wsa881x_visense_txfe_ctrl(component, DISABLE,
@@ -1088,7 +1096,7 @@ static const struct snd_soc_dapm_widget wsa881x_dapm_widgets[] = {
wsa881x_rdac_event,
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
SND_SOC_DAPM_PGA_E("SPKR PGA", WSA881X_SPKR_DRV_EN, 7, 0, NULL, 0,
SND_SOC_DAPM_PGA_E("SPKR PGA", SND_SOC_NOPM, 0, 0, NULL, 0,
wsa881x_spkr_pa_event, SND_SOC_DAPM_PRE_PMU |
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
@@ -1381,6 +1389,12 @@ static int wsa881x_event_notify(struct notifier_block *nb,
WSA881X_SPKR_DRV_EN,
0x80, 0x00);
break;
case BOLERO_WSA_EVT_PA_ON_POST_FSCLK:
if ((snd_soc_component_read32(wsa881x->component,
WSA881X_SPKR_DAC_CTL) & 0x80) == 0x80)
snd_soc_component_update_bits(wsa881x->component,
WSA881X_SPKR_DRV_EN,
0x80, 0x80);
default:
break;
}