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

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

Merge "asoc: check subsys state in FE instead of q6 state"

parents 43c43f06 17f05165
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -1661,6 +1661,7 @@ static int msm_compr_playback_open(struct snd_compr_stream *cstream)
	struct snd_soc_component *component = NULL;
	struct msm_compr_audio *prtd = NULL;
	struct msm_compr_pdata *pdata = NULL;
	enum apr_subsys_state subsys_state;

	pr_debug("%s\n", __func__);
	component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
@@ -1674,6 +1675,13 @@ static int msm_compr_playback_open(struct snd_compr_stream *cstream)
			__func__, rtd->dai_link->cpu_dai_name, -EBUSY);
		return -EBUSY;
	}

	subsys_state = apr_get_subsys_state();
	if (subsys_state == APR_SUBSYS_DOWN) {
		pr_debug("%s: adsp is down\n", __func__);
		return -ENETRESET;
	}

	prtd = kzalloc(sizeof(struct msm_compr_audio), GFP_KERNEL);
	if (prtd == NULL) {
		pr_err("Failed to allocate memory for msm_compr_audio\n");
@@ -1768,6 +1776,7 @@ static int msm_compr_capture_open(struct snd_compr_stream *cstream)
	struct snd_soc_component *component = NULL;
	struct msm_compr_audio *prtd;
	struct msm_compr_pdata *pdata = NULL;
	enum apr_subsys_state subsys_state;

	pr_debug("%s\n", __func__);
	component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
@@ -1780,6 +1789,12 @@ static int msm_compr_capture_open(struct snd_compr_stream *cstream)
		pr_err("%s: pdata is NULL\n", __func__);
		return -EINVAL;
	}

	subsys_state = apr_get_subsys_state();
	if (subsys_state == APR_SUBSYS_DOWN) {
		pr_debug("%s: adsp is down\n", __func__);
		return -ENETRESET;
	}
	prtd = kzalloc(sizeof(struct msm_compr_audio), GFP_KERNEL);
	if (!prtd) {
		pr_err("Failed to allocate memory for msm_compr_audio\n");
+6 −0
Original line number Diff line number Diff line
@@ -181,7 +181,13 @@ static int msm_pcm_open(struct snd_pcm_substream *substream)
	struct snd_pcm_runtime *runtime = substream->runtime;
	struct msm_audio *prtd;
	int ret = 0;
	enum apr_subsys_state subsys_state;

	subsys_state = apr_get_subsys_state();
	if (subsys_state == APR_SUBSYS_DOWN) {
		pr_debug("%s: adsp is down\n", __func__);
		return -ENETRESET;
	}
	prtd = kzalloc(sizeof(struct msm_audio), GFP_KERNEL);

	if (prtd == NULL)
+8 −0
Original line number Diff line number Diff line
@@ -676,6 +676,7 @@ static int msm_pcm_open(struct snd_pcm_substream *substream)
			snd_soc_rtdcom_lookup(soc_prtd, DRV_NAME);
	struct msm_audio *prtd;
	struct msm_plat_data *pdata;
	enum apr_subsys_state subsys_state;
	int ret = 0;

	if (!component) {
@@ -689,6 +690,13 @@ static int msm_pcm_open(struct snd_pcm_substream *substream)
		pr_err("%s: platform data not populated\n", __func__);
		return -EINVAL;
	}

	subsys_state = apr_get_subsys_state();
	if (subsys_state == APR_SUBSYS_DOWN) {
		pr_debug("%s: adsp is down\n", __func__);
		return -ENETRESET;
	}

	prtd = kzalloc(sizeof(struct msm_audio), GFP_KERNEL);
	if (prtd == NULL)
		return -ENOMEM;
+7 −0
Original line number Diff line number Diff line
@@ -426,12 +426,19 @@ static int msm_transcode_loopback_set_params(struct snd_compr_stream *cstream,
	struct trans_loopback_pdata *pdata;
	uint32_t bit_width = 16;
	int ret = 0;
	enum apr_subsys_state subsys_state;

	if (trans == NULL) {
		pr_err("%s: Invalid param\n", __func__);
		return -EINVAL;
	}

	subsys_state = apr_get_subsys_state();
	if (subsys_state == APR_SUBSYS_DOWN) {
		pr_debug("%s: adsp is down\n", __func__);
		return -ENETRESET;
	}

	mutex_lock(&trans->lock);

	rtd = snd_pcm_substream_chip(cstream);