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

Commit 7c88288c authored by Banajit Goswami's avatar Banajit Goswami
Browse files

ASoC: msm: q6dspv2: add check for APR handle before using APR



APR registration must be suceessful and a non-NULL handle must be
returned from APR driver before the servicec can be used for
communicating. Add a check in q6core driver to see if the APR
registration is done successfully before sending any APR packet.

CRs-fixed: 2022490
Change-Id: I88b09f3e1f58b0147b81ee734f87906c7ef09167
Signed-off-by: default avatarBanajit Goswami <bgoswami@codeaurora.org>
parent 51b53695
Loading
Loading
Loading
Loading
+17 −15
Original line number Diff line number Diff line
@@ -496,7 +496,7 @@ uint32_t core_set_dolby_manufacturer_id(int manufacturer_id)

bool q6core_is_adsp_ready(void)
{
	int rc;
	int rc = 0;
	bool ret = false;
	struct apr_hdr hdr;

@@ -509,6 +509,7 @@ bool q6core_is_adsp_ready(void)

	mutex_lock(&(q6core_lcl.cmd_lock));
	ocm_core_open();
	if (q6core_lcl.core_handle_q) {
		q6core_lcl.bus_bw_resp_received = 0;
		rc = apr_send_pkt(q6core_lcl.core_handle_q, (uint32_t *)&hdr);
		if (rc < 0) {
@@ -525,6 +526,7 @@ bool q6core_is_adsp_ready(void)
			rmb();
			ret = !!q6core_lcl.param;
		}
	}
bail:
	pr_debug("%s: leave, rc %d, adsp ready %d\n", __func__, rc, ret);
	mutex_unlock(&(q6core_lcl.cmd_lock));