提交 d6f78a8f 编写于 作者: J Jeremy Linton 提交者: Xie XiuQi

perf: arm_spe: Enable ACPI/Platform automatic module loading

mainline inclusion
from mainline-5.3-rc1
commit d482e575fbf0
category: feature
bugzilla: 16072
CVE: NA
---------------------------

Lets add the MODULE_TABLE and platform id_table entries so that
the SPE driver can attach to the ACPI platform device created by
the core pmu code.
Tested-by: NHanjun Gou <gouhanjun@huawei.com>
Reviewed-by: NSudeep Holla <sudeep.holla@arm.com>
Signed-off-by: NJeremy Linton <jeremy.linton@arm.com>
Signed-off-by: NHongbo Yao <yaohongbo@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 09436382
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/perf_event.h> #include <linux/perf_event.h>
#include <linux/perf/arm_pmu.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/printk.h> #include <linux/printk.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -1176,7 +1177,13 @@ static const struct of_device_id arm_spe_pmu_of_match[] = { ...@@ -1176,7 +1177,13 @@ static const struct of_device_id arm_spe_pmu_of_match[] = {
}; };
MODULE_DEVICE_TABLE(of, arm_spe_pmu_of_match); MODULE_DEVICE_TABLE(of, arm_spe_pmu_of_match);
static int arm_spe_pmu_device_dt_probe(struct platform_device *pdev) static const struct platform_device_id arm_spe_match[] = {
{ ARMV8_SPE_PDEV_NAME, 0},
{ }
};
MODULE_DEVICE_TABLE(platform, arm_spe_match);
static int arm_spe_pmu_device_probe(struct platform_device *pdev)
{ {
int ret; int ret;
struct arm_spe_pmu *spe_pmu; struct arm_spe_pmu *spe_pmu;
...@@ -1236,11 +1243,12 @@ static int arm_spe_pmu_device_remove(struct platform_device *pdev) ...@@ -1236,11 +1243,12 @@ static int arm_spe_pmu_device_remove(struct platform_device *pdev)
} }
static struct platform_driver arm_spe_pmu_driver = { static struct platform_driver arm_spe_pmu_driver = {
.id_table = arm_spe_match,
.driver = { .driver = {
.name = DRVNAME, .name = DRVNAME,
.of_match_table = of_match_ptr(arm_spe_pmu_of_match), .of_match_table = of_match_ptr(arm_spe_pmu_of_match),
}, },
.probe = arm_spe_pmu_device_dt_probe, .probe = arm_spe_pmu_device_probe,
.remove = arm_spe_pmu_device_remove, .remove = arm_spe_pmu_device_remove,
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册