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

Commit bd2c1766 authored by Prasad Kumpatla's avatar Prasad Kumpatla Committed by Gerrit - the friendly Code Review server
Browse files

asoc: codecs: Add delay to eliminate playback pause post SSR on hs



Add delay in post ssr to eliminate playback pause on euro headset.On
post ssr hs detected as hp due to where pa become on before the completion
of wcd_correct_swch_plug workqueue which lead to detect plug_type
as hp.

Change-Id: Ie114fcd0458d9f5edebeee087c90600c3b0c3da2
Signed-off-by: default avatarPrasad Kumpatla <nkumpat@codeaurora.org>
parent 93afa626
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ struct wcd937x_priv {
	int ana_clk_count;
	struct mutex ana_tx_clk_lock;
	u8 tx_master_ch_map[WCD937X_MAX_SLAVE_CH_TYPES];
	bool usbc_hs_status;
};

struct wcd937x_micbias_setting {
+15 −0
Original line number Diff line number Diff line
@@ -1567,6 +1567,17 @@ static int wcd937x_get_logical_addr(struct swr_device *swr_dev)
	return 0;
}

static bool get_usbc_hs_status(struct snd_soc_component *component,
			struct wcd_mbhc_config *mbhc_cfg)
{
	if (mbhc_cfg->enable_usbc_analog) {
		if (!(snd_soc_component_read32(component, WCD937X_ANA_MBHC_MECH)
			& 0x20))
			return true;
	}
	return false;
}

static int wcd937x_event_notify(struct notifier_block *block,
				unsigned long val,
				void *data)
@@ -1602,6 +1613,8 @@ static int wcd937x_event_notify(struct notifier_block *block,
	case BOLERO_WCD_EVT_SSR_DOWN:
		wcd937x->mbhc->wcd_mbhc.deinit_in_progress = true;
		mbhc = &wcd937x->mbhc->wcd_mbhc;
		wcd937x->usbc_hs_status = get_usbc_hs_status(component,
						mbhc->mbhc_cfg);
		wcd937x_mbhc_ssr_down(wcd937x->mbhc, component);
		wcd937x_reset_low(wcd937x->dev);
		break;
@@ -1622,6 +1635,8 @@ static int wcd937x_event_notify(struct notifier_block *block,
				__func__);
		} else {
			wcd937x_mbhc_hs_detect(component, mbhc->mbhc_cfg);
			if (wcd937x->usbc_hs_status)
				mdelay(500);
		}
		wcd937x->mbhc->wcd_mbhc.deinit_in_progress = false;
		break;
+1 −0
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ struct wcd938x_priv {
	int ear_rx_path;
	bool dev_up;
	u8 tx_master_ch_map[WCD938X_MAX_SLAVE_CH_TYPES];
	bool usbc_hs_status;
};

struct wcd938x_micbias_setting {
+15 −0
Original line number Diff line number Diff line
@@ -1998,6 +1998,17 @@ static int wcd938x_get_logical_addr(struct swr_device *swr_dev)
	return 0;
}

static bool get_usbc_hs_status(struct snd_soc_component *component,
			struct wcd_mbhc_config *mbhc_cfg)
{
	if (mbhc_cfg->enable_usbc_analog) {
		if (!(snd_soc_component_read32(component, WCD938X_ANA_MBHC_MECH)
			& 0x20))
			return true;
	}
	return false;
}

static int wcd938x_event_notify(struct notifier_block *block,
				unsigned long val,
				void *data)
@@ -2043,6 +2054,8 @@ static int wcd938x_event_notify(struct notifier_block *block,
		wcd938x->dev_up = false;
		wcd938x->mbhc->wcd_mbhc.deinit_in_progress = true;
		mbhc = &wcd938x->mbhc->wcd_mbhc;
		wcd938x->usbc_hs_status = get_usbc_hs_status(component,
						mbhc->mbhc_cfg);
		wcd938x_mbhc_ssr_down(wcd938x->mbhc, component);
		wcd938x_reset_low(wcd938x->dev);
		break;
@@ -2065,6 +2078,8 @@ static int wcd938x_event_notify(struct notifier_block *block,
				__func__);
		} else {
			wcd938x_mbhc_hs_detect(component, mbhc->mbhc_cfg);
			if (wcd938x->usbc_hs_status)
				mdelay(500);
		}
		wcd938x->mbhc->wcd_mbhc.deinit_in_progress = false;
		wcd938x->dev_up = true;