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

Commit a6590f8e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "asoc: check apr state in FE open" into audio-drivers.lnx.3.0

parents c4783a33 bcc4ca4d
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1602,6 +1602,7 @@ static int msm_compr_playback_open(struct snd_compr_stream *cstream)
	struct msm_compr_audio *prtd = NULL;
	struct msm_compr_pdata *pdata =
			snd_soc_platform_get_drvdata(rtd->platform);
	enum apr_subsys_state q6_state;

	pr_debug("%s\n", __func__);
	if (pdata->is_in_use[rtd->dai_link->id] == true) {
@@ -1609,6 +1610,12 @@ static int msm_compr_playback_open(struct snd_compr_stream *cstream)
			__func__, rtd->dai_link->cpu_dai_name, -EBUSY);
		return -EBUSY;
	}

	q6_state = apr_get_q6_state();
	if (q6_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");
@@ -1703,8 +1710,15 @@ static int msm_compr_capture_open(struct snd_compr_stream *cstream)
	struct msm_compr_audio *prtd;
	struct msm_compr_pdata *pdata =
			snd_soc_platform_get_drvdata(rtd->platform);
	enum apr_subsys_state q6_state;

	pr_debug("%s\n", __func__);

	q6_state = apr_get_q6_state();
	if (q6_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");
+6 −0
Original line number Diff line number Diff line
@@ -186,7 +186,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 q6_state;

	q6_state = apr_get_q6_state();
	if (q6_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)
+7 −0
Original line number Diff line number Diff line
@@ -679,6 +679,7 @@ static int msm_pcm_open(struct snd_pcm_substream *substream)
	struct snd_soc_pcm_runtime *soc_prtd = substream->private_data;
	struct msm_audio *prtd;
	struct msm_plat_data *pdata;
	enum apr_subsys_state q6_state;
	int ret = 0;

	pdata = (struct msm_plat_data *)
@@ -687,6 +688,12 @@ static int msm_pcm_open(struct snd_pcm_substream *substream)
		pr_err("%s: platform data not populated\n", __func__);
		return -EINVAL;
	}

	q6_state = apr_get_q6_state();
	if (q6_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 −1
Original line number Diff line number Diff line
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -415,12 +415,18 @@ 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 q6_state;

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

	q6_state = apr_get_q6_state();
	if (q6_state == APR_SUBSYS_DOWN) {
		pr_debug("%s: adsp is down\n", __func__);
		return -ENETRESET;
	}
	mutex_lock(&trans->lock);

	rtd = snd_pcm_substream_chip(cstream);