Linux 4.19.133
[linux/fpc-iii.git] / drivers / bus / sun50i-de2.c
blob672518741f865921657fea8b568267380164a8ed
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Allwinner A64 Display Engine 2.0 Bus Driver
5 * Copyright (C) 2018 Icenowy Zheng <icenowy@aosc.io>
6 */
8 #include <linux/of_platform.h>
9 #include <linux/platform_device.h>
10 #include <linux/soc/sunxi/sunxi_sram.h>
12 static int sun50i_de2_bus_probe(struct platform_device *pdev)
14 struct device_node *np = pdev->dev.of_node;
15 int ret;
17 ret = sunxi_sram_claim(&pdev->dev);
18 if (ret) {
19 dev_err(&pdev->dev, "Error couldn't map SRAM to device\n");
20 return ret;
23 of_platform_populate(np, NULL, NULL, &pdev->dev);
25 return 0;
28 static int sun50i_de2_bus_remove(struct platform_device *pdev)
30 sunxi_sram_release(&pdev->dev);
31 return 0;
34 static const struct of_device_id sun50i_de2_bus_of_match[] = {
35 { .compatible = "allwinner,sun50i-a64-de2", },
36 { /* sentinel */ }
39 static struct platform_driver sun50i_de2_bus_driver = {
40 .probe = sun50i_de2_bus_probe,
41 .remove = sun50i_de2_bus_remove,
42 .driver = {
43 .name = "sun50i-de2-bus",
44 .of_match_table = sun50i_de2_bus_of_match,
48 builtin_platform_driver(sun50i_de2_bus_driver);