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

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

Merge "ASoC: msm: add q6core ready check before io access"

parents c96fd602 8c9bb339
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <sound/pcm.h>
#include <sound/jack.h>
#include <sound/q6afe-v2.h>
#include <sound/q6core.h>
#include <soc/qcom/socinfo.h>
#include "qdsp6v2/msm-pcm-routing-v2.h"
#include "msm-audio-pinctrl.h"
@@ -1167,6 +1168,11 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream)
	pr_debug("%s(): substream = %s  stream = %d\n", __func__,
		 substream->name, substream->stream);

	if (!q6core_is_adsp_ready()) {
		pr_err("%s(): adsp not ready\n", __func__);
		return -EINVAL;
	}

	/*
	 * configure the slave select to
	 * invalid state for internal codec
@@ -1217,6 +1223,7 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream)

	return ret;
}

static void msm_mi2s_snd_shutdown(struct snd_pcm_substream *substream)
{
	int ret;
@@ -1257,6 +1264,11 @@ static int msm_prim_auxpcm_startup(struct snd_pcm_substream *substream)
	pr_debug("%s(): substream = %s\n",
			__func__, substream->name);

	if (!q6core_is_adsp_ready()) {
		pr_err("%s(): adsp not ready\n", __func__);
		return -EINVAL;
	}

	/* mux config to route the AUX MI2S */
	if (pdata->vaddr_gpio_mux_mic_ctl) {
		val = ioread32(pdata->vaddr_gpio_mux_mic_ctl);
@@ -1323,6 +1335,12 @@ static int msm_sec_mi2s_snd_startup(struct snd_pcm_substream *substream)
					__func__);
		return 0;
	}

	if (!q6core_is_adsp_ready()) {
		pr_err("%s(): adsp not ready\n", __func__);
		return -EINVAL;
	}

	if ((pdata->ext_pa & SEC_MI2S_ID) == SEC_MI2S_ID) {
		if (pdata->vaddr_gpio_mux_spkr_ctl) {
			val = ioread32(pdata->vaddr_gpio_mux_spkr_ctl);
@@ -1396,6 +1414,12 @@ static int msm_quat_mi2s_snd_startup(struct snd_pcm_substream *substream)

	pr_debug("%s(): substream = %s  stream = %d\n", __func__,
				substream->name, substream->stream);

	if (!q6core_is_adsp_ready()) {
		pr_err("%s(): adsp not ready\n", __func__);
		return -EINVAL;
	}

	if (pdata->vaddr_gpio_mux_mic_ctl) {
		val = ioread32(pdata->vaddr_gpio_mux_mic_ctl);
		val = val | 0x02020002;
@@ -1454,6 +1478,12 @@ static int msm_quin_mi2s_snd_startup(struct snd_pcm_substream *substream)

	pr_debug("%s(): substream = %s  stream = %d\n", __func__,
				substream->name, substream->stream);

	if (!q6core_is_adsp_ready()) {
		pr_err("%s(): adsp not ready\n", __func__);
		return -EINVAL;
	}

	if (pdata->vaddr_gpio_mux_quin_ctl) {
		val = ioread32(pdata->vaddr_gpio_mux_quin_ctl);
		val = val | 0x00000001;