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

Commit eac0bbe7 authored by Yamit Mehta's avatar Yamit Mehta Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: msm: qdsp6v2: Modify wait event and cmd state check



Modify wait event and cmd state condition check for positive
integer as adsp returns  positive error number.

CRs-fixed: 1074954
Change-Id: Id2be933de4072f3953536c9a2b75f08763352673
Signed-off-by: default avatarYamit Mehta <ymehta@codeaurora.org>
parent b506bc00
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -8310,7 +8310,7 @@ int q6asm_send_cal(struct audio_client *ac)
	q6asm_add_hdr_async(ac, &hdr, (sizeof(struct apr_hdr) +
		sizeof(struct asm_stream_cmd_set_pp_params_v2)), TRUE);

	atomic_set(&ac->cmd_state, 1);
	atomic_set(&ac->cmd_state, -1);
	hdr.opcode = ASM_STREAM_CMD_SET_PP_PARAMS_V2;
	payload_params.data_payload_addr_lsw =
			lower_32_bits(cal_block->cal_data.paddr);
@@ -8336,13 +8336,13 @@ int q6asm_send_cal(struct audio_client *ac)
		goto free;
	}
	rc = wait_event_timeout(ac->cmd_wait,
				(atomic_read(&ac->cmd_state) <= 0), 5 * HZ);
				(atomic_read(&ac->cmd_state) >= 0), 5 * HZ);
	if (!rc) {
		pr_err("%s: timeout, audio audstrm cal send\n", __func__);
		rc = -ETIMEDOUT;
		goto free;
	}
	if (atomic_read(&ac->cmd_state) < 0) {
	if (atomic_read(&ac->cmd_state) > 0) {
		pr_err("%s: DSP returned error[%d] audio audstrm cal send\n",
				__func__, atomic_read(&ac->cmd_state));
		rc = -EINVAL;