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

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

Merge "ASoC: wcd-mbhc: Disable micbias internal pull-up after headphone detected"

parents cfad3663 2ebe1229
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
 */
#include <linux/module.h>
#include <linux/init.h>
@@ -732,6 +732,10 @@ void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion,

		mbhc->hph_status |= jack_type;

		if (jack_type == SND_JACK_HEADPHONE &&
		    mbhc->mbhc_cb->mbhc_micb_ramp_control)
			mbhc->mbhc_cb->mbhc_micb_ramp_control(component, false);

		pr_debug("%s: Reporting insertion %d(%x)\n", __func__,
			 jack_type, mbhc->hph_status);
		wcd_mbhc_jack_report(mbhc, &mbhc->headset_jack,
@@ -922,6 +926,10 @@ static void wcd_mbhc_swch_irq_handler(struct wcd_mbhc *mbhc)
	else
		pr_info("%s: hs_detect_plug work not cancelled\n", __func__);

	/* Enable micbias ramp */
	if (mbhc->mbhc_cb->mbhc_micb_ramp_control)
		mbhc->mbhc_cb->mbhc_micb_ramp_control(component, true);

	if (mbhc->mbhc_cb->micbias_enable_status)
		micbias1 = mbhc->mbhc_cb->micbias_enable_status(mbhc,
						MIC_BIAS_1);
@@ -1417,9 +1425,6 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc)
	/* Button Debounce set to 16ms */
	WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_BTN_DBNC, 2);

	/* Enable micbias ramp */
	if (mbhc->mbhc_cb->mbhc_micb_ramp_control)
		mbhc->mbhc_cb->mbhc_micb_ramp_control(component, true);
	/* enable bias */
	mbhc->mbhc_cb->mbhc_bias(component, true);
	/* enable MBHC clock */