Viresh Kumar | f56aad1 | 2016-03-30 13:45:26 +0530 | [diff] [blame] | 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 | |
Viresh Kumar | e92bb16 | 2016-04-22 16:58:39 +0530 | [diff] [blame] | 14 | static const struct of_device_id machines[] __initconst = { |
Viresh Kumar | 117d4f5 | 2016-04-22 16:58:45 +0530 | [diff] [blame] | 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 | |
Viresh Kumar | 3920be4 | 2016-04-22 16:58:47 +0530 | [diff] [blame] | 27 | { .compatible = "hisilicon,hi6220", }, |
| 28 | |
Viresh Kumar | 7ead83f | 2016-04-22 16:58:41 +0530 | [diff] [blame] | 29 | { .compatible = "fsl,imx27", }, |
| 30 | { .compatible = "fsl,imx51", }, |
| 31 | { .compatible = "fsl,imx53", }, |
| 32 | { .compatible = "fsl,imx7d", }, |
| 33 | |
Viresh Kumar | a59511d | 2016-04-22 16:58:40 +0530 | [diff] [blame] | 34 | { .compatible = "marvell,berlin", }, |
| 35 | |
Viresh Kumar | 2249c00 | 2016-03-30 13:45:28 +0530 | [diff] [blame] | 36 | { .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", }, |
Chanwoo Choi | c4b4057 | 2016-08-16 15:27:19 +0900 | [diff] [blame^] | 43 | { .compatible = "samsung,exynos5433", }, |
Viresh Kumar | 2249c00 | 2016-03-30 13:45:28 +0530 | [diff] [blame] | 44 | { .compatible = "samsung,exynos5800", }, |
| 45 | #endif |
Viresh Kumar | 7694ca6 | 2016-04-22 16:58:42 +0530 | [diff] [blame] | 46 | |
Viresh Kumar | a399dc9 | 2016-04-22 16:58:44 +0530 | [diff] [blame] | 47 | { .compatible = "renesas,emev2", }, |
| 48 | { .compatible = "renesas,r7s72100", }, |
| 49 | { .compatible = "renesas,r8a73a4", }, |
| 50 | { .compatible = "renesas,r8a7740", }, |
| 51 | { .compatible = "renesas,r8a7778", }, |
| 52 | { .compatible = "renesas,r8a7779", }, |
| 53 | { .compatible = "renesas,r8a7790", }, |
| 54 | { .compatible = "renesas,r8a7791", }, |
| 55 | { .compatible = "renesas,r8a7793", }, |
| 56 | { .compatible = "renesas,r8a7794", }, |
| 57 | { .compatible = "renesas,sh73a0", }, |
| 58 | |
Finley Xiao | 014400c | 2016-04-22 16:58:43 +0530 | [diff] [blame] | 59 | { .compatible = "rockchip,rk2928", }, |
| 60 | { .compatible = "rockchip,rk3036", }, |
| 61 | { .compatible = "rockchip,rk3066a", }, |
| 62 | { .compatible = "rockchip,rk3066b", }, |
| 63 | { .compatible = "rockchip,rk3188", }, |
| 64 | { .compatible = "rockchip,rk3228", }, |
| 65 | { .compatible = "rockchip,rk3288", }, |
| 66 | { .compatible = "rockchip,rk3366", }, |
| 67 | { .compatible = "rockchip,rk3368", }, |
| 68 | { .compatible = "rockchip,rk3399", }, |
| 69 | |
Marc Gonzalez | d9c99acb | 2016-05-02 15:39:25 +0200 | [diff] [blame] | 70 | { .compatible = "sigma,tango4" }, |
| 71 | |
Viresh Kumar | 7694ca6 | 2016-04-22 16:58:42 +0530 | [diff] [blame] | 72 | { .compatible = "ti,omap2", }, |
| 73 | { .compatible = "ti,omap3", }, |
| 74 | { .compatible = "ti,omap4", }, |
| 75 | { .compatible = "ti,omap5", }, |
Viresh Kumar | 5e4249c | 2016-04-22 16:58:46 +0530 | [diff] [blame] | 76 | |
| 77 | { .compatible = "xlnx,zynq-7000", }, |
Viresh Kumar | f56aad1 | 2016-03-30 13:45:26 +0530 | [diff] [blame] | 78 | }; |
| 79 | |
| 80 | static int __init cpufreq_dt_platdev_init(void) |
| 81 | { |
| 82 | struct device_node *np = of_find_node_by_path("/"); |
Masahiro Yamada | ca5eda5 | 2016-06-27 14:50:13 +0900 | [diff] [blame] | 83 | const struct of_device_id *match; |
Viresh Kumar | f56aad1 | 2016-03-30 13:45:26 +0530 | [diff] [blame] | 84 | |
| 85 | if (!np) |
| 86 | return -ENODEV; |
| 87 | |
Masahiro Yamada | ca5eda5 | 2016-06-27 14:50:13 +0900 | [diff] [blame] | 88 | match = of_match_node(machines, np); |
| 89 | of_node_put(np); |
| 90 | if (!match) |
Viresh Kumar | f56aad1 | 2016-03-30 13:45:26 +0530 | [diff] [blame] | 91 | return -ENODEV; |
| 92 | |
Viresh Kumar | f56aad1 | 2016-03-30 13:45:26 +0530 | [diff] [blame] | 93 | return PTR_ERR_OR_ZERO(platform_device_register_simple("cpufreq-dt", -1, |
| 94 | NULL, 0)); |
| 95 | } |
| 96 | device_initcall(cpufreq_dt_platdev_init); |