ARM: 6103/1: nomadik: define clocks statically
Add a table for clocks to be defined statically, so that new clocks can be added without having to call nmdk_clk_create() for each of them. Remove the now unused nmdk_clk_create() function. Acked-by: Alessandro Rubini <rubini@unipv.it> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
2210d6453b
commit
dc6048c7f9
|
@ -32,7 +32,6 @@
|
||||||
#include <mach/setup.h>
|
#include <mach/setup.h>
|
||||||
#include <mach/nand.h>
|
#include <mach/nand.h>
|
||||||
#include <mach/fsmc.h>
|
#include <mach/fsmc.h>
|
||||||
#include "clock.h"
|
|
||||||
|
|
||||||
/* Initial value for SRC control register: all timers use MXTAL/8 source */
|
/* Initial value for SRC control register: all timers use MXTAL/8 source */
|
||||||
#define SRC_CR_INIT_MASK 0x00007fff
|
#define SRC_CR_INIT_MASK 0x00007fff
|
||||||
|
@ -202,11 +201,6 @@ static struct amba_device *amba_devs[] __initdata = {
|
||||||
&uart1_device,
|
&uart1_device,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* We have a fixed clock alone, by now */
|
|
||||||
static struct clk nhk8815_clk_48 = {
|
|
||||||
.rate = 48*1000*1000,
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct resource nhk8815_eth_resources[] = {
|
static struct resource nhk8815_eth_resources[] = {
|
||||||
{
|
{
|
||||||
.name = "smc91x-regs",
|
.name = "smc91x-regs",
|
||||||
|
@ -276,10 +270,8 @@ static void __init nhk8815_platform_init(void)
|
||||||
platform_add_devices(nhk8815_platform_devices,
|
platform_add_devices(nhk8815_platform_devices,
|
||||||
ARRAY_SIZE(nhk8815_platform_devices));
|
ARRAY_SIZE(nhk8815_platform_devices));
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
|
for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
|
||||||
nmdk_clk_create(&nhk8815_clk_48, amba_devs[i]->dev.init_name);
|
|
||||||
amba_device_register(amba_devs[i], &iomem_resource);
|
amba_device_register(amba_devs[i], &iomem_resource);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MACHINE_START(NOMADIK, "NHK8815")
|
MACHINE_START(NOMADIK, "NHK8815")
|
||||||
|
|
|
@ -32,14 +32,26 @@ void clk_disable(struct clk *clk)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(clk_disable);
|
EXPORT_SYMBOL(clk_disable);
|
||||||
|
|
||||||
/* Create a clock structure with the given name */
|
/* We have a fixed clock alone, for now */
|
||||||
int nmdk_clk_create(struct clk *clk, const char *dev_id)
|
static struct clk clk_48 = {
|
||||||
{
|
.rate = 48 * 1000 * 1000,
|
||||||
struct clk_lookup *clkdev;
|
};
|
||||||
|
|
||||||
clkdev = clkdev_alloc(clk, NULL, dev_id);
|
#define CLK(_clk, dev) \
|
||||||
if (!clkdev)
|
{ \
|
||||||
return -ENOMEM;
|
.clk = _clk, \
|
||||||
clkdev_add(clkdev);
|
.dev_id = dev, \
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct clk_lookup lookups[] = {
|
||||||
|
CLK(&clk_48, "uart0"),
|
||||||
|
CLK(&clk_48, "uart1"),
|
||||||
|
};
|
||||||
|
|
||||||
|
static int __init clk_init(void)
|
||||||
|
{
|
||||||
|
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
arch_initcall(clk_init);
|
||||||
|
|
|
@ -11,4 +11,3 @@
|
||||||
struct clk {
|
struct clk {
|
||||||
unsigned long rate;
|
unsigned long rate;
|
||||||
};
|
};
|
||||||
extern int nmdk_clk_create(struct clk *clk, const char *dev_id);
|
|
||||||
|
|
Loading…
Reference in a new issue