blob: 3e1c8211c213958c0c8032421b3ad6ea4f10e334 [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 Kumare92bb162016-04-22 16:58:39 +053014static const struct of_device_id machines[] __initconst = {
Viresh Kumara59511d2016-04-22 16:58:40 +053015 { .compatible = "marvell,berlin", },
16
Viresh Kumar2249c002016-03-30 13:45:28 +053017 { .compatible = "samsung,exynos3250", },
18 { .compatible = "samsung,exynos4210", },
19 { .compatible = "samsung,exynos4212", },
20 { .compatible = "samsung,exynos4412", },
21 { .compatible = "samsung,exynos5250", },
22#ifndef CONFIG_BL_SWITCHER
23 { .compatible = "samsung,exynos5420", },
24 { .compatible = "samsung,exynos5800", },
25#endif
Viresh Kumarf56aad12016-03-30 13:45:26 +053026};
27
28static int __init cpufreq_dt_platdev_init(void)
29{
30 struct device_node *np = of_find_node_by_path("/");
31
32 if (!np)
33 return -ENODEV;
34
35 if (!of_match_node(machines, np))
36 return -ENODEV;
37
38 of_node_put(of_root);
39
40 return PTR_ERR_OR_ZERO(platform_device_register_simple("cpufreq-dt", -1,
41 NULL, 0));
42}
43device_initcall(cpufreq_dt_platdev_init);