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

Commit 5b1fd595 authored by Soumya Managoli's avatar Soumya Managoli
Browse files

soc: reduce the auto suspend timeout when swr event finished



the APSS would suspend within ~120ms after audio off, if system suspend
swrm_suspend() is called before swrm_runtime_suspend. The clock stop
sequence require writing IPC and expect interrupt, which would stop
the APSS to be suspended. Reduce the auto suspend time specifically when
swr event is done can call the swrm_runtime_suspend

Change-Id: Iee0c9143d65e5a8e68a8e20ab73bea9def1920bd
Signed-off-by: default avatarJunkai Cai <junkai@codeaurora.org>
Signed-off-by: default avatarSoumya Managoli <quic_c_smanag@quicinc.com>
parent fad96773
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
 */

#include <linux/irq.h>
@@ -1738,6 +1738,8 @@ static int swrm_slvdev_datapath_control(struct swr_master *master, bool enable)
		dev_dbg(&master->dev, "%s: pm_runtime auto suspend triggered\n",
			__func__);
		pm_runtime_mark_last_busy(swrm->dev);
		if (!enable)
			pm_runtime_set_autosuspend_delay(swrm->dev, 80);
		pm_runtime_put_autosuspend(swrm->dev);
	}
exit:
@@ -3327,6 +3329,9 @@ static int swrm_runtime_suspend(struct device *dev)
	if (!hw_core_err)
		swrm_request_hw_vote(swrm, LPASS_HW_CORE, false);
	mutex_unlock(&swrm->reslock);
	dev_dbg(dev, "%s: pm_runtime: suspend done state: %d\n",
			__func__, swrm->state);
	pm_runtime_set_autosuspend_delay(dev, auto_suspend_timer);
	return ret;
}
#endif /* CONFIG_PM */