@@ -88,7 +88,7 @@ config QCOM_RPMH
config QCOM_SYSTEM_PM
bool "Qualcomm System PM"
- depends on CPU_PM && QCOM_RPMH
+ depends on CPU_PM && PM_SLEEP && QCOM_RPMH
help
Support for QCOM platform system power management to perform tasks
necessary while application processor votes for deeper modes so that
@@ -67,6 +67,23 @@ static int sys_pm_probe(struct platform_device *pdev)
return 0;
}
+static int sys_pm_suspend(struct device *dev)
+{
+ if (rpmh_ctrlr_idle(dev)) {
+ /* Flush the sleep/wake sets in RSC controller */
+ rpmh_flush(dev);
+ } else {
+ pr_err("%s:rpmh controller is busy\n", __func__);
+ return -EBUSY;
+ }
+
+ return 0;
+}
+
+static const struct dev_pm_ops sys_pm_dev_pm_ops = {
+ SET_LATE_SYSTEM_SLEEP_PM_OPS(sys_pm_suspend, NULL)
+};
+
static const struct of_device_id sys_pm_drv_match[] = {
{ .compatible = "qcom,system-pm", },
{ }
@@ -77,6 +94,7 @@ static int sys_pm_probe(struct platform_device *pdev)
.driver = {
.name = KBUILD_MODNAME,
.of_match_table = sys_pm_drv_match,
+ .pm = &sys_pm_dev_pm_ops,
},
};
builtin_platform_driver(sys_pm_driver);
Add suspend power management ops so that the sleep & wake resource requests are flushed to corresponding TCS. The firmware would ensure that the buffered requests in TCS are sent to Resource Power Manager during entry to deepest low power modes. Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org> --- drivers/soc/qcom/Kconfig | 2 +- drivers/soc/qcom/system_pm.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-)