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

Commit 0039ff6c authored by Laxminath Kasam's avatar Laxminath Kasam Committed by Gerrit - the friendly Code Review server
Browse files

asoc: msm_sdw: Handle locking for mclk enable flag



To synchronize codec read/write with PDR/SSR, take
lock before update of mclk enable flag.

Change-Id: I3e4faa27e2e6af71fd767a6be43bbb9d234c7192
Signed-off-by: default avatarLaxminath Kasam <lkasam@codeaurora.org>
parent d62420be
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -328,7 +328,8 @@ static int msm_sdw_ahb_write_device(struct msm_sdw_priv *msm_sdw,
{
	u32 temp = (u32)(*value) & 0x000000FF;

	if (!msm_sdw->dev_up) {
	if (!msm_sdw->dev_up ||
	    !q6core_is_adsp_ready()) {
		dev_err_ratelimited(msm_sdw->dev, "%s: q6 not ready\n",
				    __func__);
		return 0;
@@ -343,7 +344,8 @@ static int msm_sdw_ahb_read_device(struct msm_sdw_priv *msm_sdw,
{
	u32 temp;

	if (!msm_sdw->dev_up) {
	if (!msm_sdw->dev_up ||
	    !q6core_is_adsp_ready()) {
		dev_err_ratelimited(msm_sdw->dev, "%s: q6 not ready\n",
				    __func__);
		return 0;
@@ -1811,7 +1813,9 @@ static int msm_sdw_notifier_service_cb(struct notifier_block *nb,
			initial_boot = false;
			break;
		}
		mutex_lock(&msm_sdw->cdc_int_mclk1_mutex);
		msm_sdw->int_mclk1_enabled = false;
		mutex_unlock(&msm_sdw->cdc_int_mclk1_mutex);
		msm_sdw->dev_up = false;
		for (i = 0; i < msm_sdw->nr; i++)
			swrm_wcd_notify(msm_sdw->sdw_ctrl_data[i].sdw_pdev,