@@ -21,6 +21,7 @@
#include <linux/clk.h>
#include <linux/coresight.h>
#include <linux/amba/bus.h>
+#include <linux/pm_runtime.h>
#include "coresight-priv.h"
@@ -73,6 +74,7 @@ static int funnel_enable(struct coresight_device *csdev, int inport,
if (ret)
return ret;
+ pm_runtime_get_sync(drvdata->dev);
funnel_enable_hw(drvdata, inport);
dev_info(drvdata->dev, "FUNNEL inport %d enabled\n", inport);
@@ -98,7 +100,7 @@ static void funnel_disable(struct coresight_device *csdev, int inport,
struct funnel_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
funnel_disable_hw(drvdata, inport);
-
+ pm_runtime_put_sync(drvdata->dev);
clk_disable_unprepare(drvdata->clk);
dev_info(drvdata->dev, "FUNNEL inport %d disabled\n", inport);
@@ -161,8 +163,10 @@ static ssize_t funnel_ctrl_show(struct device *dev,
if (ret)
return ret;
+ pm_runtime_get_sync(drvdata->dev);
val = get_funnel_ctrl_hw(drvdata);
clk_disable_unprepare(drvdata->clk);
+ pm_runtime_put_sync(drvdata->dev);
return sprintf(buf, "%#x\n", val);
}
@@ -222,6 +226,9 @@ static int funnel_probe(struct amba_device *adev, const struct amba_id *id)
if (IS_ERR(drvdata->csdev))
return PTR_ERR(drvdata->csdev);
+ pm_runtime_set_suspended(dev);
+ pm_runtime_put_noidle(dev);
+
dev_info(dev, "FUNNEL initialized\n");
return 0;
}