blob: 71267626456ba7870c5e023c45b06482840c1dc8 [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 Kumar297a6622016-09-09 16:48:08 +053014#include "cpufreq-dt.h"
15
Viresh Kumare92bb162016-04-22 16:58:39 +053016static const struct of_device_id machines[] __initconst = {
Viresh Kumar117d4f52016-04-22 16:58:45 +053017 { .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
Viresh Kumar3920be42016-04-22 16:58:47 +053029 { .compatible = "hisilicon,hi6220", },
30
Viresh Kumar7ead83f2016-04-22 16:58:41 +053031 { .compatible = "fsl,imx27", },
32 { .compatible = "fsl,imx51", },
33 { .compatible = "fsl,imx53", },
34 { .compatible = "fsl,imx7d", },
35
Viresh Kumara59511d2016-04-22 16:58:40 +053036 { .compatible = "marvell,berlin", },
37
Viresh Kumar2249c002016-03-30 13:45:28 +053038 { .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", },
Chanwoo Choic4b40572016-08-16 15:27:19 +090045 { .compatible = "samsung,exynos5433", },
Viresh Kumar2249c002016-03-30 13:45:28 +053046 { .compatible = "samsung,exynos5800", },
47#endif
Viresh Kumar7694ca62016-04-22 16:58:42 +053048
Viresh Kumara399dc92016-04-22 16:58:44 +053049 { .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", },
Geert Uytterhoevenffdf8b82016-09-06 14:18:20 +020057 { .compatible = "renesas,r8a7792", },
Viresh Kumara399dc92016-04-22 16:58:44 +053058 { .compatible = "renesas,r8a7793", },
59 { .compatible = "renesas,r8a7794", },
60 { .compatible = "renesas,sh73a0", },
61
Finley Xiao014400c2016-04-22 16:58:43 +053062 { .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
Marc Gonzalezd9c99acb2016-05-02 15:39:25 +020073 { .compatible = "sigma,tango4" },
74
Dave Gerlache01072d2016-09-14 15:41:37 -050075 { .compatible = "ti,am33xx", },
76 { .compatible = "ti,dra7", },
Viresh Kumar7694ca62016-04-22 16:58:42 +053077 { .compatible = "ti,omap2", },
78 { .compatible = "ti,omap3", },
79 { .compatible = "ti,omap4", },
80 { .compatible = "ti,omap5", },
Viresh Kumar5e4249c2016-04-22 16:58:46 +053081
82 { .compatible = "xlnx,zynq-7000", },
Wei Yongjunbd37e022016-08-21 15:41:44 +000083
84 { }
Viresh Kumarf56aad12016-03-30 13:45:26 +053085};
86
87static int __init cpufreq_dt_platdev_init(void)
88{
89 struct device_node *np = of_find_node_by_path("/");
Masahiro Yamadaca5eda52016-06-27 14:50:13 +090090 const struct of_device_id *match;
Viresh Kumarf56aad12016-03-30 13:45:26 +053091
92 if (!np)
93 return -ENODEV;
94
Masahiro Yamadaca5eda52016-06-27 14:50:13 +090095 match = of_match_node(machines, np);
96 of_node_put(np);
97 if (!match)
Viresh Kumarf56aad12016-03-30 13:45:26 +053098 return -ENODEV;
99
Viresh Kumar297a6622016-09-09 16:48:08 +0530100 return PTR_ERR_OR_ZERO(platform_device_register_data(NULL, "cpufreq-dt",
101 -1, match->data,
102 sizeof(struct cpufreq_dt_platform_data)));
Viresh Kumarf56aad12016-03-30 13:45:26 +0530103}
104device_initcall(cpufreq_dt_platdev_init);