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

Commit 5c808655 authored by Joonwoo Park's avatar Joonwoo Park Committed by Stephen Boyd
Browse files

ASoC: wcd9xxx: request bandgap in slow mode



Since bandgap mode change requires clock block disablement when bandgap
get and clock put which are followed by clock get and bandgap put happen,
two clock get or put happen unnecessary.
Reqeust bandgap mode in slow mode to avoid unnecessary temporary clock
source changes.  Also regardless of this change, resource manager always
requests bandgap in slow mode as fast mode request is meaningless.

Change-Id: I6ff52d004cfab6372373b7405f66d8777b3396fd
Signed-off-by: default avatarJoonwoo Park <joonwoop@codeaurora.org>
parent fa633d07
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1014,7 +1014,7 @@ static short wcd9xxx_mbhc_setup_hs_polling(struct wcd9xxx_mbhc *mbhc)
	 * These will be released by wcd9xxx_cleanup_hs_polling
	 */
	WCD9XXX_BG_CLK_LOCK(mbhc->resmgr);
	wcd9xxx_resmgr_get_bandgap(mbhc->resmgr, WCD9XXX_BANDGAP_MBHC_MODE);
	wcd9xxx_resmgr_get_bandgap(mbhc->resmgr, WCD9XXX_BANDGAP_AUDIO_MODE);
	wcd9xxx_resmgr_get_clk_block(mbhc->resmgr, WCD9XXX_CLK_RCO);
	WCD9XXX_BG_CLK_UNLOCK(mbhc->resmgr);

@@ -3805,7 +3805,13 @@ static int wcd9xxx_detect_impedance(struct wcd9xxx_mbhc *mbhc, uint32_t *zl,
	mutex_lock(&codec->mutex);

	WCD9XXX_BG_CLK_LOCK(mbhc->resmgr);
	wcd9xxx_resmgr_get_bandgap(mbhc->resmgr, WCD9XXX_BANDGAP_MBHC_MODE);
	/*
	 * Fast(mbhc) mode bandagap doesn't need to be enabled explicitly
	 * since fast mode is set by MBHC hardware when override is on.
	 * Enable bandgap mode to avoid unnecessary RCO disable and enable
	 * during clock source change.
	 */
	wcd9xxx_resmgr_get_bandgap(mbhc->resmgr, WCD9XXX_BANDGAP_AUDIO_MODE);
	wcd9xxx_resmgr_get_clk_block(mbhc->resmgr, WCD9XXX_CLK_RCO);
	WCD9XXX_BG_CLK_UNLOCK(mbhc->resmgr);