summaryrefslogtreecommitdiff
path: root/asoc
diff options
context:
space:
mode:
authorLaxminath Kasam <lkasam@codeaurora.org>2020-07-10 14:36:50 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2020-07-10 06:00:18 -0700
commit82861cad6b5e5e419570627e99b91c6d2711b75c (patch)
tree0ab2fe142ba90a76241cee281122ab99591fa010 /asoc
parent6f900e6d5ab5bb1b6a7dd859692711888eae8822 (diff)
downloadmsm-extra-82861cad6b5e5e419570627e99b91c6d2711b75c.tar.gz
asoc: wsa883x: Update the PDM_WD at startup/teardown
Update PDM_WD bit only at startup and teardown of speaker playback. Change-Id: If385c0f4d99b7f5aa4ccd8b1ee94c4afa6754518 Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Diffstat (limited to 'asoc')
-rw-r--r--asoc/codecs/wsa883x/wsa883x.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/asoc/codecs/wsa883x/wsa883x.c b/asoc/codecs/wsa883x/wsa883x.c
index a2dbea65..c14114f9 100644
--- a/asoc/codecs/wsa883x/wsa883x.c
+++ b/asoc/codecs/wsa883x/wsa883x.c
@@ -87,7 +87,6 @@ static const struct wsa_reg_mask_val reg_init[] = {
{WSA883X_CDC_SPK_DSM_R7, 0xFF, 0x3F},
{WSA883X_DRE_CTL_0, 0xF0, 0x90},
{WSA883X_DRE_IDLE_DET_CTL, 0x10, 0x00},
- {WSA883X_PDM_WD_CTL, 0x01, 0x01},
{WSA883X_CURRENT_LIMIT, 0x78, 0x20},
{WSA883X_DRE_CTL_0, 0x07, 0x02},
{WSA883X_VAGC_TIME, 0x0F, 0x0F},
@@ -981,7 +980,6 @@ static int wsa883x_spkr_event(struct snd_soc_dapm_widget *w,
swr_slvdev_datapath_control(wsa883x->swr_slave,
wsa883x->swr_slave->dev_num,
true);
- wcd_enable_irq(&wsa883x->irq_info, WSA883X_IRQ_INT_PDM_WD);
/* Force remove group */
swr_remove_from_group(wsa883x->swr_slave,
wsa883x->swr_slave->dev_num);
@@ -990,9 +988,14 @@ static int wsa883x_spkr_event(struct snd_soc_dapm_widget *w,
WSA883X_PA_FSM_CTL, 0x01, 0x01);
break;
case SND_SOC_DAPM_PRE_PMD:
+ if (!test_bit(SPKR_ADIE_LB, &wsa883x->status_mask))
+ wcd_disable_irq(&wsa883x->irq_info,
+ WSA883X_IRQ_INT_PDM_WD);
snd_soc_component_update_bits(component, WSA883X_PA_FSM_CTL,
0x01, 0x00);
- wcd_disable_irq(&wsa883x->irq_info, WSA883X_IRQ_INT_PDM_WD);
+ snd_soc_component_update_bits(wsa883x->component,
+ WSA883X_PDM_WD_CTL,
+ 0x01, 0x00);
clear_bit(SPKR_STATUS, &wsa883x->status_mask);
clear_bit(SPKR_ADIE_LB, &wsa883x->status_mask);
break;
@@ -1358,10 +1361,16 @@ static int wsa883x_event_notify(struct notifier_block *nb,
break;
case BOLERO_WSA_EVT_PA_ON_POST_FSCLK:
- if (test_bit(SPKR_STATUS, &wsa883x->status_mask))
+ if (test_bit(SPKR_STATUS, &wsa883x->status_mask)) {
+ snd_soc_component_update_bits(wsa883x->component,
+ WSA883X_PDM_WD_CTL,
+ 0x01, 0x01);
snd_soc_component_update_bits(wsa883x->component,
WSA883X_PA_FSM_CTL,
0x01, 0x01);
+ wcd_enable_irq(&wsa883x->irq_info,
+ WSA883X_IRQ_INT_PDM_WD);
+ }
break;
case BOLERO_WSA_EVT_PA_ON_POST_FSCLK_ADIE_LB:
if (test_bit(SPKR_STATUS, &wsa883x->status_mask))