]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blame - drivers/cpufreq/cpufreq-dt-platdev.c
cpufreq: imx: Use generic platdev driver
[mirror_ubuntu-zesty-kernel.git] / drivers / cpufreq / cpufreq-dt-platdev.c
CommitLineData
f56aad1d
VK
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
e92bb166 14static const struct of_device_id machines[] __initconst = {
7ead83f6
VK
15 { .compatible = "fsl,imx27", },
16 { .compatible = "fsl,imx51", },
17 { .compatible = "fsl,imx53", },
18 { .compatible = "fsl,imx7d", },
19
a59511d1
VK
20 { .compatible = "marvell,berlin", },
21
2249c00a
VK
22 { .compatible = "samsung,exynos3250", },
23 { .compatible = "samsung,exynos4210", },
24 { .compatible = "samsung,exynos4212", },
25 { .compatible = "samsung,exynos4412", },
26 { .compatible = "samsung,exynos5250", },
27#ifndef CONFIG_BL_SWITCHER
28 { .compatible = "samsung,exynos5420", },
29 { .compatible = "samsung,exynos5800", },
30#endif
f56aad1d
VK
31};
32
33static int __init cpufreq_dt_platdev_init(void)
34{
35 struct device_node *np = of_find_node_by_path("/");
36
37 if (!np)
38 return -ENODEV;
39
40 if (!of_match_node(machines, np))
41 return -ENODEV;
42
43 of_node_put(of_root);
44
45 return PTR_ERR_OR_ZERO(platform_device_register_simple("cpufreq-dt", -1,
46 NULL, 0));
47}
48device_initcall(cpufreq_dt_platdev_init);