File: altera-pr-ip-core-plat.c

package info (click to toggle)
linux 6.1.137-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,408 kB
  • sloc: ansic: 23,468,339; asm: 266,595; sh: 110,522; makefile: 49,887; python: 36,990; perl: 36,834; cpp: 6,056; yacc: 4,908; lex: 2,725; awk: 1,440; ruby: 25; sed: 5
file content (49 lines) | stat: -rw-r--r-- 1,287 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// SPDX-License-Identifier: GPL-2.0
/*
 * Driver for Altera Partial Reconfiguration IP Core
 *
 * Copyright (C) 2016-2017 Intel Corporation
 *
 * Based on socfpga-a10.c Copyright (C) 2015-2016 Altera Corporation
 *  by Alan Tull <atull@opensource.altera.com>
 */
#include <linux/fpga/altera-pr-ip-core.h>
#include <linux/module.h>
#include <linux/of_device.h>

static int alt_pr_platform_probe(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
	void __iomem *reg_base;
	struct resource *res;

	/* First mmio base is for register access */
	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

	reg_base = devm_ioremap_resource(dev, res);

	if (IS_ERR(reg_base))
		return PTR_ERR(reg_base);

	return alt_pr_register(dev, reg_base);
}

static const struct of_device_id alt_pr_of_match[] = {
	{ .compatible = "altr,a10-pr-ip", },
	{},
};

MODULE_DEVICE_TABLE(of, alt_pr_of_match);

static struct platform_driver alt_pr_platform_driver = {
	.probe = alt_pr_platform_probe,
	.driver = {
		.name	= "alt_a10_pr_ip",
		.of_match_table = alt_pr_of_match,
	},
};

module_platform_driver(alt_pr_platform_driver);
MODULE_AUTHOR("Matthew Gerlach <matthew.gerlach@linux.intel.com>");
MODULE_DESCRIPTION("Altera Partial Reconfiguration IP Platform Driver");
MODULE_LICENSE("GPL v2");