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

Commit f8802c24 authored by Banajit Goswami's avatar Banajit Goswami
Browse files

ASoC: qdsp6v2: update perf mode flag for LL capture cases



Read perf mode flag from platform data and update to the
audio client structure, so that the right settings can be
applied to ADM for Low-latency capture use-case.
Also, update the correct bit value for ASM perf mode flag
sent to DSP.

Change-Id: If1f8b9e657a409fd9d2af19ff004a797fd987788
Signed-off-by: default avatarBanajit Goswami <bgoswami@codeaurora.org>
parent e92aa60f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -4165,6 +4165,9 @@ struct asm_stream_cmd_open_write_v3 {
/* Absolute timestamp is identified by this value.*/
#define ASM_ABSOLUTEIMESTAMP      1

/* Bit value for Low Latency Tx stream subfield */
#define ASM_LOW_LATENCY_TX_STREAM_SESSION			1

/* Bit shift for the stream_perf_mode subfield. */
#define ASM_SHIFT_STREAM_PERF_MODE_FLAG_IN_OPEN_READ              29

+11 −0
Original line number Diff line number Diff line
@@ -347,17 +347,28 @@ static int msm_pcm_capture_prepare(struct snd_pcm_substream *substream)
	struct snd_pcm_runtime *runtime = substream->runtime;
	struct msm_audio *prtd = runtime->private_data;
	struct snd_soc_pcm_runtime *soc_prtd = substream->private_data;
	struct msm_plat_data *pdata;
	struct snd_pcm_hw_params *params;
	struct msm_pcm_routing_evt event;
	int ret = 0;
	int i = 0;
	uint16_t bits_per_sample = 16;

	pdata = (struct msm_plat_data *)
		dev_get_drvdata(soc_prtd->platform->dev);
	if (!pdata) {
		pr_err("%s: platform data not populated\n", __func__);
		return -EINVAL;
	}

	pr_debug("%s\n", __func__);
	params = &soc_prtd->dpcm[substream->stream].hw_params;
	if (params_format(params) == SNDRV_PCM_FORMAT_S24_LE)
		bits_per_sample = 24;

	prtd->audio_client->perf_mode = pdata->perf_mode;
	pr_debug("%s: perf_mode: 0x%x\n", __func__, pdata->perf_mode);

	pr_debug("%s Opening %d-ch PCM read stream\n",
			__func__, params_channels(params));
	ret = q6asm_open_read_v2(prtd->audio_client, FORMAT_LINEAR_PCM,
+1 −1
Original line number Diff line number Diff line
@@ -2012,7 +2012,7 @@ static int __q6asm_open_read(struct audio_client *ac,
	open.mode_flags = 0x0;

	if (ac->perf_mode == LOW_LATENCY_PCM_MODE) {
		open.mode_flags |= ASM_LOW_LATENCY_STREAM_SESSION <<
		open.mode_flags |= ASM_LOW_LATENCY_TX_STREAM_SESSION <<
			ASM_SHIFT_STREAM_PERF_MODE_FLAG_IN_OPEN_READ;
	} else {
		open.mode_flags |= ASM_LEGACY_STREAM_SESSION <<