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

Commit 7127232a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: wcd: enable regulators and interrupts properly"

parents c7a45093 60209516
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,6 @@ void wcd9xxx_spmi_enable_irq(int irq)
		~(BYTE_BIT_MASK(irq));

	enable_irq(map.linuxirq[irq]);
	enable_irq_wake(map.linuxirq[irq]);
}

void wcd9xxx_spmi_disable_irq(int irq)
@@ -162,6 +161,7 @@ int wcd9xxx_spmi_request_irq(int irq, irq_handler_t handler,
			"irq %d linuxIRQ: %d\n", irq, map.linuxirq[irq]);
	map.mask[BIT_BYTE(irq)] &= ~BYTE_BIT_MASK(irq);
	map.handler[irq] = handler;
	enable_irq_wake(map.linuxirq[irq]);
	return 0;
}

+10 −4
Original line number Diff line number Diff line
@@ -575,6 +575,9 @@ static void wcd_correct_swch_plug(struct work_struct *work)
	mbhc = container_of(work, struct wcd_mbhc, correct_plug_swch);
	codec = mbhc->codec;

	/* Enable external voltage source to micbias if present */
	if (mbhc->mbhc_cb && mbhc->mbhc_cb->enable_mb_source)
		mbhc->mbhc_cb->enable_mb_source(codec, true);
	timeout = jiffies + msecs_to_jiffies(HS_DETECT_PLUG_TIME_MS);
	while (!time_after(jiffies, timeout)) {
		if (mbhc->hs_detect_work_stop) {
@@ -690,6 +693,9 @@ static void wcd_correct_swch_plug(struct work_struct *work)

	wcd_mbhc_find_plug_and_report(mbhc, plug_type);
exit:
	/* Disable external voltage source to micbias if present */
	if (mbhc->mbhc_cb && mbhc->mbhc_cb->enable_mb_source)
		mbhc->mbhc_cb->enable_mb_source(codec, false);
	wcd9xxx_spmi_unlock_sleep();
	pr_debug("%s: leave\n", __func__);
}
@@ -706,15 +712,15 @@ static void wcd_mbhc_detect_plug_type(struct wcd_mbhc *mbhc)
	pr_debug("%s: enter\n", __func__);
	WCD_MBHC_RSC_ASSERT_LOCKED(mbhc);

	/* Enable external voltage source to micbias if present */
	if (mbhc->mbhc_cb && mbhc->mbhc_cb->enable_mb_source)
		mbhc->mbhc_cb->enable_mb_source(codec, true);

	/* Enable micbias */
	snd_soc_update_bits(codec,
			MSM8X16_WCD_A_ANALOG_MICB_2_EN,
			0x80, 0x80);

	/* Enable external voltage source to micbias if present */
	if (mbhc->mbhc_cb && mbhc->mbhc_cb->enable_mb_source)
		mbhc->mbhc_cb->enable_mb_source(codec, true);

	/*
	 * Wait for 50msec for FSM to complete its task.
	 * wakeup if btn pres intr occurs