Skip to content

Commit 3f7be43

Browse files
jpbruckerwilldeacon
authored andcommitted
perf/smmuv3: Add devicetree support
Add device-tree support to the SMMUv3 PMCG driver. Signed-off-by: Jay Chen <[email protected]> Signed-off-by: Jean-Philippe Brucker <[email protected]> Signed-off-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 2704e75 commit 3f7be43

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/perf/arm_smmuv3_pmu.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include <linux/kernel.h>
4848
#include <linux/list.h>
4949
#include <linux/msi.h>
50+
#include <linux/of.h>
5051
#include <linux/perf_event.h>
5152
#include <linux/platform_device.h>
5253
#include <linux/smp.h>
@@ -834,7 +835,8 @@ static int smmu_pmu_probe(struct platform_device *pdev)
834835
return -EINVAL;
835836
}
836837

837-
smmu_pmu_get_acpi_options(smmu_pmu);
838+
if (!dev->of_node)
839+
smmu_pmu_get_acpi_options(smmu_pmu);
838840

839841
/* Pick one CPU to be the preferred one to use */
840842
smmu_pmu->on_cpu = raw_smp_processor_id();
@@ -884,9 +886,16 @@ static void smmu_pmu_shutdown(struct platform_device *pdev)
884886
smmu_pmu_disable(&smmu_pmu->pmu);
885887
}
886888

889+
static const struct of_device_id smmu_pmu_of_match[] = {
890+
{ .compatible = "arm,smmu-v3-pmcg" },
891+
{}
892+
};
893+
MODULE_DEVICE_TABLE(of, smmu_pmu_of_match);
894+
887895
static struct platform_driver smmu_pmu_driver = {
888896
.driver = {
889897
.name = "arm-smmu-v3-pmcg",
898+
.of_match_table = of_match_ptr(smmu_pmu_of_match),
890899
.suppress_bind_attrs = true,
891900
},
892901
.probe = smmu_pmu_probe,

0 commit comments

Comments
 (0)