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

Commit 2adf163a 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: Configure correct gain on set Volume command"

parents ccdf4adc 2d7c0096
Loading
Loading
Loading
Loading
+23 −4
Original line number Diff line number Diff line
@@ -177,8 +177,31 @@ static int msm_compr_set_volume(struct snd_compr_stream *cstream,
			pr_debug("%s: call q6asm_set_lrgain\n", __func__);
			rc = q6asm_set_lrgain(prtd->audio_client,
						volume_l, volume_r);
			if (rc < 0) {
				pr_err("%s: set lrgain command failed rc=%d\n",
				__func__, rc);
				return rc;
			}
			/*
			 * set master gain to unity so that only lr gain
			 * is effective
			 */
			rc = q6asm_set_volume(prtd->audio_client,
						COMPRESSED_LR_VOL_MAX_STEPS);
		} else {
			pr_debug("%s: call q6asm_set_volume\n", __func__);
			/*
			 * set left and right channel gain to unity so that
			 * only master gain is effective
			 */
			rc = q6asm_set_lrgain(prtd->audio_client,
						COMPRESSED_LR_VOL_MAX_STEPS,
						COMPRESSED_LR_VOL_MAX_STEPS);
			if (rc < 0) {
				pr_err("%s: set lrgain command failed rc=%d\n",
				__func__, rc);
				return rc;
			}
			rc = q6asm_set_volume(prtd->audio_client, volume_l);
		}
		if (rc < 0) {
@@ -677,10 +700,6 @@ static int msm_compr_configure_dsp(struct snd_compr_stream *cstream)
		return ret;
	}

	ret = msm_compr_set_volume(cstream, 0, 0);
	if (ret < 0)
		pr_err("%s : Set Volume failed : %d", __func__, ret);

	ret = q6asm_set_softvolume(ac, &softvol);
	if (ret < 0)
		pr_err("%s: Send SoftVolume Param failed ret=%d\n",