Skip to content

Commit 6d803ba

Browse files
plagniojRussell King
authored andcommitted
ARM: 6483/1: arm & sh: factorised duplicated clkdev.c
factorise some generic infrastructure to assist looking up struct clks for the ARM & SH architecture. as the code is identical at 99% put the arch specific code for allocation as example in asm/clkdev.h Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Acked-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 64d2dc3 commit 6d803ba

72 files changed

Lines changed: 157 additions & 336 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/arm/Kconfig‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ config ARCH_INTEGRATOR
221221
bool "ARM Ltd. Integrator family"
222222
select ARM_AMBA
223223
select ARCH_HAS_CPUFREQ
224-
select COMMON_CLKDEV
224+
select CLKDEV_LOOKUP
225225
select ICST
226226
select GENERIC_CLOCKEVENTS
227227
select PLAT_VERSATILE
@@ -231,7 +231,7 @@ config ARCH_INTEGRATOR
231231
config ARCH_REALVIEW
232232
bool "ARM Ltd. RealView family"
233233
select ARM_AMBA
234-
select COMMON_CLKDEV
234+
select CLKDEV_LOOKUP
235235
select ICST
236236
select GENERIC_CLOCKEVENTS
237237
select ARCH_WANT_OPTIONAL_GPIOLIB
@@ -245,7 +245,7 @@ config ARCH_VERSATILE
245245
bool "ARM Ltd. Versatile family"
246246
select ARM_AMBA
247247
select ARM_VIC
248-
select COMMON_CLKDEV
248+
select CLKDEV_LOOKUP
249249
select ICST
250250
select GENERIC_CLOCKEVENTS
251251
select ARCH_WANT_OPTIONAL_GPIOLIB
@@ -259,7 +259,7 @@ config ARCH_VEXPRESS
259259
select ARCH_WANT_OPTIONAL_GPIOLIB
260260
select ARM_AMBA
261261
select ARM_TIMER_SP804
262-
select COMMON_CLKDEV
262+
select CLKDEV_LOOKUP
263263
select GENERIC_CLOCKEVENTS
264264
select HAVE_CLK
265265
select ICST
@@ -280,7 +280,7 @@ config ARCH_BCMRING
280280
depends on MMU
281281
select CPU_V6
282282
select ARM_AMBA
283-
select COMMON_CLKDEV
283+
select CLKDEV_LOOKUP
284284
select GENERIC_CLOCKEVENTS
285285
select ARCH_WANT_OPTIONAL_GPIOLIB
286286
help
@@ -327,7 +327,7 @@ config ARCH_EP93XX
327327
select CPU_ARM920T
328328
select ARM_AMBA
329329
select ARM_VIC
330-
select COMMON_CLKDEV
330+
select CLKDEV_LOOKUP
331331
select ARCH_REQUIRE_GPIOLIB
332332
select ARCH_HAS_HOLES_MEMORYMODEL
333333
select ARCH_USES_GETTIMEOFFSET
@@ -347,14 +347,14 @@ config ARCH_MXC
347347
bool "Freescale MXC/iMX-based"
348348
select GENERIC_CLOCKEVENTS
349349
select ARCH_REQUIRE_GPIOLIB
350-
select COMMON_CLKDEV
350+
select CLKDEV_LOOKUP
351351
help
352352
Support for Freescale MXC/iMX-based family of processors
353353

354354
config ARCH_STMP3XXX
355355
bool "Freescale STMP3xxx"
356356
select CPU_ARM926T
357-
select COMMON_CLKDEV
357+
select CLKDEV_LOOKUP
358358
select ARCH_REQUIRE_GPIOLIB
359359
select GENERIC_CLOCKEVENTS
360360
select USB_ARCH_HAS_EHCI
@@ -472,7 +472,7 @@ config ARCH_LPC32XX
472472
select HAVE_IDE
473473
select ARM_AMBA
474474
select USB_ARCH_HAS_OHCI
475-
select COMMON_CLKDEV
475+
select CLKDEV_LOOKUP
476476
select GENERIC_TIME
477477
select GENERIC_CLOCKEVENTS
478478
help
@@ -506,7 +506,7 @@ config ARCH_MMP
506506
bool "Marvell PXA168/910/MMP2"
507507
depends on MMU
508508
select ARCH_REQUIRE_GPIOLIB
509-
select COMMON_CLKDEV
509+
select CLKDEV_LOOKUP
510510
select GENERIC_CLOCKEVENTS
511511
select TICK_ONESHOT
512512
select PLAT_PXA
@@ -539,7 +539,7 @@ config ARCH_W90X900
539539
bool "Nuvoton W90X900 CPU"
540540
select CPU_ARM926T
541541
select ARCH_REQUIRE_GPIOLIB
542-
select COMMON_CLKDEV
542+
select CLKDEV_LOOKUP
543543
select GENERIC_CLOCKEVENTS
544544
help
545545
Support for Nuvoton (Winbond logic dept.) ARM9 processor,
@@ -553,7 +553,7 @@ config ARCH_W90X900
553553
config ARCH_NUC93X
554554
bool "Nuvoton NUC93X CPU"
555555
select CPU_ARM926T
556-
select COMMON_CLKDEV
556+
select CLKDEV_LOOKUP
557557
help
558558
Support for Nuvoton (Winbond logic dept.) NUC93X MCU,The NUC93X is a
559559
low-power and high performance MPEG-4/JPEG multimedia controller chip.
@@ -564,7 +564,7 @@ config ARCH_TEGRA
564564
select GENERIC_CLOCKEVENTS
565565
select GENERIC_GPIO
566566
select HAVE_CLK
567-
select COMMON_CLKDEV
567+
select CLKDEV_LOOKUP
568568
select ARCH_HAS_BARRIERS if CACHE_L2X0
569569
select ARCH_HAS_CPUFREQ
570570
help
@@ -574,7 +574,7 @@ config ARCH_TEGRA
574574
config ARCH_PNX4008
575575
bool "Philips Nexperia PNX4008 Mobile"
576576
select CPU_ARM926T
577-
select COMMON_CLKDEV
577+
select CLKDEV_LOOKUP
578578
select ARCH_USES_GETTIMEOFFSET
579579
help
580580
This enables support for Philips PNX4008 mobile platform.
@@ -584,7 +584,7 @@ config ARCH_PXA
584584
depends on MMU
585585
select ARCH_MTD_XIP
586586
select ARCH_HAS_CPUFREQ
587-
select COMMON_CLKDEV
587+
select CLKDEV_LOOKUP
588588
select ARCH_REQUIRE_GPIOLIB
589589
select GENERIC_CLOCKEVENTS
590590
select TICK_ONESHOT
@@ -761,7 +761,7 @@ config ARCH_TCC_926
761761
bool "Telechips TCC ARM926-based systems"
762762
select CPU_ARM926T
763763
select HAVE_CLK
764-
select COMMON_CLKDEV
764+
select CLKDEV_LOOKUP
765765
select GENERIC_CLOCKEVENTS
766766
help
767767
Support for Telechips TCC ARM926-based systems.
@@ -785,7 +785,7 @@ config ARCH_U300
785785
select ARM_AMBA
786786
select ARM_VIC
787787
select GENERIC_CLOCKEVENTS
788-
select COMMON_CLKDEV
788+
select CLKDEV_LOOKUP
789789
select GENERIC_GPIO
790790
help
791791
Support for ST-Ericsson U300 series mobile platforms.
@@ -795,7 +795,7 @@ config ARCH_U8500
795795
select CPU_V7
796796
select ARM_AMBA
797797
select GENERIC_CLOCKEVENTS
798-
select COMMON_CLKDEV
798+
select CLKDEV_LOOKUP
799799
select ARCH_REQUIRE_GPIOLIB
800800
help
801801
Support for ST-Ericsson's Ux500 architecture
@@ -805,7 +805,7 @@ config ARCH_NOMADIK
805805
select ARM_AMBA
806806
select ARM_VIC
807807
select CPU_ARM926T
808-
select COMMON_CLKDEV
808+
select CLKDEV_LOOKUP
809809
select GENERIC_CLOCKEVENTS
810810
select ARCH_REQUIRE_GPIOLIB
811811
help
@@ -817,7 +817,7 @@ config ARCH_DAVINCI
817817
select ARCH_REQUIRE_GPIOLIB
818818
select ZONE_DMA
819819
select HAVE_IDE
820-
select COMMON_CLKDEV
820+
select CLKDEV_LOOKUP
821821
select GENERIC_ALLOCATOR
822822
select ARCH_HAS_HOLES_MEMORYMODEL
823823
help
@@ -837,7 +837,7 @@ config PLAT_SPEAR
837837
bool "ST SPEAr"
838838
select ARM_AMBA
839839
select ARCH_REQUIRE_GPIOLIB
840-
select COMMON_CLKDEV
840+
select CLKDEV_LOOKUP
841841
select GENERIC_CLOCKEVENTS
842842
select HAVE_CLK
843843
help

‎arch/arm/common/Kconfig‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,3 @@ config SHARP_PARAM
3737

3838
config SHARP_SCOOP
3939
bool
40-
41-
config COMMON_CLKDEV
42-
bool
43-
select HAVE_CLK

‎arch/arm/common/Makefile‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ obj-$(CONFIG_SHARP_SCOOP) += scoop.o
1616
obj-$(CONFIG_ARCH_IXP2000) += uengine.o
1717
obj-$(CONFIG_ARCH_IXP23XX) += uengine.o
1818
obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o
19-
obj-$(CONFIG_COMMON_CLKDEV) += clkdev.o

‎arch/arm/include/asm/clkdev.h‎

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,13 @@
1212
#ifndef __ASM_CLKDEV_H
1313
#define __ASM_CLKDEV_H
1414

15-
struct clk;
16-
struct device;
15+
#include <linux/slab.h>
1716

18-
struct clk_lookup {
19-
struct list_head node;
20-
const char *dev_id;
21-
const char *con_id;
22-
struct clk *clk;
23-
};
17+
#include <mach/clkdev.h>
2418

25-
struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
26-
const char *dev_fmt, ...);
27-
28-
void clkdev_add(struct clk_lookup *cl);
29-
void clkdev_drop(struct clk_lookup *cl);
30-
31-
void clkdev_add_table(struct clk_lookup *, size_t);
32-
int clk_add_alias(const char *, const char *, char *, struct device *);
19+
static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
20+
{
21+
return kzalloc(size, GFP_KERNEL);
22+
}
3323

3424
#endif

‎arch/arm/mach-bcmring/clock.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@
2121
#include <linux/string.h>
2222
#include <linux/clk.h>
2323
#include <linux/spinlock.h>
24+
#include <linux/clkdev.h>
2425
#include <mach/csp/hw_cfg.h>
2526
#include <mach/csp/chipcHw_def.h>
2627
#include <mach/csp/chipcHw_reg.h>
2728
#include <mach/csp/chipcHw_inline.h>
2829

29-
#include <asm/clkdev.h>
30-
3130
#include "clock.h"
3231

3332
#define clk_is_primary(x) ((x)->type & CLK_TYPE_PRIMARY)

‎arch/arm/mach-bcmring/core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
#include <linux/amba/bus.h>
3131
#include <linux/clocksource.h>
3232
#include <linux/clockchips.h>
33+
#include <linux/clkdev.h>
3334

3435
#include <mach/csp/mm_addr.h>
3536
#include <mach/hardware.h>
36-
#include <asm/clkdev.h>
3737
#include <linux/io.h>
3838
#include <asm/irq.h>
3939
#include <asm/hardware/arm_timer.h>

‎arch/arm/mach-davinci/clock.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#ifndef __ASSEMBLER__
6969

7070
#include <linux/list.h>
71-
#include <asm/clkdev.h>
71+
#include <linux/clkdev.h>
7272

7373
#define PLLSTAT_GOSTAT BIT(0)
7474
#define PLLCMD_GOSET BIT(0)

‎arch/arm/mach-ep93xx/clock.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
#include <linux/string.h>
2020
#include <linux/io.h>
2121
#include <linux/spinlock.h>
22+
#include <linux/clkdev.h>
2223

2324
#include <mach/hardware.h>
2425

25-
#include <asm/clkdev.h>
2626
#include <asm/div64.h>
2727

2828

‎arch/arm/mach-imx/clock-imx1.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
#include <linux/err.h>
2323
#include <linux/clk.h>
2424
#include <linux/io.h>
25-
26-
#include <asm/clkdev.h>
25+
#include <linux/clkdev.h>
2726

2827
#include <mach/clock.h>
2928
#include <mach/hardware.h>

‎arch/arm/mach-imx/clock-imx21.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
#include <linux/clk.h>
2222
#include <linux/io.h>
2323
#include <linux/module.h>
24+
#include <linux/clkdev.h>
2425

2526
#include <mach/clock.h>
2627
#include <mach/hardware.h>
2728
#include <mach/common.h>
28-
#include <asm/clkdev.h>
2929
#include <asm/div64.h>
3030

3131
#define IO_ADDR_CCM(off) (MX21_IO_ADDRESS(MX21_CCM_BASE_ADDR + (off)))

0 commit comments

Comments
 (0)