Skip to content

Commit f023f8d

Browse files
vireshkkgene
authored andcommitted
cpufreq: s3c24xx: move cpufreq driver to drivers/cpufreq
This patch moves cpufreq driver of Samsung's ARM based s3c24xx platform to drivers/cpufreq. Signed-off-by: Viresh Kumar <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Kukjin Kim <[email protected]>
1 parent f722406 commit f023f8d

File tree

14 files changed

+100
-103
lines changed

14 files changed

+100
-103
lines changed

arch/arm/Kconfig

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2053,53 +2053,6 @@ menu "CPU Power Management"
20532053

20542054
if ARCH_HAS_CPUFREQ
20552055
source "drivers/cpufreq/Kconfig"
2056-
2057-
config CPU_FREQ_S3C
2058-
bool
2059-
help
2060-
Internal configuration node for common cpufreq on Samsung SoC
2061-
2062-
config CPU_FREQ_S3C24XX
2063-
bool "CPUfreq driver for Samsung S3C24XX series CPUs (EXPERIMENTAL)"
2064-
depends on ARCH_S3C24XX && CPU_FREQ
2065-
select CPU_FREQ_S3C
2066-
help
2067-
This enables the CPUfreq driver for the Samsung S3C24XX family
2068-
of CPUs.
2069-
2070-
For details, take a look at <file:Documentation/cpu-freq>.
2071-
2072-
If in doubt, say N.
2073-
2074-
config CPU_FREQ_S3C24XX_PLL
2075-
bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)"
2076-
depends on CPU_FREQ_S3C24XX
2077-
help
2078-
Compile in support for changing the PLL frequency from the
2079-
S3C24XX series CPUfreq driver. The PLL takes time to settle
2080-
after a frequency change, so by default it is not enabled.
2081-
2082-
This also means that the PLL tables for the selected CPU(s) will
2083-
be built which may increase the size of the kernel image.
2084-
2085-
config CPU_FREQ_S3C24XX_DEBUG
2086-
bool "Debug CPUfreq Samsung driver core"
2087-
depends on CPU_FREQ_S3C24XX
2088-
help
2089-
Enable s3c_freq_dbg for the Samsung S3C CPUfreq core
2090-
2091-
config CPU_FREQ_S3C24XX_IODEBUG
2092-
bool "Debug CPUfreq Samsung driver IO timing"
2093-
depends on CPU_FREQ_S3C24XX
2094-
help
2095-
Enable s3c_freq_iodbg for the Samsung S3C CPUfreq core
2096-
2097-
config CPU_FREQ_S3C24XX_DEBUGFS
2098-
bool "Export debugfs for CPUFreq"
2099-
depends on CPU_FREQ_S3C24XX && DEBUG_FS
2100-
help
2101-
Export status information via debugfs.
2102-
21032056
endif
21042057

21052058
source "drivers/cpuidle/Kconfig"

arch/arm/mach-s3c24xx/Kconfig

Lines changed: 27 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ config CPU_S3C2410
2828
select CPU_ARM920T
2929
select CPU_LLSERIAL_S3C2410
3030
select S3C2410_CLOCK
31-
select S3C2410_CPUFREQ if CPU_FREQ_S3C24XX
31+
select ARM_S3C2410_CPUFREQ if ARM_S3C24XX_CPUFREQ
3232
select S3C2410_PM if PM
3333
select SAMSUNG_HRT
3434
help
@@ -204,27 +204,38 @@ config S3C24XX_GPIO_EXTRA128
204204
Add an extra 128 gpio numbers to the available GPIO pool. This is
205205
available for boards that need extra gpios for external devices.
206206

207+
config S3C24XX_PLL
208+
bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)"
209+
depends on ARM_S3C24XX
210+
help
211+
Compile in support for changing the PLL frequency from the
212+
S3C24XX series CPUfreq driver. The PLL takes time to settle
213+
after a frequency change, so by default it is not enabled.
214+
215+
This also means that the PLL tables for the selected CPU(s) will
216+
be built which may increase the size of the kernel image.
217+
207218
# cpu frequency items common between s3c2410 and s3c2440/s3c2442
208219

209220
config S3C2410_IOTIMING
210221
bool
211-
depends on CPU_FREQ_S3C24XX
222+
depends on ARM_S3C24XX_CPUFREQ
212223
help
213224
Internal node to select io timing code that is common to the s3c2410
214225
and s3c2440/s3c2442 cpu frequency support.
215226

216227
config S3C2410_CPUFREQ_UTILS
217-
bool
218-
depends on CPU_FREQ_S3C24XX
219-
help
220-
Internal node to select timing code that is common to the s3c2410
221-
and s3c2440/s3c244 cpu frequency support.
228+
bool
229+
depends on ARM_S3C24XX_CPUFREQ
230+
help
231+
Internal node to select timing code that is common to the s3c2410
232+
and s3c2440/s3c244 cpu frequency support.
222233

223234
# cpu frequency support common to s3c2412, s3c2413 and s3c2442
224235

225236
config S3C2412_IOTIMING
226237
bool
227-
depends on CPU_FREQ_S3C24XX && (CPU_S3C2412 || CPU_S3C2443)
238+
depends on ARM_S3C24XX_CPUFREQ && (CPU_S3C2412 || CPU_S3C2443)
228239
help
229240
Intel node to select io timing code that is common to the s3c2412
230241
and the s3c2443.
@@ -233,16 +244,9 @@ config S3C2412_IOTIMING
233244

234245
if CPU_S3C2410
235246

236-
config S3C2410_CPUFREQ
237-
bool
238-
depends on CPU_FREQ_S3C24XX
239-
select S3C2410_CPUFREQ_UTILS
240-
help
241-
CPU Frequency scaling support for S3C2410
242-
243247
config S3C2410_PLL
244248
bool
245-
depends on S3C2410_CPUFREQ && CPU_FREQ_S3C24XX_PLL
249+
depends on ARM_S3C2410_CPUFREQ && S3C24XX_PLL
246250
default y
247251
help
248252
Select the PLL table for the S3C2410
@@ -278,7 +282,7 @@ config ARCH_BAST
278282
bool "Simtec Electronics BAST (EB2410ITX)"
279283
select ISA
280284
select MACH_BAST_IDE
281-
select S3C2410_IOTIMING if S3C2410_CPUFREQ
285+
select S3C2410_IOTIMING if ARM_S3C2410_CPUFREQ
282286
select S3C24XX_DCLK
283287
select S3C24XX_SIMTEC_NOR
284288
select S3C24XX_SIMTEC_PM if PM
@@ -385,14 +389,6 @@ config CPU_S3C2412_ONLY
385389
!CPU_S3C2442 && !CPU_S3C2443
386390
default y
387391

388-
config S3C2412_CPUFREQ
389-
bool
390-
depends on CPU_FREQ_S3C24XX
391-
default y
392-
select S3C2412_IOTIMING
393-
help
394-
CPU Frequency scaling support for S3C2412 and S3C2413 SoC CPUs.
395-
396392
config S3C2412_DMA
397393
bool
398394
help
@@ -494,14 +490,6 @@ endif # CPU_S3C2416
494490

495491
if CPU_S3C2440
496492

497-
config S3C2440_CPUFREQ
498-
bool "S3C2440/S3C2442 CPU Frequency scaling support"
499-
depends on CPU_FREQ_S3C24XX && (CPU_S3C2440 || CPU_S3C2442)
500-
default y
501-
select S3C2410_CPUFREQ_UTILS
502-
help
503-
CPU Frequency scaling support for S3C2440 and S3C2442 SoC CPUs.
504-
505493
config S3C2440_DMA
506494
bool
507495
help
@@ -521,15 +509,15 @@ config S3C2440_XTAL_16934400
521509

522510
config S3C2440_PLL_12000000
523511
bool
524-
depends on S3C2440_CPUFREQ && S3C2440_XTAL_12000000
525-
default y if CPU_FREQ_S3C24XX_PLL
512+
depends on ARM_S3C2440_CPUFREQ && S3C2440_XTAL_12000000
513+
default y if S3C24XX_PLL
526514
help
527515
PLL tables for S3C2440 or S3C2442 CPUs with 12MHz crystals.
528516

529517
config S3C2440_PLL_16934400
530518
bool
531-
depends on S3C2440_CPUFREQ && S3C2440_XTAL_16934400
532-
default y if CPU_FREQ_S3C24XX_PLL
519+
depends on ARM_S3C2440_CPUFREQ && S3C2440_XTAL_16934400
520+
default y if S3C24XX_PLL
533521
help
534522
PLL tables for S3C2440 or S3C2442 CPUs with 16.934MHz crystals.
535523

@@ -583,7 +571,7 @@ config MACH_NEXCODER_2440
583571

584572
config MACH_OSIRIS
585573
bool "Simtec IM2440D20 (OSIRIS) module"
586-
select S3C2410_IOTIMING if S3C2440_CPUFREQ
574+
select S3C2410_IOTIMING if ARM_S3C2440_CPUFREQ
587575
select S3C2440_XTAL_12000000
588576
select S3C24XX_DCLK
589577
select S3C24XX_GPIO_EXTRA128
@@ -655,7 +643,7 @@ config MACH_RX1950
655643
bool "HP iPAQ rx1950"
656644
select I2C
657645
select PM_H1940 if PM
658-
select S3C2410_IOTIMING if S3C2440_CPUFREQ
646+
select S3C2410_IOTIMING if ARM_S3C2440_CPUFREQ
659647
select S3C2440_XTAL_16934400
660648
select S3C24XX_DCLK
661649
select S3C24XX_PWM

arch/arm/mach-s3c24xx/Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ obj- :=
1717
obj-y += common.o
1818

1919
obj-$(CONFIG_CPU_S3C2410) += s3c2410.o
20-
obj-$(CONFIG_S3C2410_CPUFREQ) += cpufreq-s3c2410.o
2120
obj-$(CONFIG_S3C2410_DMA) += dma-s3c2410.o
2221
obj-$(CONFIG_S3C2410_PLL) += pll-s3c2410.o
2322
obj-$(CONFIG_S3C2410_PM) += pm-s3c2410.o sleep-s3c2410.o
2423

2524
obj-$(CONFIG_CPU_S3C2412) += s3c2412.o clock-s3c2412.o
26-
obj-$(CONFIG_S3C2412_CPUFREQ) += cpufreq-s3c2412.o
2725
obj-$(CONFIG_S3C2412_DMA) += dma-s3c2412.o
2826
obj-$(CONFIG_S3C2412_PM) += pm-s3c2412.o
2927
obj-$(CONFIG_S3C2412_PM_SLEEP) += sleep-s3c2412.o
@@ -34,7 +32,6 @@ obj-$(CONFIG_S3C2416_PM) += pm-s3c2416.o
3432
obj-$(CONFIG_CPU_S3C2440) += s3c2440.o clock-s3c2440.o
3533
obj-$(CONFIG_CPU_S3C2442) += s3c2442.o
3634
obj-$(CONFIG_CPU_S3C244X) += s3c244x.o clock-s3c244x.o
37-
obj-$(CONFIG_S3C2440_CPUFREQ) += cpufreq-s3c2440.o
3835
obj-$(CONFIG_S3C2440_DMA) += dma-s3c2440.o
3936
obj-$(CONFIG_S3C2440_PLL_12000000) += pll-s3c2440-12000000.o
4037
obj-$(CONFIG_S3C2440_PLL_16934400) += pll-s3c2440-16934400.o
@@ -59,9 +56,6 @@ obj-$(CONFIG_S3C2412_IOTIMING) += iotiming-s3c2412.o
5956
obj-$(CONFIG_S3C2443_COMMON) += common-s3c2443.o
6057
obj-$(CONFIG_S3C2443_DMA) += dma-s3c2443.o
6158

62-
obj-$(CONFIG_CPU_FREQ_S3C24XX) += cpufreq.o
63-
obj-$(CONFIG_CPU_FREQ_S3C24XX_DEBUGFS) += cpufreq-debugfs.o
64-
6559
#
6660
# machine support
6761
# following is ordered alphabetically by option text.

arch/arm/mach-s3c24xx/iotiming-s3c2412.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include <plat/cpu-freq-core.h>
3232
#include <plat/clock.h>
3333

34-
#include "s3c2412.h"
34+
#include <mach/s3c2412.h>
3535

3636
#define print_ns(x) ((x) / 10), ((x) % 10)
3737

arch/arm/plat-samsung/include/plat/cpu-freq-core.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ extern int s3c_plltab_register(struct cpufreq_frequency_table *plls,
202202
extern struct s3c_cpufreq_config *s3c_cpufreq_getconfig(void);
203203
extern struct s3c_iotimings *s3c_cpufreq_getiotimings(void);
204204

205-
#ifdef CONFIG_CPU_FREQ_S3C24XX_DEBUGFS
205+
#ifdef CONFIG_ARM_S3C24XX_CPUFREQ_DEBUGFS
206206
#define s3c_cpufreq_debugfs_call(x) x
207207
#else
208208
#define s3c_cpufreq_debugfs_call(x) NULL
@@ -259,17 +259,17 @@ extern void s3c2412_iotiming_set(struct s3c_cpufreq_config *cfg,
259259
#define s3c2412_iotiming_set NULL
260260
#endif /* CONFIG_S3C2412_IOTIMING */
261261

262-
#ifdef CONFIG_CPU_FREQ_S3C24XX_DEBUG
262+
#ifdef CONFIG_ARM_S3C24XX_CPUFREQ_DEBUG
263263
#define s3c_freq_dbg(x...) printk(KERN_INFO x)
264264
#else
265265
#define s3c_freq_dbg(x...) do { if (0) printk(x); } while (0)
266-
#endif /* CONFIG_CPU_FREQ_S3C24XX_DEBUG */
266+
#endif /* CONFIG_ARM_S3C24XX_CPUFREQ_DEBUG */
267267

268-
#ifdef CONFIG_CPU_FREQ_S3C24XX_IODEBUG
268+
#ifdef CONFIG_ARM_S3C24XX_CPUFREQ_IODEBUG
269269
#define s3c_freq_iodbg(x...) printk(KERN_INFO x)
270270
#else
271271
#define s3c_freq_iodbg(x...) do { if (0) printk(x); } while (0)
272-
#endif /* CONFIG_CPU_FREQ_S3C24XX_IODEBUG */
272+
#endif /* CONFIG_ARM_S3C24XX_CPUFREQ_IODEBUG */
273273

274274
static inline int s3c_cpufreq_addfreq(struct cpufreq_frequency_table *table,
275275
int index, size_t table_size,

arch/arm/plat-samsung/include/plat/cpu-freq.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,20 +126,20 @@ struct s3c_cpufreq_board {
126126
};
127127

128128
/* Things depending on frequency scaling. */
129-
#ifdef CONFIG_CPU_FREQ_S3C
129+
#ifdef CONFIG_ARM_S3C_CPUFREQ
130130
#define __init_or_cpufreq
131131
#else
132132
#define __init_or_cpufreq __init
133133
#endif
134134

135135
/* Board functions */
136136

137-
#ifdef CONFIG_CPU_FREQ_S3C
137+
#ifdef CONFIG_ARM_S3C_CPUFREQ
138138
extern int s3c_cpufreq_setboard(struct s3c_cpufreq_board *board);
139139
#else
140140

141141
static inline int s3c_cpufreq_setboard(struct s3c_cpufreq_board *board)
142142
{
143143
return 0;
144144
}
145-
#endif /* CONFIG_CPU_FREQ_S3C */
145+
#endif /* CONFIG_ARM_S3C_CPUFREQ */

drivers/cpufreq/Kconfig.arm

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,56 @@ config ARM_OMAP2PLUS_CPUFREQ
9595
default ARCH_OMAP2PLUS
9696
select CPU_FREQ_TABLE
9797

98+
config ARM_S3C_CPUFREQ
99+
bool
100+
help
101+
Internal configuration node for common cpufreq on Samsung SoC
102+
103+
config ARM_S3C24XX_CPUFREQ
104+
bool "CPUfreq driver for Samsung S3C24XX series CPUs (EXPERIMENTAL)"
105+
depends on ARCH_S3C24XX
106+
select ARM_S3C_CPUFREQ
107+
help
108+
This enables the CPUfreq driver for the Samsung S3C24XX family
109+
of CPUs.
110+
111+
For details, take a look at <file:Documentation/cpu-freq>.
112+
113+
If in doubt, say N.
114+
115+
config ARM_S3C24XX_CPUFREQ_DEBUG
116+
bool "Debug CPUfreq Samsung driver core"
117+
depends on ARM_S3C24XX_CPUFREQ
118+
help
119+
Enable s3c_freq_dbg for the Samsung S3C CPUfreq core
120+
121+
config ARM_S3C24XX_CPUFREQ_IODEBUG
122+
bool "Debug CPUfreq Samsung driver IO timing"
123+
depends on ARM_S3C24XX_CPUFREQ
124+
help
125+
Enable s3c_freq_iodbg for the Samsung S3C CPUfreq core
126+
127+
config ARM_S3C24XX_CPUFREQ_DEBUGFS
128+
bool "Export debugfs for CPUFreq"
129+
depends on ARM_S3C24XX_CPUFREQ && DEBUG_FS
130+
help
131+
Export status information via debugfs.
132+
133+
config ARM_S3C2410_CPUFREQ
134+
bool
135+
depends on ARM_S3C24XX_CPUFREQ && CPU_S3C2410
136+
select S3C2410_CPUFREQ_UTILS
137+
help
138+
CPU Frequency scaling support for S3C2410
139+
140+
config ARM_S3C2412_CPUFREQ
141+
bool
142+
depends on ARM_S3C24XX_CPUFREQ && CPU_S3C2412
143+
default y
144+
select S3C2412_IOTIMING
145+
help
146+
CPU Frequency scaling support for S3C2412 and S3C2413 SoC CPUs.
147+
98148
config ARM_S3C2416_CPUFREQ
99149
bool "S3C2416 CPU Frequency scaling support"
100150
depends on CPU_S3C2416
@@ -117,6 +167,14 @@ config ARM_S3C2416_CPUFREQ_VCORESCALE
117167

118168
If in doubt, say N.
119169

170+
config ARM_S3C2440_CPUFREQ
171+
bool "S3C2440/S3C2442 CPU Frequency scaling support"
172+
depends on ARM_S3C24XX_CPUFREQ && (CPU_S3C2440 || CPU_S3C2442)
173+
select S3C2410_CPUFREQ_UTILS
174+
default y
175+
help
176+
CPU Frequency scaling support for S3C2440 and S3C2442 SoC CPUs.
177+
120178
config ARM_S3C64XX_CPUFREQ
121179
bool "Samsung S3C64XX"
122180
depends on CPU_S3C6410

drivers/cpufreq/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ obj-$(CONFIG_ARM_OMAP2PLUS_CPUFREQ) += omap-cpufreq.o
6565
obj-$(CONFIG_PXA25x) += pxa2xx-cpufreq.o
6666
obj-$(CONFIG_PXA27x) += pxa2xx-cpufreq.o
6767
obj-$(CONFIG_PXA3xx) += pxa3xx-cpufreq.o
68+
obj-$(CONFIG_ARM_S3C24XX_CPUFREQ) += s3c24xx-cpufreq.o
69+
obj-$(CONFIG_ARM_S3C24XX_CPUFREQ_DEBUGFS) += s3c24xx-cpufreq-debugfs.o
70+
obj-$(CONFIG_ARM_S3C2410_CPUFREQ) += s3c2410-cpufreq.o
71+
obj-$(CONFIG_ARM_S3C2412_CPUFREQ) += s3c2412-cpufreq.o
6872
obj-$(CONFIG_ARM_S3C2416_CPUFREQ) += s3c2416-cpufreq.o
73+
obj-$(CONFIG_ARM_S3C2440_CPUFREQ) += s3c2440-cpufreq.o
6974
obj-$(CONFIG_ARM_S3C64XX_CPUFREQ) += s3c64xx-cpufreq.o
7075
obj-$(CONFIG_ARM_S5PV210_CPUFREQ) += s5pv210-cpufreq.o
7176
obj-$(CONFIG_ARM_SA1100_CPUFREQ) += sa1100-cpufreq.o

arch/arm/mach-s3c24xx/cpufreq-s3c2412.c renamed to drivers/cpufreq/s3c2412-cpufreq.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@
2525
#include <asm/mach/map.h>
2626

2727
#include <mach/regs-clock.h>
28+
#include <mach/s3c2412.h>
2829

2930
#include <plat/cpu.h>
3031
#include <plat/clock.h>
3132
#include <plat/cpu-freq-core.h>
3233

33-
#include "s3c2412.h"
34-
3534
/* our clock resources. */
3635
static struct clk *xtal;
3736
static struct clk *fclk;
File renamed without changes.

0 commit comments

Comments
 (0)