]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
coresight-tnoc: Add runtime PM support for Interconnect TNOC
authorYuanfang Zhang <yuanfang.zhang@oss.qualcomm.com>
Thu, 4 Dec 2025 04:43:09 +0000 (20:43 -0800)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Mon, 19 Jan 2026 10:49:47 +0000 (10:49 +0000)
This patch adds runtime power management support for platform-based
CoreSight Interconnect TNOC (ITNOC) devices. It introduces suspend and
resume callbacks to manage the APB clock (`pclk`) during device runtime
transitions.

Signed-off-by: Yuanfang Zhang <yuanfang.zhang@oss.qualcomm.com>
Reviewed-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20251203-itnoc-v5-3-5b97c63f2268@oss.qualcomm.com
drivers/hwtracing/coresight/coresight-tnoc.c

index affd8204b534d59e7029d7bc3e1ca16e41e58b45..1128612e70a7312606d79b19ed1f4e91f01ddfc2 100644 (file)
@@ -305,6 +305,28 @@ static void itnoc_remove(struct platform_device *pdev)
        pm_runtime_disable(&pdev->dev);
 }
 
+#ifdef CONFIG_PM
+static int itnoc_runtime_suspend(struct device *dev)
+{
+       struct trace_noc_drvdata *drvdata = dev_get_drvdata(dev);
+
+       clk_disable_unprepare(drvdata->pclk);
+
+       return 0;
+}
+
+static int itnoc_runtime_resume(struct device *dev)
+{
+       struct trace_noc_drvdata *drvdata = dev_get_drvdata(dev);
+
+       return clk_prepare_enable(drvdata->pclk);
+}
+#endif
+
+static const struct dev_pm_ops itnoc_dev_pm_ops = {
+       SET_RUNTIME_PM_OPS(itnoc_runtime_suspend, itnoc_runtime_resume, NULL)
+};
+
 static const struct of_device_id itnoc_of_match[] = {
        { .compatible = "qcom,coresight-itnoc" },
        {}
@@ -318,6 +340,7 @@ static struct platform_driver itnoc_driver = {
                .name = "coresight-itnoc",
                .of_match_table = itnoc_of_match,
                .suppress_bind_attrs = true,
+               .pm = &itnoc_dev_pm_ops,
        },
 };