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

Commit 7cb4ff6b authored by Ramprasad Katkam's avatar Ramprasad Katkam Committed by Laxminath Kasam
Browse files

soc: swr-mstr: Use single pm runtime call during port enable



Add changes to call pm runtime calls only once for soundwire
master active, to be able to decrement and put to suspend
during SSR.

Change-Id: I068040e2a224d1ee97f472f69f25af77ae632be2
Signed-off-by: default avatarRamprasad Katkam <katkam@codeaurora.org>
parent 497a651e
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -921,8 +921,6 @@ static int swrm_slvdev_datapath_control(struct swr_master *master, bool enable)
	}
	mutex_lock(&swrm->mlock);

	if (enable)
		pm_runtime_get_sync(swrm->dev);
	bank = get_inactive_bank_num(swrm);

	if (enable) {
@@ -983,6 +981,8 @@ static int swrm_slvdev_datapath_control(struct swr_master *master, bool enable)
	else {
		swrm_disable_ports(master, inactive_bank);
		swrm_cleanup_disabled_port_reqs(master);
	}
	if (!swrm_is_port_en(master)) {
		dev_dbg(&master->dev, "%s: pm_runtime auto suspend triggered\n",
			__func__);
		pm_runtime_mark_last_busy(swrm->dev);
@@ -1014,6 +1014,8 @@ static int swrm_connect_port(struct swr_master *master,
	}

	mutex_lock(&swrm->mlock);
	if (!swrm_is_port_en(master))
		pm_runtime_get_sync(swrm->dev);

	for (i = 0; i < portinfo->num_port; i++) {
		ret = swrm_get_master_port(swrm, &mstr_port_id, &mstr_ch_msk,