diff options
author | Olof Johansson <olof@lixom.net> | 2014-07-06 20:08:18 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2014-07-06 20:09:16 -0400 |
commit | 5bf521b813776e983bfc1ef21898391e51773c1d (patch) | |
tree | 21187799ba069d4e7072f636d11c76de9d2870db /arch/arm/mach-shmobile | |
parent | 9e205f02c286ffbdc84151e06e43db1cb28fb510 (diff) | |
parent | 06e32c91dbce3c24ccbe84e3af2a35199662bca0 (diff) |
Merge tag 'renesas-cpufreq-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/soc
Merge "Renesas ARM Based SoC Cpufreq Updates for v3.17" from Simon Horman
* Add cpufreq-cpu0 device registration
* tag 'renesas-cpufreq-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
ARM: shmobile: add cpufreq-cpu0 driver for common SH-Mobile
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r-- | arch/arm/mach-shmobile/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/cpufreq.c | 31 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/common.h | 7 |
3 files changed, 39 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 38d5fe825e93..1b966da2c81c 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile | |||
@@ -48,6 +48,7 @@ obj-$(CONFIG_ARCH_SH7372) += entry-intc.o | |||
48 | # PM objects | 48 | # PM objects |
49 | obj-$(CONFIG_SUSPEND) += suspend.o | 49 | obj-$(CONFIG_SUSPEND) += suspend.o |
50 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o | 50 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o |
51 | obj-$(CONFIG_CPU_FREQ) += cpufreq.o | ||
51 | obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o pm-rmobile.o | 52 | obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o pm-rmobile.o |
52 | obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o | 53 | obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o |
53 | obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o | 54 | obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o |
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 @@ | |||
1 | /* | ||
2 | * CPUFreq support code for SH-Mobile ARM | ||
3 | * | ||
4 | * Copyright (C) 2014 Gaku Inami | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | |||
11 | #include <linux/of.h> | ||
12 | #include <linux/of_device.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | |||
15 | int __init shmobile_cpufreq_init(void) | ||
16 | { | ||
17 | struct device_node *np; | ||
18 | |||
19 | np = of_cpu_device_node_get(0); | ||
20 | if (np == NULL) { | ||
21 | pr_err("failed to find cpu0 node\n"); | ||
22 | return 0; | ||
23 | } | ||
24 | |||
25 | if (of_get_property(np, "operating-points", NULL)) | ||
26 | platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0); | ||
27 | |||
28 | of_node_put(np); | ||
29 | |||
30 | return 0; | ||
31 | } | ||
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h index f7a360edcc35..921a18ef4dfe 100644 --- a/arch/arm/mach-shmobile/include/mach/common.h +++ b/arch/arm/mach-shmobile/include/mach/common.h | |||
@@ -45,12 +45,19 @@ int shmobile_cpuidle_init(void); | |||
45 | static inline int shmobile_cpuidle_init(void) { return 0; } | 45 | static inline int shmobile_cpuidle_init(void) { return 0; } |
46 | #endif | 46 | #endif |
47 | 47 | ||
48 | #ifdef CONFIG_CPU_FREQ | ||
49 | int shmobile_cpufreq_init(void); | ||
50 | #else | ||
51 | static inline int shmobile_cpufreq_init(void) { return 0; } | ||
52 | #endif | ||
53 | |||
48 | extern void __iomem *shmobile_scu_base; | 54 | extern void __iomem *shmobile_scu_base; |
49 | 55 | ||
50 | static inline void __init shmobile_init_late(void) | 56 | static inline void __init shmobile_init_late(void) |
51 | { | 57 | { |
52 | shmobile_suspend_init(); | 58 | shmobile_suspend_init(); |
53 | shmobile_cpuidle_init(); | 59 | shmobile_cpuidle_init(); |
60 | shmobile_cpufreq_init(); | ||
54 | } | 61 | } |
55 | 62 | ||
56 | #endif /* __ARCH_MACH_COMMON_H */ | 63 | #endif /* __ARCH_MACH_COMMON_H */ |