]>
Commit | Line | Data |
---|---|---|
f56aad1d VK |
1 | /* |
2 | * Copyright (C) 2016 Linaro. | |
3 | * Viresh Kumar <viresh.kumar@linaro.org> | |
4 | * | |
5 | * This program is free software; you can redistribute it and/or modify | |
6 | * it under the terms of the GNU General Public License version 2 as | |
7 | * published by the Free Software Foundation. | |
8 | */ | |
9 | ||
10 | #include <linux/err.h> | |
11 | #include <linux/of.h> | |
12 | #include <linux/platform_device.h> | |
13 | ||
297a6622 VK |
14 | #include "cpufreq-dt.h" |
15 | ||
e92bb166 | 16 | static const struct of_device_id machines[] __initconst = { |
117d4f59 VK |
17 | { .compatible = "allwinner,sun4i-a10", }, |
18 | { .compatible = "allwinner,sun5i-a10s", }, | |
19 | { .compatible = "allwinner,sun5i-a13", }, | |
20 | { .compatible = "allwinner,sun5i-r8", }, | |
21 | { .compatible = "allwinner,sun6i-a31", }, | |
22 | { .compatible = "allwinner,sun6i-a31s", }, | |
23 | { .compatible = "allwinner,sun7i-a20", }, | |
24 | { .compatible = "allwinner,sun8i-a23", }, | |
25 | { .compatible = "allwinner,sun8i-a33", }, | |
26 | { .compatible = "allwinner,sun8i-a83t", }, | |
27 | { .compatible = "allwinner,sun8i-h3", }, | |
28 | ||
3920be47 VK |
29 | { .compatible = "hisilicon,hi6220", }, |
30 | ||
7ead83f6 VK |
31 | { .compatible = "fsl,imx27", }, |
32 | { .compatible = "fsl,imx51", }, | |
33 | { .compatible = "fsl,imx53", }, | |
34 | { .compatible = "fsl,imx7d", }, | |
35 | ||
a59511d1 VK |
36 | { .compatible = "marvell,berlin", }, |
37 | ||
2249c00a VK |
38 | { .compatible = "samsung,exynos3250", }, |
39 | { .compatible = "samsung,exynos4210", }, | |
40 | { .compatible = "samsung,exynos4212", }, | |
41 | { .compatible = "samsung,exynos4412", }, | |
42 | { .compatible = "samsung,exynos5250", }, | |
43 | #ifndef CONFIG_BL_SWITCHER | |
44 | { .compatible = "samsung,exynos5420", }, | |
c4b40572 | 45 | { .compatible = "samsung,exynos5433", }, |
2249c00a VK |
46 | { .compatible = "samsung,exynos5800", }, |
47 | #endif | |
7694ca6e | 48 | |
a399dc9f VK |
49 | { .compatible = "renesas,emev2", }, |
50 | { .compatible = "renesas,r7s72100", }, | |
51 | { .compatible = "renesas,r8a73a4", }, | |
52 | { .compatible = "renesas,r8a7740", }, | |
53 | { .compatible = "renesas,r8a7778", }, | |
54 | { .compatible = "renesas,r8a7779", }, | |
55 | { .compatible = "renesas,r8a7790", }, | |
56 | { .compatible = "renesas,r8a7791", }, | |
ffdf8b86 | 57 | { .compatible = "renesas,r8a7792", }, |
a399dc9f VK |
58 | { .compatible = "renesas,r8a7793", }, |
59 | { .compatible = "renesas,r8a7794", }, | |
60 | { .compatible = "renesas,sh73a0", }, | |
61 | ||
014400c1 FX |
62 | { .compatible = "rockchip,rk2928", }, |
63 | { .compatible = "rockchip,rk3036", }, | |
64 | { .compatible = "rockchip,rk3066a", }, | |
65 | { .compatible = "rockchip,rk3066b", }, | |
66 | { .compatible = "rockchip,rk3188", }, | |
67 | { .compatible = "rockchip,rk3228", }, | |
68 | { .compatible = "rockchip,rk3288", }, | |
69 | { .compatible = "rockchip,rk3366", }, | |
70 | { .compatible = "rockchip,rk3368", }, | |
71 | { .compatible = "rockchip,rk3399", }, | |
72 | ||
d9c99acb MG |
73 | { .compatible = "sigma,tango4" }, |
74 | ||
7694ca6e VK |
75 | { .compatible = "ti,omap2", }, |
76 | { .compatible = "ti,omap3", }, | |
77 | { .compatible = "ti,omap4", }, | |
78 | { .compatible = "ti,omap5", }, | |
5e4249c6 VK |
79 | |
80 | { .compatible = "xlnx,zynq-7000", }, | |
bd37e022 WY |
81 | |
82 | { } | |
f56aad1d VK |
83 | }; |
84 | ||
85 | static int __init cpufreq_dt_platdev_init(void) | |
86 | { | |
87 | struct device_node *np = of_find_node_by_path("/"); | |
ca5eda5d | 88 | const struct of_device_id *match; |
f56aad1d VK |
89 | |
90 | if (!np) | |
91 | return -ENODEV; | |
92 | ||
ca5eda5d MY |
93 | match = of_match_node(machines, np); |
94 | of_node_put(np); | |
95 | if (!match) | |
f56aad1d VK |
96 | return -ENODEV; |
97 | ||
297a6622 VK |
98 | return PTR_ERR_OR_ZERO(platform_device_register_data(NULL, "cpufreq-dt", |
99 | -1, match->data, | |
100 | sizeof(struct cpufreq_dt_platform_data))); | |
f56aad1d VK |
101 | } |
102 | device_initcall(cpufreq_dt_platdev_init); |