blob: 4b94fe3427f902ad4d72c02becb1046b67b13212 [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 Kumar7ead83f2016-04-22 16:58:41 +053015 { .compatible = "fsl,imx27", },
16 { .compatible = "fsl,imx51", },
17 { .compatible = "fsl,imx53", },
18 { .compatible = "fsl,imx7d", },
19
Viresh Kumara59511d2016-04-22 16:58:40 +053020 { .compatible = "marvell,berlin", },
21
Viresh Kumar2249c002016-03-30 13:45:28 +053022 { .compatible = "samsung,exynos3250", },
23 { .compatible = "samsung,exynos4210", },
24 { .compatible = "samsung,exynos4212", },
25 { .compatible = "samsung,exynos4412", },
26 { .compatible = "samsung,exynos5250", },
27#ifndef CONFIG_BL_SWITCHER
28 { .compatible = "samsung,exynos5420", },
29 { .compatible = "samsung,exynos5800", },
30#endif
Viresh Kumar7694ca62016-04-22 16:58:42 +053031
Viresh Kumara399dc92016-04-22 16:58:44 +053032 { .compatible = "renesas,emev2", },
33 { .compatible = "renesas,r7s72100", },
34 { .compatible = "renesas,r8a73a4", },
35 { .compatible = "renesas,r8a7740", },
36 { .compatible = "renesas,r8a7778", },
37 { .compatible = "renesas,r8a7779", },
38 { .compatible = "renesas,r8a7790", },
39 { .compatible = "renesas,r8a7791", },
40 { .compatible = "renesas,r8a7793", },
41 { .compatible = "renesas,r8a7794", },
42 { .compatible = "renesas,sh73a0", },
43
Finley Xiao014400c2016-04-22 16:58:43 +053044 { .compatible = "rockchip,rk2928", },
45 { .compatible = "rockchip,rk3036", },
46 { .compatible = "rockchip,rk3066a", },
47 { .compatible = "rockchip,rk3066b", },
48 { .compatible = "rockchip,rk3188", },
49 { .compatible = "rockchip,rk3228", },
50 { .compatible = "rockchip,rk3288", },
51 { .compatible = "rockchip,rk3366", },
52 { .compatible = "rockchip,rk3368", },
53 { .compatible = "rockchip,rk3399", },
54
Viresh Kumar7694ca62016-04-22 16:58:42 +053055 { .compatible = "ti,omap2", },
56 { .compatible = "ti,omap3", },
57 { .compatible = "ti,omap4", },
58 { .compatible = "ti,omap5", },
Viresh Kumarf56aad12016-03-30 13:45:26 +053059};
60
61static int __init cpufreq_dt_platdev_init(void)
62{
63 struct device_node *np = of_find_node_by_path("/");
64
65 if (!np)
66 return -ENODEV;
67
68 if (!of_match_node(machines, np))
69 return -ENODEV;
70
71 of_node_put(of_root);
72
73 return PTR_ERR_OR_ZERO(platform_device_register_simple("cpufreq-dt", -1,
74 NULL, 0));
75}
76device_initcall(cpufreq_dt_platdev_init);