blob: 2ee40fd360caaa1ffd3a60700b1bc31a3a533322 [file] [log] [blame]
Viresh Kumarf56aad12016-03-30 13:45:26 +05301/*
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
Viresh Kumare92bb162016-04-22 16:58:39 +053014static const struct of_device_id machines[] __initconst = {
Viresh Kumar117d4f52016-04-22 16:58:45 +053015 { .compatible = "allwinner,sun4i-a10", },
16 { .compatible = "allwinner,sun5i-a10s", },
17 { .compatible = "allwinner,sun5i-a13", },
18 { .compatible = "allwinner,sun5i-r8", },
19 { .compatible = "allwinner,sun6i-a31", },
20 { .compatible = "allwinner,sun6i-a31s", },
21 { .compatible = "allwinner,sun7i-a20", },
22 { .compatible = "allwinner,sun8i-a23", },
23 { .compatible = "allwinner,sun8i-a33", },
24 { .compatible = "allwinner,sun8i-a83t", },
25 { .compatible = "allwinner,sun8i-h3", },
26
Viresh Kumar3920be42016-04-22 16:58:47 +053027 { .compatible = "hisilicon,hi6220", },
28
Viresh Kumar7ead83f2016-04-22 16:58:41 +053029 { .compatible = "fsl,imx27", },
30 { .compatible = "fsl,imx51", },
31 { .compatible = "fsl,imx53", },
32 { .compatible = "fsl,imx7d", },
33
Viresh Kumara59511d2016-04-22 16:58:40 +053034 { .compatible = "marvell,berlin", },
35
Viresh Kumar2249c002016-03-30 13:45:28 +053036 { .compatible = "samsung,exynos3250", },
37 { .compatible = "samsung,exynos4210", },
38 { .compatible = "samsung,exynos4212", },
39 { .compatible = "samsung,exynos4412", },
40 { .compatible = "samsung,exynos5250", },
41#ifndef CONFIG_BL_SWITCHER
42 { .compatible = "samsung,exynos5420", },
43 { .compatible = "samsung,exynos5800", },
44#endif
Viresh Kumar7694ca62016-04-22 16:58:42 +053045
Viresh Kumara399dc92016-04-22 16:58:44 +053046 { .compatible = "renesas,emev2", },
47 { .compatible = "renesas,r7s72100", },
48 { .compatible = "renesas,r8a73a4", },
49 { .compatible = "renesas,r8a7740", },
50 { .compatible = "renesas,r8a7778", },
51 { .compatible = "renesas,r8a7779", },
52 { .compatible = "renesas,r8a7790", },
53 { .compatible = "renesas,r8a7791", },
54 { .compatible = "renesas,r8a7793", },
55 { .compatible = "renesas,r8a7794", },
56 { .compatible = "renesas,sh73a0", },
57
Finley Xiao014400c2016-04-22 16:58:43 +053058 { .compatible = "rockchip,rk2928", },
59 { .compatible = "rockchip,rk3036", },
60 { .compatible = "rockchip,rk3066a", },
61 { .compatible = "rockchip,rk3066b", },
62 { .compatible = "rockchip,rk3188", },
63 { .compatible = "rockchip,rk3228", },
64 { .compatible = "rockchip,rk3288", },
65 { .compatible = "rockchip,rk3366", },
66 { .compatible = "rockchip,rk3368", },
67 { .compatible = "rockchip,rk3399", },
68
Marc Gonzalezd9c99ac2016-05-02 15:39:25 +020069 { .compatible = "sigma,tango4" },
70
Viresh Kumar7694ca62016-04-22 16:58:42 +053071 { .compatible = "ti,omap2", },
72 { .compatible = "ti,omap3", },
73 { .compatible = "ti,omap4", },
74 { .compatible = "ti,omap5", },
Viresh Kumar5e4249c2016-04-22 16:58:46 +053075
76 { .compatible = "xlnx,zynq-7000", },
Wei Yongjunbd37e022016-08-21 15:41:44 +000077
78 { }
Viresh Kumarf56aad12016-03-30 13:45:26 +053079};
80
81static int __init cpufreq_dt_platdev_init(void)
82{
83 struct device_node *np = of_find_node_by_path("/");
Masahiro Yamadaca5eda52016-06-27 14:50:13 +090084 const struct of_device_id *match;
Viresh Kumarf56aad12016-03-30 13:45:26 +053085
86 if (!np)
87 return -ENODEV;
88
Masahiro Yamadaca5eda52016-06-27 14:50:13 +090089 match = of_match_node(machines, np);
90 of_node_put(np);
91 if (!match)
Viresh Kumarf56aad12016-03-30 13:45:26 +053092 return -ENODEV;
93
Viresh Kumarf56aad12016-03-30 13:45:26 +053094 return PTR_ERR_OR_ZERO(platform_device_register_simple("cpufreq-dt", -1,
95 NULL, 0));
96}
97device_initcall(cpufreq_dt_platdev_init);