* [PATCH 4/7] ARM: shmobile: add cpufreq-cpu0 driver for common SH-Mobile
@ 2014-05-29 7:49 Gaku Inami
2014-05-30 10:05 ` Geert Uytterhoeven
0 siblings, 1 reply; 2+ messages in thread
From: Gaku Inami @ 2014-05-29 7:49 UTC (permalink / raw)
To: linux-sh
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.)
This time, this patch only supports r8a7790/r8a7791.
Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com>
---
arch/arm/mach-shmobile/Makefile | 1 +
arch/arm/mach-shmobile/cpufreq.c | 21 +++++++++++++++++++++
arch/arm/mach-shmobile/include/mach/common.h | 7 +++++++
3 files changed, 29 insertions(+)
create mode 100644 arch/arm/mach-shmobile/cpufreq.c
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 0d6a04c..d4fd9a9 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -48,6 +48,7 @@ obj-$(CONFIG_ARCH_SH7372) += entry-intc.o
# PM objects
obj-$(CONFIG_SUSPEND) += suspend.o
obj-$(CONFIG_CPU_IDLE) += cpuidle.o
+obj-$(CONFIG_CPU_FREQ) += cpufreq.o
obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o pm-rmobile.o
obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o
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 0000000..254a920
--- /dev/null
+++ b/arch/arm/mach-shmobile/cpufreq.c
@@ -0,0 +1,21 @@
+/*
+ * 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/platform_device.h>
+
+int __init shmobile_cpufreq_init(void)
+{
+ if (!(of_machine_is_compatible("renesas,r8a7790")) ||
+ !(of_machine_is_compatible("renesas,r8a7791")))
+ platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0);
+
+ return 0;
+}
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index f7a360e..921a18e 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);
static inline int shmobile_cpuidle_init(void) { return 0; }
#endif
+#ifdef CONFIG_CPU_FREQ
+int shmobile_cpufreq_init(void);
+#else
+static inline int shmobile_cpufreq_init(void) { return 0; }
+#endif
+
extern void __iomem *shmobile_scu_base;
static inline void __init shmobile_init_late(void)
{
shmobile_suspend_init();
shmobile_cpuidle_init();
+ shmobile_cpufreq_init();
}
#endif /* __ARCH_MACH_COMMON_H */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 4/7] ARM: shmobile: add cpufreq-cpu0 driver for common SH-Mobile
2014-05-29 7:49 [PATCH 4/7] ARM: shmobile: add cpufreq-cpu0 driver for common SH-Mobile Gaku Inami
@ 2014-05-30 10:05 ` Geert Uytterhoeven
0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2014-05-30 10:05 UTC (permalink / raw)
To: linux-sh
Hi Inami-san,
On Thu, May 29, 2014 at 9:49 AM, Gaku Inami
<gaku.inami.xw@bp.renesas.com> wrote:
> 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.)
Just wondering: what will the migration path be to board-less platform
support? I had a quick look how other platforms handle it, but didn't
become much wiser.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-05-30 10:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-29 7:49 [PATCH 4/7] ARM: shmobile: add cpufreq-cpu0 driver for common SH-Mobile Gaku Inami
2014-05-30 10:05 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).