]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - drivers/cpufreq/cpufreq-dt-platdev.c
Merge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux...
[mirror_ubuntu-zesty-kernel.git] / drivers / cpufreq / cpufreq-dt-platdev.c
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
14 #include "cpufreq-dt.h"
15
16 static const struct of_device_id machines[] __initconst = {
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
29 { .compatible = "apm,xgene-shadowcat", },
30
31 { .compatible = "arm,integrator-ap", },
32 { .compatible = "arm,integrator-cp", },
33
34 { .compatible = "hisilicon,hi6220", },
35
36 { .compatible = "fsl,imx27", },
37 { .compatible = "fsl,imx51", },
38 { .compatible = "fsl,imx53", },
39 { .compatible = "fsl,imx7d", },
40
41 { .compatible = "marvell,berlin", },
42 { .compatible = "marvell,pxa250", },
43 { .compatible = "marvell,pxa270", },
44
45 { .compatible = "samsung,exynos3250", },
46 { .compatible = "samsung,exynos4210", },
47 { .compatible = "samsung,exynos4212", },
48 { .compatible = "samsung,exynos4412", },
49 { .compatible = "samsung,exynos5250", },
50 #ifndef CONFIG_BL_SWITCHER
51 { .compatible = "samsung,exynos5420", },
52 { .compatible = "samsung,exynos5433", },
53 { .compatible = "samsung,exynos5800", },
54 #endif
55
56 { .compatible = "renesas,emev2", },
57 { .compatible = "renesas,r7s72100", },
58 { .compatible = "renesas,r8a73a4", },
59 { .compatible = "renesas,r8a7740", },
60 { .compatible = "renesas,r8a7743", },
61 { .compatible = "renesas,r8a7745", },
62 { .compatible = "renesas,r8a7778", },
63 { .compatible = "renesas,r8a7779", },
64 { .compatible = "renesas,r8a7790", },
65 { .compatible = "renesas,r8a7791", },
66 { .compatible = "renesas,r8a7792", },
67 { .compatible = "renesas,r8a7793", },
68 { .compatible = "renesas,r8a7794", },
69 { .compatible = "renesas,sh73a0", },
70
71 { .compatible = "rockchip,rk2928", },
72 { .compatible = "rockchip,rk3036", },
73 { .compatible = "rockchip,rk3066a", },
74 { .compatible = "rockchip,rk3066b", },
75 { .compatible = "rockchip,rk3188", },
76 { .compatible = "rockchip,rk3228", },
77 { .compatible = "rockchip,rk3288", },
78 { .compatible = "rockchip,rk3366", },
79 { .compatible = "rockchip,rk3368", },
80 { .compatible = "rockchip,rk3399", },
81
82 { .compatible = "sigma,tango4" },
83
84 { .compatible = "socionext,uniphier-pro5", },
85 { .compatible = "socionext,uniphier-pxs2", },
86 { .compatible = "socionext,uniphier-ld6b", },
87 { .compatible = "socionext,uniphier-ld11", },
88 { .compatible = "socionext,uniphier-ld20", },
89
90 { .compatible = "ti,am33xx", },
91 { .compatible = "ti,dra7", },
92 { .compatible = "ti,omap2", },
93 { .compatible = "ti,omap3", },
94 { .compatible = "ti,omap4", },
95 { .compatible = "ti,omap5", },
96
97 { .compatible = "xlnx,zynq-7000", },
98
99 { .compatible = "zte,zx296718", },
100
101 { }
102 };
103
104 static int __init cpufreq_dt_platdev_init(void)
105 {
106 struct device_node *np = of_find_node_by_path("/");
107 const struct of_device_id *match;
108
109 if (!np)
110 return -ENODEV;
111
112 match = of_match_node(machines, np);
113 of_node_put(np);
114 if (!match)
115 return -ENODEV;
116
117 return PTR_ERR_OR_ZERO(platform_device_register_data(NULL, "cpufreq-dt",
118 -1, match->data,
119 sizeof(struct cpufreq_dt_platform_data)));
120 }
121 device_initcall(cpufreq_dt_platdev_init);