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

Commit 2725c639 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: wsa883x: Add check before enable/disable PDM WD irq"

parents f87e6e2e 8553f349
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -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))
		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,6 +1498,8 @@ static int wsa883x_event_notify(struct notifier_block *nb,
			snd_soc_component_update_bits(wsa883x->component,
						WSA883X_PA_FSM_CTL,
						0x01, 0x01);
			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 */