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

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

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

parents 1af88da7 ea9b7c38
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ struct wcd937x_priv {
	int ear_rx_path;
	int ana_clk_count;
	struct mutex ana_tx_clk_lock;
	bool usbc_hs_status;
};

struct wcd937x_micbias_setting {
+15 −0
Original line number Diff line number Diff line
@@ -1566,6 +1566,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)
@@ -1601,6 +1612,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;
@@ -1621,6 +1634,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
@@ -101,6 +101,7 @@ struct wcd938x_priv {
	int flyback_cur_det_disable;
	int ear_rx_path;
	bool dev_up;
	bool usbc_hs_status;
};

struct wcd938x_micbias_setting {
+15 −0
Original line number Diff line number Diff line
@@ -1973,6 +1973,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)
@@ -2018,6 +2029,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;
@@ -2040,6 +2053,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;