Commit 6d803ba7 authored by Jean-Christop PLAGNIOL-VILLARD's avatar Jean-Christop PLAGNIOL-VILLARD Committed by Russell King
Browse files

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: default avatarJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: default avatarPaul Mundt <lethal@linux-sh.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 64d2dc38
...@@ -221,7 +221,7 @@ config ARCH_INTEGRATOR ...@@ -221,7 +221,7 @@ config ARCH_INTEGRATOR
bool "ARM Ltd. Integrator family" bool "ARM Ltd. Integrator family"
select ARM_AMBA select ARM_AMBA
select ARCH_HAS_CPUFREQ select ARCH_HAS_CPUFREQ
select COMMON_CLKDEV select CLKDEV_LOOKUP
select ICST select ICST
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select PLAT_VERSATILE select PLAT_VERSATILE
...@@ -231,7 +231,7 @@ config ARCH_INTEGRATOR ...@@ -231,7 +231,7 @@ config ARCH_INTEGRATOR
config ARCH_REALVIEW config ARCH_REALVIEW
bool "ARM Ltd. RealView family" bool "ARM Ltd. RealView family"
select ARM_AMBA select ARM_AMBA
select COMMON_CLKDEV select CLKDEV_LOOKUP
select ICST select ICST
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select ARCH_WANT_OPTIONAL_GPIOLIB select ARCH_WANT_OPTIONAL_GPIOLIB
...@@ -245,7 +245,7 @@ config ARCH_VERSATILE ...@@ -245,7 +245,7 @@ config ARCH_VERSATILE
bool "ARM Ltd. Versatile family" bool "ARM Ltd. Versatile family"
select ARM_AMBA select ARM_AMBA
select ARM_VIC select ARM_VIC
select COMMON_CLKDEV select CLKDEV_LOOKUP
select ICST select ICST
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select ARCH_WANT_OPTIONAL_GPIOLIB select ARCH_WANT_OPTIONAL_GPIOLIB
...@@ -259,7 +259,7 @@ config ARCH_VEXPRESS ...@@ -259,7 +259,7 @@ config ARCH_VEXPRESS
select ARCH_WANT_OPTIONAL_GPIOLIB select ARCH_WANT_OPTIONAL_GPIOLIB
select ARM_AMBA select ARM_AMBA
select ARM_TIMER_SP804 select ARM_TIMER_SP804
select COMMON_CLKDEV select CLKDEV_LOOKUP
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select HAVE_CLK select HAVE_CLK
select ICST select ICST
...@@ -280,7 +280,7 @@ config ARCH_BCMRING ...@@ -280,7 +280,7 @@ config ARCH_BCMRING
depends on MMU depends on MMU
select CPU_V6 select CPU_V6
select ARM_AMBA select ARM_AMBA
select COMMON_CLKDEV select CLKDEV_LOOKUP
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select ARCH_WANT_OPTIONAL_GPIOLIB select ARCH_WANT_OPTIONAL_GPIOLIB
help help
...@@ -327,7 +327,7 @@ config ARCH_EP93XX ...@@ -327,7 +327,7 @@ config ARCH_EP93XX
select CPU_ARM920T select CPU_ARM920T
select ARM_AMBA select ARM_AMBA
select ARM_VIC select ARM_VIC
select COMMON_CLKDEV select CLKDEV_LOOKUP
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select ARCH_HAS_HOLES_MEMORYMODEL select ARCH_HAS_HOLES_MEMORYMODEL
select ARCH_USES_GETTIMEOFFSET select ARCH_USES_GETTIMEOFFSET
...@@ -347,14 +347,14 @@ config ARCH_MXC ...@@ -347,14 +347,14 @@ config ARCH_MXC
bool "Freescale MXC/iMX-based" bool "Freescale MXC/iMX-based"
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select COMMON_CLKDEV select CLKDEV_LOOKUP
help help
Support for Freescale MXC/iMX-based family of processors Support for Freescale MXC/iMX-based family of processors
config ARCH_STMP3XXX config ARCH_STMP3XXX
bool "Freescale STMP3xxx" bool "Freescale STMP3xxx"
select CPU_ARM926T select CPU_ARM926T
select COMMON_CLKDEV select CLKDEV_LOOKUP
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select USB_ARCH_HAS_EHCI select USB_ARCH_HAS_EHCI
...@@ -472,7 +472,7 @@ config ARCH_LPC32XX ...@@ -472,7 +472,7 @@ config ARCH_LPC32XX
select HAVE_IDE select HAVE_IDE
select ARM_AMBA select ARM_AMBA
select USB_ARCH_HAS_OHCI select USB_ARCH_HAS_OHCI
select COMMON_CLKDEV select CLKDEV_LOOKUP
select GENERIC_TIME select GENERIC_TIME
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
help help
...@@ -506,7 +506,7 @@ config ARCH_MMP ...@@ -506,7 +506,7 @@ config ARCH_MMP
bool "Marvell PXA168/910/MMP2" bool "Marvell PXA168/910/MMP2"
depends on MMU depends on MMU
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select COMMON_CLKDEV select CLKDEV_LOOKUP
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select TICK_ONESHOT select TICK_ONESHOT
select PLAT_PXA select PLAT_PXA
...@@ -539,7 +539,7 @@ config ARCH_W90X900 ...@@ -539,7 +539,7 @@ config ARCH_W90X900
bool "Nuvoton W90X900 CPU" bool "Nuvoton W90X900 CPU"
select CPU_ARM926T select CPU_ARM926T
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select COMMON_CLKDEV select CLKDEV_LOOKUP
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
help help
Support for Nuvoton (Winbond logic dept.) ARM9 processor, Support for Nuvoton (Winbond logic dept.) ARM9 processor,
...@@ -553,7 +553,7 @@ config ARCH_W90X900 ...@@ -553,7 +553,7 @@ config ARCH_W90X900
config ARCH_NUC93X config ARCH_NUC93X
bool "Nuvoton NUC93X CPU" bool "Nuvoton NUC93X CPU"
select CPU_ARM926T select CPU_ARM926T
select COMMON_CLKDEV select CLKDEV_LOOKUP
help help
Support for Nuvoton (Winbond logic dept.) NUC93X MCU,The NUC93X is a Support for Nuvoton (Winbond logic dept.) NUC93X MCU,The NUC93X is a
low-power and high performance MPEG-4/JPEG multimedia controller chip. low-power and high performance MPEG-4/JPEG multimedia controller chip.
...@@ -564,7 +564,7 @@ config ARCH_TEGRA ...@@ -564,7 +564,7 @@ config ARCH_TEGRA
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select GENERIC_GPIO select GENERIC_GPIO
select HAVE_CLK select HAVE_CLK
select COMMON_CLKDEV select CLKDEV_LOOKUP
select ARCH_HAS_BARRIERS if CACHE_L2X0 select ARCH_HAS_BARRIERS if CACHE_L2X0
select ARCH_HAS_CPUFREQ select ARCH_HAS_CPUFREQ
help help
...@@ -574,7 +574,7 @@ config ARCH_TEGRA ...@@ -574,7 +574,7 @@ config ARCH_TEGRA
config ARCH_PNX4008 config ARCH_PNX4008
bool "Philips Nexperia PNX4008 Mobile" bool "Philips Nexperia PNX4008 Mobile"
select CPU_ARM926T select CPU_ARM926T
select COMMON_CLKDEV select CLKDEV_LOOKUP
select ARCH_USES_GETTIMEOFFSET select ARCH_USES_GETTIMEOFFSET
help help
This enables support for Philips PNX4008 mobile platform. This enables support for Philips PNX4008 mobile platform.
...@@ -584,7 +584,7 @@ config ARCH_PXA ...@@ -584,7 +584,7 @@ config ARCH_PXA
depends on MMU depends on MMU
select ARCH_MTD_XIP select ARCH_MTD_XIP
select ARCH_HAS_CPUFREQ select ARCH_HAS_CPUFREQ
select COMMON_CLKDEV select CLKDEV_LOOKUP
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select TICK_ONESHOT select TICK_ONESHOT
...@@ -761,7 +761,7 @@ config ARCH_TCC_926 ...@@ -761,7 +761,7 @@ config ARCH_TCC_926
bool "Telechips TCC ARM926-based systems" bool "Telechips TCC ARM926-based systems"
select CPU_ARM926T select CPU_ARM926T
select HAVE_CLK select HAVE_CLK
select COMMON_CLKDEV select CLKDEV_LOOKUP
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
help help
Support for Telechips TCC ARM926-based systems. Support for Telechips TCC ARM926-based systems.
...@@ -785,7 +785,7 @@ config ARCH_U300 ...@@ -785,7 +785,7 @@ config ARCH_U300
select ARM_AMBA select ARM_AMBA
select ARM_VIC select ARM_VIC
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select COMMON_CLKDEV select CLKDEV_LOOKUP
select GENERIC_GPIO select GENERIC_GPIO
help help
Support for ST-Ericsson U300 series mobile platforms. Support for ST-Ericsson U300 series mobile platforms.
...@@ -795,7 +795,7 @@ config ARCH_U8500 ...@@ -795,7 +795,7 @@ config ARCH_U8500
select CPU_V7 select CPU_V7
select ARM_AMBA select ARM_AMBA
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select COMMON_CLKDEV select CLKDEV_LOOKUP
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
help help
Support for ST-Ericsson's Ux500 architecture Support for ST-Ericsson's Ux500 architecture
...@@ -805,7 +805,7 @@ config ARCH_NOMADIK ...@@ -805,7 +805,7 @@ config ARCH_NOMADIK
select ARM_AMBA select ARM_AMBA
select ARM_VIC select ARM_VIC
select CPU_ARM926T select CPU_ARM926T
select COMMON_CLKDEV select CLKDEV_LOOKUP
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
help help
...@@ -817,7 +817,7 @@ config ARCH_DAVINCI ...@@ -817,7 +817,7 @@ config ARCH_DAVINCI
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select ZONE_DMA select ZONE_DMA
select HAVE_IDE select HAVE_IDE
select COMMON_CLKDEV select CLKDEV_LOOKUP
select GENERIC_ALLOCATOR select GENERIC_ALLOCATOR
select ARCH_HAS_HOLES_MEMORYMODEL select ARCH_HAS_HOLES_MEMORYMODEL
help help
...@@ -837,7 +837,7 @@ config PLAT_SPEAR ...@@ -837,7 +837,7 @@ config PLAT_SPEAR
bool "ST SPEAr" bool "ST SPEAr"
select ARM_AMBA select ARM_AMBA
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select COMMON_CLKDEV select CLKDEV_LOOKUP
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select HAVE_CLK select HAVE_CLK
help help
......
...@@ -37,7 +37,3 @@ config SHARP_PARAM ...@@ -37,7 +37,3 @@ config SHARP_PARAM
config SHARP_SCOOP config SHARP_SCOOP
bool bool
config COMMON_CLKDEV
bool
select HAVE_CLK
...@@ -16,4 +16,3 @@ obj-$(CONFIG_SHARP_SCOOP) += scoop.o ...@@ -16,4 +16,3 @@ obj-$(CONFIG_SHARP_SCOOP) += scoop.o
obj-$(CONFIG_ARCH_IXP2000) += uengine.o obj-$(CONFIG_ARCH_IXP2000) += uengine.o
obj-$(CONFIG_ARCH_IXP23XX) += uengine.o obj-$(CONFIG_ARCH_IXP23XX) += uengine.o
obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o
obj-$(CONFIG_COMMON_CLKDEV) += clkdev.o
...@@ -12,23 +12,13 @@ ...@@ -12,23 +12,13 @@
#ifndef __ASM_CLKDEV_H #ifndef __ASM_CLKDEV_H
#define __ASM_CLKDEV_H #define __ASM_CLKDEV_H
struct clk; #include <linux/slab.h>
struct device;
struct clk_lookup { #include <mach/clkdev.h>
struct list_head node;
const char *dev_id;
const char *con_id;
struct clk *clk;
};
struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id, static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
const char *dev_fmt, ...); {
return kzalloc(size, GFP_KERNEL);
void clkdev_add(struct clk_lookup *cl); }
void clkdev_drop(struct clk_lookup *cl);
void clkdev_add_table(struct clk_lookup *, size_t);
int clk_add_alias(const char *, const char *, char *, struct device *);
#endif #endif
...@@ -21,13 +21,12 @@ ...@@ -21,13 +21,12 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/clkdev.h>
#include <mach/csp/hw_cfg.h> #include <mach/csp/hw_cfg.h>
#include <mach/csp/chipcHw_def.h> #include <mach/csp/chipcHw_def.h>
#include <mach/csp/chipcHw_reg.h> #include <mach/csp/chipcHw_reg.h>
#include <mach/csp/chipcHw_inline.h> #include <mach/csp/chipcHw_inline.h>
#include <asm/clkdev.h>
#include "clock.h" #include "clock.h"
#define clk_is_primary(x) ((x)->type & CLK_TYPE_PRIMARY) #define clk_is_primary(x) ((x)->type & CLK_TYPE_PRIMARY)
......
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
#include <linux/amba/bus.h> #include <linux/amba/bus.h>
#include <linux/clocksource.h> #include <linux/clocksource.h>
#include <linux/clockchips.h> #include <linux/clockchips.h>
#include <linux/clkdev.h>
#include <mach/csp/mm_addr.h> #include <mach/csp/mm_addr.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <asm/clkdev.h>
#include <linux/io.h> #include <linux/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/hardware/arm_timer.h> #include <asm/hardware/arm_timer.h>
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
#ifndef __ASSEMBLER__ #ifndef __ASSEMBLER__
#include <linux/list.h> #include <linux/list.h>
#include <asm/clkdev.h> #include <linux/clkdev.h>
#define PLLSTAT_GOSTAT BIT(0) #define PLLSTAT_GOSTAT BIT(0)
#define PLLCMD_GOSET BIT(0) #define PLLCMD_GOSET BIT(0)
......
...@@ -19,10 +19,10 @@ ...@@ -19,10 +19,10 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/clkdev.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <asm/clkdev.h>
#include <asm/div64.h> #include <asm/div64.h>
......
...@@ -22,8 +22,7 @@ ...@@ -22,8 +22,7 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/clkdev.h>
#include <asm/clkdev.h>
#include <mach/clock.h> #include <mach/clock.h>
#include <mach/hardware.h> #include <mach/hardware.h>
......
...@@ -21,11 +21,11 @@ ...@@ -21,11 +21,11 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/clkdev.h>
#include <mach/clock.h> #include <mach/clock.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/common.h> #include <mach/common.h>
#include <asm/clkdev.h>
#include <asm/div64.h> #include <asm/div64.h>
#define IO_ADDR_CCM(off) (MX21_IO_ADDRESS(MX21_CCM_BASE_ADDR + (off))) #define IO_ADDR_CCM(off) (MX21_IO_ADDRESS(MX21_CCM_BASE_ADDR + (off)))
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/clkdev.h>
#include <asm/clkdev.h>
#include <asm/div64.h> #include <asm/div64.h>
#include <mach/clock.h> #include <mach/clock.h>
......
...@@ -21,9 +21,8 @@ ...@@ -21,9 +21,8 @@
#include <linux/amba/bus.h> #include <linux/amba/bus.h>
#include <linux/amba/serial.h> #include <linux/amba/serial.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/clkdev.h>
#include <asm/clkdev.h>
#include <mach/clkdev.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/platform.h> #include <mach/platform.h>
#include <asm/irq.h> #include <asm/irq.h>
......
...@@ -22,9 +22,8 @@ ...@@ -22,9 +22,8 @@
#include <linux/amba/clcd.h> #include <linux/amba/clcd.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/clkdev.h>
#include <asm/clkdev.h>
#include <mach/clkdev.h>
#include <asm/hardware/icst.h> #include <asm/hardware/icst.h>
#include <mach/lm.h> #include <mach/lm.h>
#include <mach/impd1.h> #include <mach/impd1.h>
......
...@@ -21,9 +21,8 @@ ...@@ -21,9 +21,8 @@
#include <linux/amba/mmci.h> #include <linux/amba/mmci.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/clkdev.h>
#include <asm/clkdev.h>
#include <mach/clkdev.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/platform.h> #include <mach/platform.h>
#include <asm/irq.h> #include <asm/irq.h>
......
...@@ -90,10 +90,9 @@ ...@@ -90,10 +90,9 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/amba/bus.h> #include <linux/amba/bus.h>
#include <linux/amba/clcd.h> #include <linux/amba/clcd.h>
#include <linux/clkdev.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <asm/clkdev.h>
#include <mach/clkdev.h>
#include <mach/platform.h> #include <mach/platform.h>
#include "clock.h" #include "clock.h"
#include "common.h" #include "common.h"
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#include <asm/clkdev.h> #include <linux/clkdev.h>
struct clkops { struct clkops {
void (*enable)(struct clk *); void (*enable)(struct clk *);
......
...@@ -21,8 +21,7 @@ ...@@ -21,8 +21,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/clkdev.h>
#include <asm/clkdev.h>
#include <mach/clock.h> #include <mach/clock.h>
#include <mach/hardware.h> #include <mach/hardware.h>
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/clkdev.h>
#include <asm/clkdev.h>
#include <asm/div64.h> #include <asm/div64.h>
#include <mach/clock.h> #include <mach/clock.h>
......
...@@ -21,8 +21,7 @@ ...@@ -21,8 +21,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/clkdev.h>
#include <asm/clkdev.h>
#include <mach/clock.h> #include <mach/clock.h>
#include <mach/hardware.h> #include <mach/hardware.h>
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/clkdev.h>
#include <asm/clkdev.h>
#include <asm/div64.h> #include <asm/div64.h>
#include <mach/hardware.h> #include <mach/hardware.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment