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

Commit 83338b5e authored by Viraja Kommaraju's avatar Viraja Kommaraju Committed by Hongtao Peng
Browse files

ASoC: dsp: find CAL block using buffer number



Use FEdai_id to calculate the buffer number and
use the same to identify the right CAL block for
ASM CAL types.

Change-Id: Iab83892f5c2f2bc54c8fa97ac084d8a04586f712
Signed-off-by: default avatarViraja Kommaraju <virajak@codeaurora.org>
Signed-off-by: default avatarHongtao Peng <hongtaop@codeaurora.org>
parent 965a68a2
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
 */


@@ -1609,6 +1609,9 @@ static int msm_compr_configure_dsp_for_playback
	else if (prtd->codec_param.codec.format == SNDRV_PCM_FORMAT_S32_LE)
		bits_per_sample = 32;

	ac->fedai_id = soc_prtd->dai_link->id;
	ac->stream_type = SNDRV_PCM_STREAM_PLAYBACK;

	if (prtd->compr_passthr != LEGACY_PCM) {
		ret = q6asm_open_write_compressed(ac, prtd->codec,
						  prtd->compr_passthr);
@@ -1764,6 +1767,9 @@ static int msm_compr_configure_dsp_for_capture(struct snd_compr_stream *cstream)
		break;
	}

	prtd->audio_client->stream_type = SNDRV_PCM_STREAM_CAPTURE;
	prtd->audio_client->fedai_id = soc_prtd->dai_link->id;

	pr_debug("%s: stream_id %d bits_per_sample %d compr_passthr %d\n",
			__func__, ac->stream_id, bits_per_sample,
			prtd->compr_passthr);
@@ -3029,6 +3035,7 @@ static int msm_compr_trigger(struct snd_compr_stream *cstream, int cmd)
		pr_debug("%s: open_write stream_id %d bits_per_sample %d",
				__func__, stream_id, bits_per_sample);

		prtd->audio_client->fedai_id = (int)fe_id;
		if (q6core_get_avcs_api_version_per_service(
					APRV2_IDS_SERVICE_ID_ADSP_ASM_V) >=
					ADSP_ASM_API_VERSION_V2)
+2 −0
Original line number Diff line number Diff line
@@ -343,6 +343,8 @@ static int msm_pcm_open(struct snd_pcm_substream *substream)
			mutex_unlock(&pcm->lock);
			return -ENOMEM;
		}

		pcm->audio_client->fedai_id = rtd->dai_link->id;
		pcm->session_id = pcm->audio_client->session;
		pcm->audio_client->perf_mode = pdata->perf_mode;
		ret = q6asm_open_loopback_v2(pcm->audio_client,
+2 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
 */

#include <linux/init.h>
@@ -367,6 +367,7 @@ static int msm_pcm_hw_params(struct snd_pcm_substream *substream,
	config.bufsz = params_buffer_bytes(params) / params_periods(params);
	config.bufcnt = params_periods(params);

	prtd->audio_client->fedai_id = soc_prtd->dai_link->id;
	ret = q6asm_open_shared_io(prtd->audio_client, &config, dir,
				   use_default_chmap, chmap);
	if (ret) {
+6 −0
Original line number Diff line number Diff line
@@ -369,6 +369,9 @@ static int msm_pcm_playback_prepare(struct snd_pcm_substream *substream)
	prtd->audio_client->perf_mode = pdata->perf_mode;
	pr_debug("%s: perf: %x\n", __func__, pdata->perf_mode);

	prtd->audio_client->stream_type = SNDRV_PCM_STREAM_PLAYBACK;
	prtd->audio_client->fedai_id = soc_prtd->dai_link->id;

	switch (params_format(params)) {
	case SNDRV_PCM_FORMAT_S32_LE:
		bits_per_sample = 32;
@@ -532,6 +535,9 @@ static int msm_pcm_capture_prepare(struct snd_pcm_substream *substream)
				__func__, params_channels(params),
				prtd->audio_client->perf_mode);

		prtd->audio_client->stream_type = SNDRV_PCM_STREAM_CAPTURE;
		prtd->audio_client->fedai_id = soc_prtd->dai_link->id;

		if ((q6core_get_avcs_api_version_per_service(
				APRV2_IDS_SERVICE_ID_ADSP_ASM_V) >=
				ADSP_ASM_API_VERSION_V2))
+1 −0
Original line number Diff line number Diff line
@@ -540,6 +540,7 @@ static int msm_transcode_loopback_set_params(struct snd_compr_stream *cstream,
						loopback_event_handler);
		trans->session_id = trans->audio_client->session;
		trans->audio_client->perf_mode = trans->sink.perf_mode;
		trans->audio_client->fedai_id = rtd->dai_link->id;
		ret = q6asm_open_transcode_loopback(trans->audio_client,
					bit_width,
					trans->source.codec_format,
Loading