cpufreq: sunxi: Use generic platdev driver
[deliverable/linux.git] / drivers / cpufreq / cpufreq-dt-platdev.c
CommitLineData
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
e92bb166 14static const struct of_device_id machines[] __initconst = {
117d4f59
VK
15 { .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
7ead83f6
VK
27 { .compatible = "fsl,imx27", },
28 { .compatible = "fsl,imx51", },
29 { .compatible = "fsl,imx53", },
30 { .compatible = "fsl,imx7d", },
31
a59511d1
VK
32 { .compatible = "marvell,berlin", },
33
2249c00a
VK
34 { .compatible = "samsung,exynos3250", },
35 { .compatible = "samsung,exynos4210", },
36 { .compatible = "samsung,exynos4212", },
37 { .compatible = "samsung,exynos4412", },
38 { .compatible = "samsung,exynos5250", },
39#ifndef CONFIG_BL_SWITCHER
40 { .compatible = "samsung,exynos5420", },
41 { .compatible = "samsung,exynos5800", },
42#endif
7694ca6e 43
a399dc9f
VK
44 { .compatible = "renesas,emev2", },
45 { .compatible = "renesas,r7s72100", },
46 { .compatible = "renesas,r8a73a4", },
47 { .compatible = "renesas,r8a7740", },
48 { .compatible = "renesas,r8a7778", },
49 { .compatible = "renesas,r8a7779", },
50 { .compatible = "renesas,r8a7790", },
51 { .compatible = "renesas,r8a7791", },
52 { .compatible = "renesas,r8a7793", },
53 { .compatible = "renesas,r8a7794", },
54 { .compatible = "renesas,sh73a0", },
55
014400c1
FX
56 { .compatible = "rockchip,rk2928", },
57 { .compatible = "rockchip,rk3036", },
58 { .compatible = "rockchip,rk3066a", },
59 { .compatible = "rockchip,rk3066b", },
60 { .compatible = "rockchip,rk3188", },
61 { .compatible = "rockchip,rk3228", },
62 { .compatible = "rockchip,rk3288", },
63 { .compatible = "rockchip,rk3366", },
64 { .compatible = "rockchip,rk3368", },
65 { .compatible = "rockchip,rk3399", },
66
7694ca6e
VK
67 { .compatible = "ti,omap2", },
68 { .compatible = "ti,omap3", },
69 { .compatible = "ti,omap4", },
70 { .compatible = "ti,omap5", },
f56aad1d
VK
71};
72
73static int __init cpufreq_dt_platdev_init(void)
74{
75 struct device_node *np = of_find_node_by_path("/");
76
77 if (!np)
78 return -ENODEV;
79
80 if (!of_match_node(machines, np))
81 return -ENODEV;
82
83 of_node_put(of_root);
84
85 return PTR_ERR_OR_ZERO(platform_device_register_simple("cpufreq-dt", -1,
86 NULL, 0));
87}
88device_initcall(cpufreq_dt_platdev_init);
This page took 0.027527 seconds and 5 git commands to generate.