From 7cb4ff6b651f11d344e2bc96d9b06e0342d6f166 Mon Sep 17 00:00:00 2001 From: Ramprasad Katkam Date: Wed, 12 Sep 2018 04:00:26 +0530 Subject: [PATCH] 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: Ramprasad Katkam --- soc/swr-mstr-ctrl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/soc/swr-mstr-ctrl.c b/soc/swr-mstr-ctrl.c index d3fb08769850..15e3511edb98 100644 --- a/soc/swr-mstr-ctrl.c +++ b/soc/swr-mstr-ctrl.c @@ -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,