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 | 2249c00 | 2016-03-30 13:45:28 +0530 | [diff] [blame] | 15 | { .compatible = "samsung,exynos3250", }, |
| 16 | { .compatible = "samsung,exynos4210", }, |
| 17 | { .compatible = "samsung,exynos4212", }, |
| 18 | { .compatible = "samsung,exynos4412", }, |
| 19 | { .compatible = "samsung,exynos5250", }, |
| 20 | #ifndef CONFIG_BL_SWITCHER |
| 21 | { .compatible = "samsung,exynos5420", }, |
| 22 | { .compatible = "samsung,exynos5800", }, |
| 23 | #endif |
Viresh Kumar | f56aad1 | 2016-03-30 13:45:26 +0530 | [diff] [blame] | 24 | }; |
| 25 | |
| 26 | static int __init cpufreq_dt_platdev_init(void) |
| 27 | { |
| 28 | struct device_node *np = of_find_node_by_path("/"); |
| 29 | |
| 30 | if (!np) |
| 31 | return -ENODEV; |
| 32 | |
| 33 | if (!of_match_node(machines, np)) |
| 34 | return -ENODEV; |
| 35 | |
| 36 | of_node_put(of_root); |
| 37 | |
| 38 | return PTR_ERR_OR_ZERO(platform_device_register_simple("cpufreq-dt", -1, |
| 39 | NULL, 0)); |
| 40 | } |
| 41 | device_initcall(cpufreq_dt_platdev_init); |