coresight: moving PM runtime operations to core framework
[firefly-linux-kernel-4.4.55.git] / drivers / hwtracing / coresight / coresight-etm3x.c
index d630b7ece73521ccf8cd7b320ebd75ecc92eb1d3..fe6791e0c66c2969803e1f445084a11fe0713fc0 100644 (file)
@@ -315,6 +315,13 @@ static void etm_enable_hw(void *info)
        dev_dbg(drvdata->dev, "cpu: %d enable smp call done\n", drvdata->cpu);
 }
 
+static int etm_cpu_id(struct coresight_device *csdev)
+{
+       struct etm_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
+
+       return drvdata->cpu;
+}
+
 static int etm_trace_id(struct coresight_device *csdev)
 {
        struct etm_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
@@ -342,7 +349,6 @@ static int etm_enable(struct coresight_device *csdev)
        struct etm_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
        int ret;
 
-       pm_runtime_get_sync(csdev->dev.parent);
        spin_lock(&drvdata->spinlock);
 
        /*
@@ -366,7 +372,6 @@ static int etm_enable(struct coresight_device *csdev)
        return 0;
 err:
        spin_unlock(&drvdata->spinlock);
-       pm_runtime_put(csdev->dev.parent);
        return ret;
 }
 
@@ -415,12 +420,12 @@ static void etm_disable(struct coresight_device *csdev)
 
        spin_unlock(&drvdata->spinlock);
        put_online_cpus();
-       pm_runtime_put(csdev->dev.parent);
 
        dev_info(drvdata->dev, "ETM tracing disabled\n");
 }
 
 static const struct coresight_ops_source etm_source_ops = {
+       .cpu_id         = etm_cpu_id,
        .trace_id       = etm_trace_id,
        .enable         = etm_enable,
        .disable        = etm_disable,
@@ -1877,17 +1882,6 @@ err_arch_supported:
        return ret;
 }
 
-static int etm_remove(struct amba_device *adev)
-{
-       struct etm_drvdata *drvdata = amba_get_drvdata(adev);
-
-       coresight_unregister(drvdata->csdev);
-       if (--etm_count == 0)
-               unregister_hotcpu_notifier(&etm_cpu_notifier);
-
-       return 0;
-}
-
 #ifdef CONFIG_PM
 static int etm_runtime_suspend(struct device *dev)
 {
@@ -1948,9 +1942,9 @@ static struct amba_driver etm_driver = {
                .name   = "coresight-etm3x",
                .owner  = THIS_MODULE,
                .pm     = &etm_dev_pm_ops,
+               .suppress_bind_attrs = true,
        },
        .probe          = etm_probe,
-       .remove         = etm_remove,
        .id_table       = etm_ids,
 };