From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 08/11] ARM: STi: Register CPUFreq device
Date: Tue, 8 Dec 2015 14:32:01 +0000 [thread overview]
Message-ID: <1449585124-15596-9-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1449585124-15596-1-git-send-email-lee.jones@linaro.org>
DT will not allow pseudo-devices. Only devices which represent real
hardware are permitted. So we have to register the CPUFreq driver
from platform code instead.
Rather than create a new file, we're bundling this in with the SMP
functionality and renaming it from 'smp' to the more generic 'cpu'.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
arch/arm/mach-sti/Makefile | 2 +-
arch/arm/mach-sti/board-dt.c | 3 ++-
arch/arm/mach-sti/{platsmp.c => cpu.c} | 17 +++++++++++++++--
arch/arm/mach-sti/{smp.h => cpu.h} | 1 +
4 files changed, 19 insertions(+), 4 deletions(-)
rename arch/arm/mach-sti/{platsmp.c => cpu.c} (93%)
rename arch/arm/mach-sti/{smp.h => cpu.h} (93%)
diff --git a/arch/arm/mach-sti/Makefile b/arch/arm/mach-sti/Makefile
index acb3309..caaeeaa 100644
--- a/arch/arm/mach-sti/Makefile
+++ b/arch/arm/mach-sti/Makefile
@@ -1,2 +1,2 @@
-obj-$(CONFIG_SMP) += platsmp.o headsmp.o
+obj-$(CONFIG_SMP) += cpu.o headsmp.o
obj-$(CONFIG_ARCH_STI) += board-dt.o
diff --git a/arch/arm/mach-sti/board-dt.c b/arch/arm/mach-sti/board-dt.c
index ae10fb2..60b23a7 100644
--- a/arch/arm/mach-sti/board-dt.c
+++ b/arch/arm/mach-sti/board-dt.c
@@ -12,7 +12,7 @@
#include <asm/hardware/cache-l2x0.h>
#include <asm/mach/arch.h>
-#include "smp.h"
+#include "cpu.h"
static const char *const stih41x_dt_match[] __initconst = {
"st,stih415",
@@ -31,4 +31,5 @@ DT_MACHINE_START(STM, "STiH415/416 SoC with Flattened Device Tree")
L2C_AUX_CTRL_WAY_SIZE(4),
.l2c_aux_mask = 0xc0000fff,
.smp = smp_ops(sti_smp_ops),
+ .init_late = init_cpufreq,
MACHINE_END
diff --git a/arch/arm/mach-sti/platsmp.c b/arch/arm/mach-sti/cpu.c
similarity index 93%
rename from arch/arm/mach-sti/platsmp.c
rename to arch/arm/mach-sti/cpu.c
index c4ad6ea..335ecaf 100644
--- a/arch/arm/mach-sti/platsmp.c
+++ b/arch/arm/mach-sti/cpu.c
@@ -1,5 +1,5 @@
/*
- * arch/arm/mach-sti/platsmp.c
+ * arch/arm/mach-sti/cpu.c
*
* Copyright (C) 2013 STMicroelectronics (R&D) Limited.
* http://www.st.com
@@ -13,6 +13,7 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
+
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/delay.h>
@@ -21,13 +22,17 @@
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/memblock.h>
+#include <linux/platform_device.h>
#include <asm/cacheflush.h>
#include <asm/smp_plat.h>
#include <asm/smp_scu.h>
-#include "smp.h"
+#include "cpu.h"
+/**
+ * SMP Operations
+ */
static void write_pen_release(int val)
{
pen_release = val;
@@ -161,3 +166,11 @@ struct smp_operations __initdata sti_smp_ops = {
.smp_secondary_init = sti_secondary_init,
.smp_boot_secondary = sti_boot_secondary,
};
+
+/**
+ * CPUFreq Registration
+ */
+void init_cpufreq(void)
+{
+ platform_device_register_simple("sti-cpufreq", -1, NULL, 0);
+}
diff --git a/arch/arm/mach-sti/smp.h b/arch/arm/mach-sti/cpu.h
similarity index 93%
rename from arch/arm/mach-sti/smp.h
rename to arch/arm/mach-sti/cpu.h
index ae22707..957c4d1 100644
--- a/arch/arm/mach-sti/smp.h
+++ b/arch/arm/mach-sti/cpu.h
@@ -15,5 +15,6 @@
extern struct smp_operations sti_smp_ops;
void sti_secondary_startup(void);
+extern void init_cpufreq(void);
#endif
--
1.9.1
next prev parent reply other threads:[~2015-12-08 14:32 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-08 14:31 [PATCH v5 00/11] cpufreq: Introduce ST's CPUFreq driver Lee Jones
2015-12-08 14:31 ` [PATCH v5 01/11] ARM: multi_v7_defconfig: Enable ST's PWM driver Lee Jones
2015-12-08 14:31 ` [PATCH v5 02/11] ARM: multi_v7_defconfig: Enable ST's Power Reset driver Lee Jones
2015-12-08 14:31 ` [PATCH v5 03/11] ARM: multi_v7_defconfig: Enable support for PWM Regulators Lee Jones
2015-12-08 14:31 ` [PATCH v5 04/11] ARM: STi: STiH407: Provide generic (safe) DVFS configuration Lee Jones
2015-12-08 15:03 ` Viresh Kumar
2015-12-08 15:37 ` Lee Jones
2015-12-08 14:31 ` [PATCH v5 05/11] ARM: STi: STiH407: Provide CPU with clocking information Lee Jones
2015-12-08 14:31 ` [PATCH v5 06/11] ARM: STi: STiH407: Link CPU with its voltage supply Lee Jones
2015-12-08 14:32 ` [PATCH v5 07/11] ARM: STi: STiH407: Provide CPU with a means to look-up Major number Lee Jones
2015-12-08 14:32 ` Lee Jones [this message]
2015-12-09 2:39 ` [PATCH v5 08/11] ARM: STi: Register CPUFreq device Viresh Kumar
2015-12-09 9:15 ` Arnd Bergmann
2015-12-09 9:19 ` Viresh Kumar
2015-12-09 11:25 ` Lee Jones
2015-12-08 14:32 ` [PATCH v5 09/11] cpufreq: st: Provide runtime initialised driver for ST's platforms Lee Jones
2015-12-09 2:57 ` Viresh Kumar
2015-12-09 2:58 ` Viresh Kumar
2015-12-08 14:32 ` [PATCH v5 10/11] dt: cpufreq: st: Provide bindings for ST's CPUFreq implementation Lee Jones
2015-12-09 3:52 ` Rob Herring
2015-12-08 14:32 ` [PATCH v5 11/11] MAINTAINERS: Add ST's CPUFreq driver to the STI file list Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1449585124-15596-9-git-send-email-lee.jones@linaro.org \
--to=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).