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

Commit a41d7033 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 7e00a355 0905845d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ struct rouleur_priv {
	struct mutex rx_clk_lock;
	struct mutex main_bias_lock;
	bool dev_up;
	bool usbc_hs_status;
};

struct rouleur_micbias_setting {
+15 −0
Original line number Diff line number Diff line
@@ -1342,6 +1342,17 @@ static int rouleur_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, ROULEUR_ANA_MBHC_MECH)
			& 0x20))
			return true;
	}
	return false;
}

static int rouleur_event_notify(struct notifier_block *block,
				unsigned long val,
				void *data)
@@ -1374,6 +1385,8 @@ static int rouleur_event_notify(struct notifier_block *block,
		rouleur->dev_up = false;
		rouleur->mbhc->wcd_mbhc.deinit_in_progress = true;
		mbhc = &rouleur->mbhc->wcd_mbhc;
		rouleur->usbc_hs_status = get_usbc_hs_status(component,
						mbhc->mbhc_cfg);
		rouleur_mbhc_ssr_down(rouleur->mbhc, component);
		rouleur_reset(rouleur->dev, 0x01);
		break;
@@ -1395,6 +1408,8 @@ static int rouleur_event_notify(struct notifier_block *block,
				__func__);
		} else {
			rouleur_mbhc_hs_detect(component, mbhc->mbhc_cfg);
			if (rouleur->usbc_hs_status)
				mdelay(500);
		}
		rouleur->mbhc->wcd_mbhc.deinit_in_progress = false;
		rouleur->dev_up = true;