mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 07:37:31 -04:00
ASoC: wsa883x: Add check before enable/disable PDM WD irq
Add check if irq is disabled before enabling PDM WD and if its already enabled before disabled. Change-Id: Ia36653568b21f9b41dfcdd1da13300f8850c4ea9 Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
This commit is contained in:
parent
3f57ae978c
commit
8553f349c0
1 changed files with 12 additions and 5 deletions
|
|
@ -1062,6 +1062,7 @@ static int wsa883x_spkr_event(struct snd_soc_dapm_widget *w,
|
|||
struct snd_soc_component *component =
|
||||
snd_soc_dapm_to_component(w->dapm);
|
||||
struct wsa883x_priv *wsa883x = snd_soc_component_get_drvdata(component);
|
||||
struct irq_data *irq_data = NULL;
|
||||
|
||||
dev_dbg(component->dev, "%s: %s %d\n", __func__, w->name, event);
|
||||
switch (event) {
|
||||
|
|
@ -1091,9 +1092,12 @@ 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);
|
||||
if (!test_bit(SPKR_ADIE_LB, &wsa883x->status_mask)) {
|
||||
irq_data = irq_get_irq_data(WSA883X_IRQ_INT_PDM_WD);
|
||||
if (irq_data && !irqd_irq_disabled(irq_data))
|
||||
wcd_disable_irq(&wsa883x->irq_info,
|
||||
WSA883X_IRQ_INT_PDM_WD);
|
||||
}
|
||||
snd_soc_component_update_bits(component,
|
||||
WSA883X_VBAT_ADC_FLT_CTL,
|
||||
0x01, 0x00);
|
||||
|
|
@ -1465,6 +1469,7 @@ static int wsa883x_event_notify(struct notifier_block *nb,
|
|||
u16 event = (val & 0xffff);
|
||||
struct wsa883x_priv *wsa883x = container_of(nb, struct wsa883x_priv,
|
||||
parent_nblock);
|
||||
struct irq_data *irq_data = NULL;
|
||||
|
||||
if (!wsa883x)
|
||||
return -EINVAL;
|
||||
|
|
@ -1493,8 +1498,10 @@ static int wsa883x_event_notify(struct notifier_block *nb,
|
|||
snd_soc_component_update_bits(wsa883x->component,
|
||||
WSA883X_PA_FSM_CTL,
|
||||
0x01, 0x01);
|
||||
wcd_enable_irq(&wsa883x->irq_info,
|
||||
WSA883X_IRQ_INT_PDM_WD);
|
||||
irq_data = irq_get_irq_data(WSA883X_IRQ_INT_PDM_WD);
|
||||
if (irq_data && irqd_irq_disabled(irq_data))
|
||||
wcd_enable_irq(&wsa883x->irq_info,
|
||||
WSA883X_IRQ_INT_PDM_WD);
|
||||
/* Added delay as per HW sequence */
|
||||
usleep_range(3000, 3100);
|
||||
snd_soc_component_update_bits(wsa883x->component,
|
||||
|
|
|
|||
Loading…
Reference in a new issue