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

Commit f98481cc 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: Handle bit_width to configure ASM session for FLAC playback"

parents cde25936 c7722df2
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1062,6 +1062,9 @@ static int msm_compr_configure_dsp_for_playback
	int dir = IN, ret = 0;
	struct audio_client *ac = prtd->audio_client;
	uint32_t stream_index;
	union snd_codec_options *codec_options =
		&(prtd->codec_param.codec.options);

	struct asm_softpause_params softpause = {
		.enable = SOFT_PAUSE_ENABLE,
		.period = SOFT_PAUSE_PERIOD,
@@ -1086,6 +1089,9 @@ static int msm_compr_configure_dsp_for_playback
		bits_per_sample = 24;
	else if (prtd->codec_param.codec.format == SNDRV_PCM_FORMAT_S32_LE)
		bits_per_sample = 32;
	else if (prtd->codec == FORMAT_FLAC && codec_options &&
		(codec_options->flac_dec.sample_size != 0))
		bits_per_sample = codec_options->flac_dec.sample_size;

	if (prtd->compr_passthr != LEGACY_PCM) {
		ret = q6asm_open_write_compressed(ac, prtd->codec,
@@ -1899,6 +1905,8 @@ static int msm_compr_trigger(struct snd_compr_stream *cstream, int cmd)
	int stream_id;
	uint32_t stream_index;
	uint16_t bits_per_sample = 16;
	union snd_codec_options *codec_options =
		&(prtd->codec_param.codec.options);

	spin_lock_irqsave(&prtd->lock, flags);
	if (atomic_read(&prtd->error)) {
@@ -2318,6 +2326,9 @@ static int msm_compr_trigger(struct snd_compr_stream *cstream, int cmd)
		else if (prtd->codec_param.codec.format ==
			 SNDRV_PCM_FORMAT_S32_LE)
			bits_per_sample = 32;
		else if (prtd->codec == FORMAT_FLAC && codec_options &&
			(codec_options->flac_dec.sample_size != 0))
			bits_per_sample = codec_options->flac_dec.sample_size;

		pr_debug("%s: open_write stream_id %d bits_per_sample %d",
				__func__, stream_id, bits_per_sample);