1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright 2021 Linaro Limited
7 * DTPM hierarchy description
9 #include <linux/dtpm.h>
10 #include <linux/module.h>
12 #include <linux/platform_device.h>
14 static struct dtpm_node __initdata rk3399_hierarchy[] = {
15 [0] = { .name = "rk3399",
16 .type = DTPM_NODE_VIRTUAL },
17 [1] = { .name = "package",
18 .type = DTPM_NODE_VIRTUAL,
19 .parent = &rk3399_hierarchy[0] },
20 [2] = { .name = "/cpus/cpu@0",
22 .parent = &rk3399_hierarchy[1] },
23 [3] = { .name = "/cpus/cpu@1",
25 .parent = &rk3399_hierarchy[1] },
26 [4] = { .name = "/cpus/cpu@2",
28 .parent = &rk3399_hierarchy[1] },
29 [5] = { .name = "/cpus/cpu@3",
31 .parent = &rk3399_hierarchy[1] },
32 [6] = { .name = "/cpus/cpu@100",
34 .parent = &rk3399_hierarchy[1] },
35 [7] = { .name = "/cpus/cpu@101",
37 .parent = &rk3399_hierarchy[1] },
38 [8] = { .name = "/gpu@ff9a0000",
40 .parent = &rk3399_hierarchy[1] },
41 [9] = { /* sentinel */ }
44 static struct of_device_id __initdata rockchip_dtpm_match_table[] = {
45 { .compatible = "rockchip,rk3399", .data = rk3399_hierarchy },
49 static int __init rockchip_dtpm_init(void)
51 return dtpm_create_hierarchy(rockchip_dtpm_match_table);
53 module_init(rockchip_dtpm_init);
55 static void __exit rockchip_dtpm_exit(void)
57 return dtpm_destroy_hierarchy();
59 module_exit(rockchip_dtpm_exit);
61 MODULE_SOFTDEP("pre: panfrost cpufreq-dt");
62 MODULE_DESCRIPTION("Rockchip DTPM driver");
63 MODULE_LICENSE("GPL");
64 MODULE_ALIAS("platform:dtpm");