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 | 297a662 | 2016-09-09 16:48:08 +0530 | [diff] [blame] | 14 | #include "cpufreq-dt.h" |
| 15 | |
Viresh Kumar | e92bb16 | 2016-04-22 16:58:39 +0530 | [diff] [blame] | 16 | static const struct of_device_id machines[] __initconst = { |
Viresh Kumar | 117d4f5 | 2016-04-22 16:58:45 +0530 | [diff] [blame] | 17 | { .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 | |
Linus Walleij | 650ec6c | 2016-10-25 09:21:24 +0200 | [diff] [blame] | 29 | { .compatible = "arm,integrator-ap", }, |
| 30 | { .compatible = "arm,integrator-cp", }, |
| 31 | |
Viresh Kumar | 3920be4 | 2016-04-22 16:58:47 +0530 | [diff] [blame] | 32 | { .compatible = "hisilicon,hi6220", }, |
| 33 | |
Viresh Kumar | 7ead83f | 2016-04-22 16:58:41 +0530 | [diff] [blame] | 34 | { .compatible = "fsl,imx27", }, |
| 35 | { .compatible = "fsl,imx51", }, |
| 36 | { .compatible = "fsl,imx53", }, |
| 37 | { .compatible = "fsl,imx7d", }, |
| 38 | |
Viresh Kumar | a59511d | 2016-04-22 16:58:40 +0530 | [diff] [blame] | 39 | { .compatible = "marvell,berlin", }, |
Robert Jarzmik | dcd2ea4 | 2016-10-31 20:54:53 +0100 | [diff] [blame] | 40 | { .compatible = "marvell,pxa250", }, |
| 41 | { .compatible = "marvell,pxa270", }, |
Viresh Kumar | a59511d | 2016-04-22 16:58:40 +0530 | [diff] [blame] | 42 | |
Viresh Kumar | 2249c00 | 2016-03-30 13:45:28 +0530 | [diff] [blame] | 43 | { .compatible = "samsung,exynos3250", }, |
| 44 | { .compatible = "samsung,exynos4210", }, |
| 45 | { .compatible = "samsung,exynos4212", }, |
| 46 | { .compatible = "samsung,exynos4412", }, |
| 47 | { .compatible = "samsung,exynos5250", }, |
| 48 | #ifndef CONFIG_BL_SWITCHER |
| 49 | { .compatible = "samsung,exynos5420", }, |
Chanwoo Choi | c4b4057 | 2016-08-16 15:27:19 +0900 | [diff] [blame] | 50 | { .compatible = "samsung,exynos5433", }, |
Viresh Kumar | 2249c00 | 2016-03-30 13:45:28 +0530 | [diff] [blame] | 51 | { .compatible = "samsung,exynos5800", }, |
| 52 | #endif |
Viresh Kumar | 7694ca6 | 2016-04-22 16:58:42 +0530 | [diff] [blame] | 53 | |
Viresh Kumar | a399dc9 | 2016-04-22 16:58:44 +0530 | [diff] [blame] | 54 | { .compatible = "renesas,emev2", }, |
| 55 | { .compatible = "renesas,r7s72100", }, |
| 56 | { .compatible = "renesas,r8a73a4", }, |
| 57 | { .compatible = "renesas,r8a7740", }, |
Geert Uytterhoeven | f0da898 | 2016-11-16 11:05:51 +0100 | [diff] [blame] | 58 | { .compatible = "renesas,r8a7743", }, |
| 59 | { .compatible = "renesas,r8a7745", }, |
Viresh Kumar | a399dc9 | 2016-04-22 16:58:44 +0530 | [diff] [blame] | 60 | { .compatible = "renesas,r8a7778", }, |
| 61 | { .compatible = "renesas,r8a7779", }, |
| 62 | { .compatible = "renesas,r8a7790", }, |
| 63 | { .compatible = "renesas,r8a7791", }, |
Geert Uytterhoeven | ffdf8b8 | 2016-09-06 14:18:20 +0200 | [diff] [blame] | 64 | { .compatible = "renesas,r8a7792", }, |
Viresh Kumar | a399dc9 | 2016-04-22 16:58:44 +0530 | [diff] [blame] | 65 | { .compatible = "renesas,r8a7793", }, |
| 66 | { .compatible = "renesas,r8a7794", }, |
| 67 | { .compatible = "renesas,sh73a0", }, |
| 68 | |
Finley Xiao | 014400c | 2016-04-22 16:58:43 +0530 | [diff] [blame] | 69 | { .compatible = "rockchip,rk2928", }, |
| 70 | { .compatible = "rockchip,rk3036", }, |
| 71 | { .compatible = "rockchip,rk3066a", }, |
| 72 | { .compatible = "rockchip,rk3066b", }, |
| 73 | { .compatible = "rockchip,rk3188", }, |
| 74 | { .compatible = "rockchip,rk3228", }, |
| 75 | { .compatible = "rockchip,rk3288", }, |
| 76 | { .compatible = "rockchip,rk3366", }, |
| 77 | { .compatible = "rockchip,rk3368", }, |
| 78 | { .compatible = "rockchip,rk3399", }, |
| 79 | |
Marc Gonzalez | d9c99ac | 2016-05-02 15:39:25 +0200 | [diff] [blame] | 80 | { .compatible = "sigma,tango4" }, |
| 81 | |
Masahiro Yamada | 1758b33 | 2016-10-27 01:41:33 +0900 | [diff] [blame] | 82 | { .compatible = "socionext,uniphier-pro5", }, |
| 83 | { .compatible = "socionext,uniphier-pxs2", }, |
| 84 | { .compatible = "socionext,uniphier-ld6b", }, |
| 85 | { .compatible = "socionext,uniphier-ld11", }, |
| 86 | { .compatible = "socionext,uniphier-ld20", }, |
| 87 | |
Dave Gerlach | e01072d | 2016-09-14 15:41:37 -0500 | [diff] [blame] | 88 | { .compatible = "ti,am33xx", }, |
| 89 | { .compatible = "ti,dra7", }, |
Viresh Kumar | 7694ca6 | 2016-04-22 16:58:42 +0530 | [diff] [blame] | 90 | { .compatible = "ti,omap2", }, |
| 91 | { .compatible = "ti,omap3", }, |
| 92 | { .compatible = "ti,omap4", }, |
| 93 | { .compatible = "ti,omap5", }, |
Viresh Kumar | 5e4249c | 2016-04-22 16:58:46 +0530 | [diff] [blame] | 94 | |
| 95 | { .compatible = "xlnx,zynq-7000", }, |
Wei Yongjun | bd37e02 | 2016-08-21 15:41:44 +0000 | [diff] [blame] | 96 | |
Baoyou Xie | ab83805 | 2016-11-30 15:35:29 +0800 | [diff] [blame] | 97 | { .compatible = "zte,zx296718", }, |
| 98 | |
Wei Yongjun | bd37e02 | 2016-08-21 15:41:44 +0000 | [diff] [blame] | 99 | { } |
Viresh Kumar | f56aad1 | 2016-03-30 13:45:26 +0530 | [diff] [blame] | 100 | }; |
| 101 | |
| 102 | static int __init cpufreq_dt_platdev_init(void) |
| 103 | { |
| 104 | struct device_node *np = of_find_node_by_path("/"); |
Masahiro Yamada | ca5eda5 | 2016-06-27 14:50:13 +0900 | [diff] [blame] | 105 | const struct of_device_id *match; |
Viresh Kumar | f56aad1 | 2016-03-30 13:45:26 +0530 | [diff] [blame] | 106 | |
| 107 | if (!np) |
| 108 | return -ENODEV; |
| 109 | |
Masahiro Yamada | ca5eda5 | 2016-06-27 14:50:13 +0900 | [diff] [blame] | 110 | match = of_match_node(machines, np); |
| 111 | of_node_put(np); |
| 112 | if (!match) |
Viresh Kumar | f56aad1 | 2016-03-30 13:45:26 +0530 | [diff] [blame] | 113 | return -ENODEV; |
| 114 | |
Viresh Kumar | 297a662 | 2016-09-09 16:48:08 +0530 | [diff] [blame] | 115 | return PTR_ERR_OR_ZERO(platform_device_register_data(NULL, "cpufreq-dt", |
| 116 | -1, match->data, |
| 117 | sizeof(struct cpufreq_dt_platform_data))); |
Viresh Kumar | f56aad1 | 2016-03-30 13:45:26 +0530 | [diff] [blame] | 118 | } |
| 119 | device_initcall(cpufreq_dt_platdev_init); |