1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21#include <linux/fpga/altera-pr-ip-core.h>
22#include <linux/module.h>
23#include <linux/of_device.h>
24
25static int alt_pr_platform_probe(struct platform_device *pdev)
26{
27 struct device *dev = &pdev->dev;
28 void __iomem *reg_base;
29 struct resource *res;
30
31
32 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
33
34 reg_base = devm_ioremap_resource(dev, res);
35
36 if (IS_ERR(reg_base))
37 return PTR_ERR(reg_base);
38
39 return alt_pr_register(dev, reg_base);
40}
41
42static int alt_pr_platform_remove(struct platform_device *pdev)
43{
44 struct device *dev = &pdev->dev;
45
46 return alt_pr_unregister(dev);
47}
48
49static const struct of_device_id alt_pr_of_match[] = {
50 { .compatible = "altr,a10-pr-ip", },
51 {},
52};
53
54MODULE_DEVICE_TABLE(of, alt_pr_of_match);
55
56static struct platform_driver alt_pr_platform_driver = {
57 .probe = alt_pr_platform_probe,
58 .remove = alt_pr_platform_remove,
59 .driver = {
60 .name = "alt_a10_pr_ip",
61 .of_match_table = alt_pr_of_match,
62 },
63};
64
65module_platform_driver(alt_pr_platform_driver);
66MODULE_AUTHOR("Matthew Gerlach <matthew.gerlach@linux.intel.com>");
67MODULE_DESCRIPTION("Altera Partial Reconfiguration IP Platform Driver");
68MODULE_LICENSE("GPL v2");
69