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

Commit 8b0f760d authored by Neema Shetty's avatar Neema Shetty Committed by Stephen Boyd
Browse files

ASoC: msm: Apply cached volume and mute at call start.



Volume and mute settings before voice call is started are cached
in the driver, apply the cached settings at call start.

Change-Id: Iabc1f47c46a8e986c79106545ac3ee977fbca99c
Signed-off-by: default avatarNeema Shetty <nshetty@codeaurora.org>
parent e5c921e0
Loading
Loading
Loading
Loading
+19 −3
Original line number Diff line number Diff line
@@ -2344,6 +2344,9 @@ static int voice_destroy_vocproc(struct voice_data *v)
	/* send stop voice cmd */
	voice_send_stop_voice_cmd(v);

	/* Clear mute setting */
	v->dev_tx.mute = common.default_mute_val;

	/* detach VOCPROC and wait for response from mvm */
	mvm_d_vocproc_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD,
						APR_HDR_LEN(APR_HDR_SIZE),
@@ -3106,7 +3109,9 @@ int voc_set_tx_mute(uint16_t session_id, uint32_t dir, uint32_t mute)

	v->dev_tx.mute = mute;

	if (v->voc_state == VOC_RUN)
	if ((v->voc_state == VOC_RUN) ||
	    (v->voc_state == VOC_CHANGE) ||
	    (v->voc_state == VOC_STANDBY))
		ret = voice_send_mute_cmd(v);

	mutex_unlock(&v->lock);
@@ -3312,7 +3317,9 @@ int voc_set_rx_vol_index(uint16_t session_id, uint32_t dir, uint32_t vol_idx)

	v->dev_rx.volume = vol_idx;

	if (v->voc_state == VOC_RUN)
	if ((v->voc_state == VOC_RUN) ||
	    (v->voc_state == VOC_CHANGE) ||
	    (v->voc_state == VOC_STANDBY))
		ret = voice_send_vol_index_cmd(v);

	mutex_unlock(&v->lock);
@@ -3501,6 +3508,15 @@ int voc_start_voice_call(uint16_t session_id)
			pr_err("setup voice failed\n");
			goto fail;
		}

		ret = voice_send_vol_index_cmd(v);
		if (ret < 0)
			pr_err("voice volume failed\n");

		ret = voice_send_mute_cmd(v);
		if (ret < 0)
			pr_err("voice mute failed\n");

		ret = voice_send_start_voice_cmd(v);
		if (ret < 0) {
			pr_err("start voice failed\n");
@@ -3998,7 +4014,7 @@ static int __init voice_init(void)
	memset((void *)common.cvs_cal.buf, 0, CVS_CAL_SIZE);
cont:
	/* set default value */
	common.default_mute_val = 1;  /* default is mute */
	common.default_mute_val = 0;  /* default is un-mute */
	common.default_vol_val = 0;
	common.default_sample_val = 8000;