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

Commit ab0a595e 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: msm_bg: Avoid register access if ADSP not ready"

parents 22176cc5 82a3d230
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line

/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2018, 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
@@ -960,6 +960,12 @@ static int msm_tdm_startup(struct snd_pcm_substream *substream)
		 substream->name, substream->stream);
	pr_debug("dai id = 0x%x", cpu_dai->id);

	if (!q6core_is_adsp_ready()) {
		pr_err_ratelimited("%s: ADSP Audio isn't ready\n",
					   __func__);
		return -EINVAL;
	}

	switch (cpu_dai->id) {
	case AFE_PORT_ID_PRIMARY_TDM_RX:
	case AFE_PORT_ID_PRIMARY_TDM_RX_1:
@@ -1049,6 +1055,11 @@ static void msm_tdm_shutdown(struct snd_pcm_substream *substream)
				pr_err("Failed to set spkr_vreg mode.\n");
				goto err;
			}

			if (!q6core_is_adsp_ready()) {
				pr_err("%s(): adsp not ready\n", __func__);
				goto err;
			}
			/* Reset Configuration of mux for Primary TDM */
			if (pdata->vaddr_gpio_mux_pcm_ctl) {
				val = ioread32(pdata->vaddr_gpio_mux_pcm_ctl);