diff options
author | Gaku Inami <gaku.inami.xw@bp.renesas.com> | 2014-06-03 16:02:45 +0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2014-06-16 14:50:54 +0400 |
commit | 06e32c91dbce3c24ccbe84e3af2a35199662bca0 (patch) | |
tree | 839fea4adc5298aafaab8ddac50bcc6b9d356cff /arch/arm/mach-shmobile/cpufreq.c | |
parent | 7171511eaec5bf23fb06078f59784a3a0626b38f (diff) | |
download | linux-06e32c91dbce3c24ccbe84e3af2a35199662bca0.tar.xz |
ARM: shmobile: add cpufreq-cpu0 driver for common SH-Mobile
I add a new file(cpufreq.c) for the following reasons.
- Registration of platform_device must be unified in SH-Mobile.
- We can't create a node of cpufreq drivers into device tree.
(Because cpufreq driver is virtual device.)
Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile/cpufreq.c')
-rw-r--r-- | arch/arm/mach-shmobile/cpufreq.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/cpufreq.c b/arch/arm/mach-shmobile/cpufreq.c new file mode 100644 index 000000000000..e2c868fc41cf --- /dev/null +++ b/arch/arm/mach-shmobile/cpufreq.c @@ -0,0 +1,31 @@ +/* + * CPUFreq support code for SH-Mobile ARM + * + * Copyright (C) 2014 Gaku Inami + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ + +#include <linux/of.h> +#include <linux/of_device.h> +#include <linux/platform_device.h> + +int __init shmobile_cpufreq_init(void) +{ + struct device_node *np; + + np = of_cpu_device_node_get(0); + if (np == NULL) { + pr_err("failed to find cpu0 node\n"); + return 0; + } + + if (of_get_property(np, "operating-points", NULL)) + platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0); + + of_node_put(np); + + return 0; +} |